emacs-devel
[Top][All Lists]
Advanced

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

Re: Image transformations


From: Eli Zaretskii
Subject: Re: Image transformations
Date: Thu, 13 Jun 2019 20:05:32 +0300

> Date: Thu, 13 Jun 2019 17:12:15 +0100
> From: Alan Third <address@hidden>
> Cc: Alp Aker <address@hidden>, address@hidden
> 
> It works if you consider it as moving the origin from the top left
> corner, 232 pixels down the Y axis to the bottom left corner, then
> rotating. I don’t really know how to think about this that deeply,
> especially since this matrix is the result of two translations and a
> rotation multiplied together.

OK, but how to be sure this is the correct interpretation?  The code
which implements the rotations does a translation, followed by
rotation, followed by another translation, and multiplies all the 3
matrices to produce the result.  If we are not sure about what these
transformations mean, how do we know the result is correct?  How did
_you_ know to write that code? is there some XRender elated
documentation that describes the meaning of each matrix element?  For
example, do the translations describe how the pixels are moved or how
the origin of the coordinate system is moved?

> One thing that may also be confusing is that there are two different
> approaches to this. XRender applies the transforms to the image,
> whereas NS applies the tranforms to the surface the image is to be
> drawn to. I have a suspicion, having read some Windows API
> documentation (but not much) that Windows works the same way as NS.
> This is unfortunate as it’s harder to understand what’s going on.

If everybody and their dog work differently, why are we doing this
according to XRender, and not the other way around?

> The key difference is that for NS I have to invert the transformation
> matrix.

What do you mean by "invert", and where is that NS code?

And if you figured out how to map what XRender does to what NS does,
you probably understand well what the XRender matrix means, right?

> I could be wrong, but it may explain why things aren’t doing what
> you’re expecting. Or it could simply be down to the fact I transposed
> the rows and columns. I think it’s probably a good idea for us to deal
> with the transposition first before making any definite statements on
> this.

Not sure what you mean by "deal with transposition".

Thanks.



reply via email to

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