aboutsummaryrefslogtreecommitdiffstats
path: root/doc/lispref
diff options
context:
space:
mode:
authorEli Zaretskii2019-06-29 14:51:41 +0300
committerEli Zaretskii2019-06-29 14:51:41 +0300
commit74a5a332fee8a346cf65ed6656c1b08dc1df5fde (patch)
tree9b6488ab0dccc372c643f5b521e731f26886cfb4 /doc/lispref
parent67b50770c050c55a26cd13b9568b01a80a449885 (diff)
downloademacs-74a5a332fee8a346cf65ed6656c1b08dc1df5fde.tar.gz
emacs-74a5a332fee8a346cf65ed6656c1b08dc1df5fde.zip
Support native image transforms on MS-Windows
This changeset also rearranges native image transform code for other platforms to make it cleaner, and also removes the support for native cropping. For the discussions, see https://lists.gnu.org/archive/html/emacs-devel/2019-06/msg00242.html * src/w32term.c (w32_image_rotations_p, transform): New functions. (w32_draw_image_foreground): If image rotation is requested and supported, call PlgBlt to transform the image. (w32_initialize): Populate the PlgBlt function pointer if it is supported. * src/w32term.h (w32_image_rotations_p): Add prototype. * src/dispextern.h (struct image) [HAVE_NTGUI]: New member xform. * src/image.c (compute_image_rotation): Renamed from image_set_rotation. Only compute and returns the rotation angle; leave the matrix calculation for later. Log an error message if the :rotation parameter is not a number. (image_set_crop): Function deleted. We no longer support native cropping, as one can display an image slice instead. (image_set_transform): Compute the transform matrix in its entirety here, in two variants: one for XRender and Cairo, the other for NS and MS-Windows. call compute_image_size and compute_image_rotation internally. (lookup_image) [HAVE_NATIVE_TRANSFORMS]: Call only image_set_transform. No need to pass the transform matrix to image_set_transform. (Fimage_transforms_p): Return a list of transform capabilities rather than a simple boolean. Support TTY frames as well. * src/nsimage.m (setTransform:): Don't invert the matrix, as it is already inverted in image.c. * test/manual/image-transforms-tests.el (test-cropping): State in the text that only ImageMagick supports cropping. * doc/lispref/display.texi (Image Descriptors): Update the documentation of native image transforms. (ImageMagick Images): Move the description of ':crop' here. * etc/NEWS: Minor copyedits of the feature announcement.
Diffstat (limited to 'doc/lispref')
-rw-r--r--doc/lispref/display.texi60
1 files changed, 37 insertions, 23 deletions
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index 217df3b2cc2..c95f2df0fb8 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -5188,24 +5188,6 @@ values. If both @code{:scale} and @code{:height}/@code{:width} are
5188specified, the height/width will be adjusted by the specified scaling 5188specified, the height/width will be adjusted by the specified scaling
5189factor. 5189factor.
5190 5190
5191@item :crop @var{geometry}
5192This should be a list of the form @code{(@var{width} @var{height}
5193@var{x} @var{y})}. @var{width} and @var{height} specify the width
5194and height of the cropped image. If @var{x} is a positive number it
5195specifies the offset of the cropped area from the left of the original
5196image, and if negative the offset from the right. If @var{y} is a
5197positive number it specifies the offset from the top of the original
5198image, and if negative from the bottom. If @var{x} or @var{y} are
5199@code{nil} or unspecified the crop area will be centred on the
5200original image.
5201
5202If the crop area is outside or overlaps the edge of the image it will
5203be reduced to exclude any areas outside of the image. This means it
5204is not possible to use @code{:crop} to increase the size of the image
5205by entering large @var{width} or @var{height} values.
5206
5207Cropping is performed after scaling but before rotation.
5208
5209@item :rotation @var{angle} 5191@item :rotation @var{angle}
5210Specifies a rotation angle in degrees. Only multiples of 90 degrees 5192Specifies a rotation angle in degrees. Only multiples of 90 degrees
5211are supported, unless the image type is @code{imagemagick}. Positive 5193are supported, unless the image type is @code{imagemagick}. Positive
@@ -5355,16 +5337,30 @@ This function returns @code{t} if image @var{spec} has a mask bitmap.
5355@end defun 5337@end defun
5356 5338
5357@defun image-transforms-p &optional frame 5339@defun image-transforms-p &optional frame
5358This function returns @code{t} if @var{frame} supports image scaling 5340This function returns non-@code{nil} if @var{frame} supports image
5359and rotation. @var{frame} @code{nil} or omitted means to use the 5341scaling and rotation. @var{frame} @code{nil} or omitted means to use
5360selected frame (@pxref{Input Focus}). 5342the selected frame (@pxref{Input Focus}). The returned list includes
5343symbols that indicate which image transform operations are supported:
5344
5345@table @code
5346@item scale
5347Image scaling is supported by @var{frame} via the @code{:scale},
5348@code{:width}, @code{:height}, @code{:max-width}, and
5349@code{:max-height} properties.
5350@item rotate90
5351Image rotation is supported by @var{frame} if the rotation angle is an
5352integral multiple of 90 degrees.
5353@item rotate
5354Image rotation by arbitrary angles is supported by @var{frame}.
5355@item crop
5356Image cropping is supported by @var{frame}.
5357@end table
5361 5358
5362If image transforms are not supported, @code{:rotation}, 5359If image transforms are not supported, @code{:rotation}, @code{:crop},
5363@code{:width}, @code{:height}, @code{:scale}, @code{:max-width} and 5360@code{:width}, @code{:height}, @code{:scale}, @code{:max-width} and
5364@code{:max-height} will only be usable through ImageMagick, if 5361@code{:max-height} will only be usable through ImageMagick, if
5365available (@pxref{ImageMagick Images}). 5362available (@pxref{ImageMagick Images}).
5366@end defun 5363@end defun
5367
5368@node XBM Images 5364@node XBM Images
5369@subsection XBM Images 5365@subsection XBM Images
5370@cindex XBM 5366@cindex XBM
@@ -5506,6 +5502,24 @@ The value, @var{type}, should be a symbol specifying the type of the
5506image data, as found in @code{image-format-suffixes}. This is used 5502image data, as found in @code{image-format-suffixes}. This is used
5507when the image does not have an associated file name, to provide a 5503when the image does not have an associated file name, to provide a
5508hint to ImageMagick to help it detect the image type. 5504hint to ImageMagick to help it detect the image type.
5505
5506@item :crop @var{geometry}
5507The value of @var{geometry} should be a list of the form
5508@code{(@var{width} @var{height} @var{x} @var{y})}. @var{width} and
5509@var{height} specify the width and height of the cropped image. If
5510@var{x} is a positive number it specifies the offset of the cropped
5511area from the left of the original image, and if negative the offset
5512from the right. If @var{y} is a positive number it specifies the
5513offset from the top of the original image, and if negative from the
5514bottom. If @var{x} or @var{y} are @code{nil} or unspecified the crop
5515area will be centred on the original image.
5516
5517If the crop area is outside or overlaps the edge of the image it will
5518be reduced to exclude any areas outside of the image. This means it
5519is not possible to use @code{:crop} to increase the size of the image
5520by entering large @var{width} or @var{height} values.
5521
5522Cropping is performed after scaling but before rotation.
5509@end table 5523@end table
5510 5524
5511@node SVG Images 5525@node SVG Images