diff options
| author | Alan Third | 2019-06-05 21:51:33 +0100 |
|---|---|---|
| committer | Alan Third | 2019-06-05 22:28:46 +0100 |
| commit | 610fb73ab6d7a22b722f523d6ebc4aa8fa1db7c9 (patch) | |
| tree | 8a3ee992ccc310071ac5a97ced8907652974c88e /doc/lispref | |
| parent | 9201cf62ce9f17793bb6103050c9ba27eb942e57 (diff) | |
| download | emacs-610fb73ab6d7a22b722f523d6ebc4aa8fa1db7c9.tar.gz emacs-610fb73ab6d7a22b722f523d6ebc4aa8fa1db7c9.zip | |
Add native image rotation and cropping
* lisp/image.el (image--get-imagemagick-and-warn): Only fallback to
ImageMagick if native transforms aren't available.
* src/dispextern.h (INIT_MATRIX, COPY_MATRIX, MULT_MATRICES): New
macros for matrix manipulation.
(HAVE_NATIVE_SCALING, HAVE_NATIVE_TRANSFORMS): Rename and change all
relevant locations.
* src/image.c (x_set_image_rotation):
(x_set_transform): New functions.
(x_set_image_size): Use transform matrix for resizing under X and NS.
(x_set_image_crop): New function.
(lookup_image): Use the new transform functions.
(Fimage_scaling_p, Fimage_transforms_p): Rename and update all
callers.
* src/nsimage.m (ns_load_image): Remove rotation code.
(ns_image_set_transform): New function.
([EmacsImage dealloc]): Release the saved transform.
([EmacsImage rotate:]): Remove unneeded method.
([EmacsImage setTransform:]): New method.
* src/nsterm.h (EmacsImage): Add transform property and update method
definitions.
* src/nsterm.m (ns_dumpglyphs_image): Use the transform to draw the
image correctly.
* src/xterm.c (x_composite_image): Use PictOpSrc as we don't care
about alpha values here.
* doc/lispref/display.texi (Image Descriptors): Add :rotation.
(ImageMagick Images): Remove :rotation.
Diffstat (limited to 'doc/lispref')
| -rw-r--r-- | doc/lispref/display.texi | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index 95985ea5750..82af02fc384 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi | |||
| @@ -5181,6 +5181,9 @@ values. If both @code{:scale} and @code{:height}/@code{:width} are | |||
| 5181 | specified, the height/width will be adjusted by the specified scaling | 5181 | specified, the height/width will be adjusted by the specified scaling |
| 5182 | factor. | 5182 | factor. |
| 5183 | 5183 | ||
| 5184 | @item :rotation @var{angle} | ||
| 5185 | Specifies a rotation angle in degrees. | ||
| 5186 | |||
| 5184 | @item :index @var{frame} | 5187 | @item :index @var{frame} |
| 5185 | @xref{Multi-Frame Images}. | 5188 | @xref{Multi-Frame Images}. |
| 5186 | 5189 | ||
| @@ -5323,14 +5326,15 @@ This function returns @code{t} if image @var{spec} has a mask bitmap. | |||
| 5323 | (@pxref{Input Focus}). | 5326 | (@pxref{Input Focus}). |
| 5324 | @end defun | 5327 | @end defun |
| 5325 | 5328 | ||
| 5326 | @defun image-scaling-p &optional frame | 5329 | @defun image-transforms-p &optional frame |
| 5327 | This function returns @code{t} if @var{frame} supports image scaling. | 5330 | This function returns @code{t} if @var{frame} supports image scaling |
| 5328 | @var{frame} @code{nil} or omitted means to use the selected frame | 5331 | and rotation. @var{frame} @code{nil} or omitted means to use the |
| 5329 | (@pxref{Input Focus}). | 5332 | selected frame (@pxref{Input Focus}). |
| 5330 | 5333 | ||
| 5331 | If image scaling is not supported, @code{:width}, @code{:height}, | 5334 | If image transforms are not supported, @code{:rotation}, |
| 5332 | @code{:scale}, @code{:max-width} and @code{:max-height} will only be | 5335 | @code{:width}, @code{:height}, @code{:scale}, @code{:max-width} and |
| 5333 | usable through ImageMagick, if available (@pxref{ImageMagick Images}). | 5336 | @code{:max-height} will only be usable through ImageMagick, if |
| 5337 | available (@pxref{ImageMagick Images}). | ||
| 5334 | @end defun | 5338 | @end defun |
| 5335 | 5339 | ||
| 5336 | @node XBM Images | 5340 | @node XBM Images |
| @@ -5474,9 +5478,6 @@ The value, @var{type}, should be a symbol specifying the type of the | |||
| 5474 | image data, as found in @code{image-format-suffixes}. This is used | 5478 | image data, as found in @code{image-format-suffixes}. This is used |
| 5475 | when the image does not have an associated file name, to provide a | 5479 | when the image does not have an associated file name, to provide a |
| 5476 | hint to ImageMagick to help it detect the image type. | 5480 | hint to ImageMagick to help it detect the image type. |
| 5477 | |||
| 5478 | @item :rotation @var{angle} | ||
| 5479 | Specifies a rotation angle in degrees. | ||
| 5480 | @end table | 5481 | @end table |
| 5481 | 5482 | ||
| 5482 | @node SVG Images | 5483 | @node SVG Images |