emacs-devel
[Top][All Lists]

## Re: Image transformations

 From: Eli Zaretskii Subject: Re: Image transformations Date: Sat, 15 Jun 2019 14:31:41 +0300

```> Date: Sat, 15 Jun 2019 11:42:42 +0100
>
> > The matrix is defined according to XRender, AFAIU.  NS and Cairo need
> > to transpose/invert/etc. the matrix to use it, and so will the
> > MS-Windows code, IIUC.  The matrix fuses the actual primitive
> > transformations into a construct which we currently don't seem to
> > understand well, whose only "documentation" is in a tutorial that is
> > not part of XRender's official docs.
>
> I was first taught affine transformation matrices in a Mathematics for
> Engineers course at university.

We are mis-communicating.  I know what affine transformations are, and
I have no problems with matrix multiplication and vector algebra in
general.  I majored in physics, so even tensors of General Relativity
aren't a problem for me.

The issue I'm worried about is the geometrical meaning of each element
of the matrix, as applied to image transformations in Emacs: whether
it needs to be transposed before multiplying vectors by it, whether
vectors should be left-multiplied or right-multiplied, whether the Y
axis is assumed to go up or down, whether the [1][2] member is the
sine of the rotation angle or its negative, etc.

Which is a clear sign that these aspects are not as trivial as it
might sound.  IMO, we need clear documentation of that, to allow
people make changes in the code without making mistakes.  But maybe
I'm the only one to be bothered by that.

> Inversion of a matrix is a bit more complex but still well within the
> capabilities of a high school student:

So it is well within your and my capabilities, and those of all the

> BTW, are you really keen to get rid of the matrix multiplications?
> Anything we replace them with for XRender will simply be matrix
> multiplications written out in long form, keeping track of each
> element separately.

This is again a misunderstanding: I was merely suggesting to make all
of those multiplications in image_set_transform, that's all.