aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2019-06-23 19:24:32 +0300
committerEli Zaretskii2019-06-23 19:24:32 +0300
commita1deb6cac305a73e799c63e2fbfe7221790e1e61 (patch)
tree598556d63acf310ffbd1c4ec07296b2e3996ef63 /src
parentd2bbea23fa02c09a22e654f4127c234606d64fea (diff)
downloademacs-a1deb6cac305a73e799c63e2fbfe7221790e1e61.tar.gz
emacs-a1deb6cac305a73e799c63e2fbfe7221790e1e61.zip
; * src/image.c: Minor copyedits of native transform commentary.
Diffstat (limited to 'src')
-rw-r--r--src/image.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/image.c b/src/image.c
index 866323ba6e5..7b648c46ae9 100644
--- a/src/image.c
+++ b/src/image.c
@@ -1986,7 +1986,7 @@ compute_image_size (size_t width, size_t height,
1986 Transforms are done by creating a matrix for each action we wish to 1986 Transforms are done by creating a matrix for each action we wish to
1987 take, then multiplying the transformation matrix by each of those 1987 take, then multiplying the transformation matrix by each of those
1988 matrices in order (matrix multiplication is not commutative). 1988 matrices in order (matrix multiplication is not commutative).
1989 After weve done that we can use our modified transformation matrix 1989 After we've done that we can use our modified transformation matrix
1990 to transform points. We take the x and y coordinates and convert 1990 to transform points. We take the x and y coordinates and convert
1991 them into a 3x1 matrix and multiply that by the transformation 1991 them into a 3x1 matrix and multiply that by the transformation
1992 matrix and it gives us a new, transformed, set of coordinates: 1992 matrix and it gives us a new, transformed, set of coordinates:
@@ -1995,7 +1995,7 @@ compute_image_size (size_t width, size_t height,
1995 [m21 m22 ty] X [y] = [m21*x+m22*y+ty*1] = [y'] 1995 [m21 m22 ty] X [y] = [m21*x+m22*y+ty*1] = [y']
1996 [ 0 0 1] [1] [ 0*x+0*y+1*1] [ 1] 1996 [ 0 0 1] [1] [ 0*x+0*y+1*1] [ 1]
1997 1997
1998 We dont have to worry about the last step as the graphics toolkit 1998 We don't have to worry about the last step as the graphics toolkit
1999 will do it for us. 1999 will do it for us.
2000 2000
2001 The three transforms we are concerned with are translation, scaling 2001 The three transforms we are concerned with are translation, scaling
@@ -2029,19 +2029,19 @@ compute_image_size (size_t width, size_t height,
2029 [ 0 0 1] 2029 [ 0 0 1]
2030 2030
2031 Where r is the angle of rotation required. Rotation occurs around 2031 Where r is the angle of rotation required. Rotation occurs around
2032 the origin, not the centre of the image. Note that this is 2032 the origin, not the center of the image. Note that this is
2033 normally considered a counter-clockwise rotation, however because 2033 normally considered a counter-clockwise rotation, however because
2034 our y axis is reversed, (0, 0) at the top left, it works as a 2034 our y axis is reversed, (0, 0) at the top left, it works as a
2035 clockwise rotation. 2035 clockwise rotation.
2036 2036
2037 The full process of rotating an image is to move the origin to the 2037 The full process of rotating an image is to move the origin to the
2038 centre of the image (width/2, height/2), perform the rotation, and 2038 center of the image (width/2, height/2), perform the rotation, and
2039 finally move the origin back to the top left of the image, which 2039 finally move the origin back to the top left of the image, which
2040 may now be a different corner. 2040 may now be a different corner.
2041 2041
2042 Cropping is easier as we just move the origin to the top left of 2042 Cropping is easier as we just move the origin to the top left of
2043 where we want to crop and set the width and height accordingly. 2043 where we want to crop and set the width and height accordingly.
2044 The matrices dont know anything about width and height. 2044 The matrices don't know anything about width and height.
2045 2045
2046 It's possible to pre-calculate the matrix multiplications and just 2046 It's possible to pre-calculate the matrix multiplications and just
2047 generate one transform matrix that will do everything we need in a 2047 generate one transform matrix that will do everything we need in a