emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Native image rotation


From: Alan Third
Subject: Re: Native image rotation
Date: Sat, 2 Mar 2019 13:29:11 +0000
User-agent: Mutt/1.11.2 (2019-01-07)

On Mon, Feb 25, 2019 at 07:21:02PM +0000, Alan Third wrote:
> On Mon, Feb 25, 2019 at 05:36:46AM +0200, Eli Zaretskii wrote:
> > 
> > It's indeed the clearing that bothered me,
> 
> Would it be better if it was done by another XRender composite rather
> than x_clear_area?

I tried to replace this with XRenderFillRectangle, but realised I need
to construct an XRenderColor struct, and I’ve no idea how to get the
colour data held in img->background.

I’ve attached a patch containing the original two, and the ability to
crop.

I decided to use a different order of processing from the ImageMagick
code we have just now, as this new ordering seems more useful for the
use cases that were suggested here.

Imagemagick does resize ‐> crop ‐> rotate.

I’ve gone with rotate ‐> crop ‐> resize.

If that’s no good it’s simple enough to reorder the functions. The
main issue I can foresee is that some people may prefer resize to come
first, but I feel that reduces the usefulness of :max-width and
:max-height.

I’ve not yet documented crop, and it’s not already documented for
Imagemagick. But in short:

    :crop '(width height left top)
    
Where left and top can be negative to operate from the right and
bottom of the image. Crop cannot be used to enlarge the image. As
mentioned before, the crop occurs before the resize, so sizes are in
terms of the original image, not the final one.

-- 
Alan Third

Attachment: 0001-Add-native-image-rotation-and-cropping.patch
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]