[Top][All Lists]

[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 22:47:38 +0300

> Date: Thu, 13 Jun 2019 20:27:24 +0100
> From: Alan Third <address@hidden>
> Cc: address@hidden
> I think this should be what you need:
>    x’ = tm[0][0] * x + tm[0][1] * y + tm[0][2] * 1
>    y’ = tm[1][0] * x + tm[1][1] * y + tm[1][2] * 1
> where tm is the completed transformation matrix.


> BTW, are you aware that you can use the XFORM struct:
> https://docs.microsoft.com/en-us/windows/desktop/api/wingdi/ns-wingdi-xform

Yes, I'm using it.

> > I also want to know when no rotation is involved, so that I could use
> > the existing code (which only supports scaling and will be modified to
> > support cropping) on older Windows versions that cannot support
> > rotations (PlgBlt is not available on those platforms).
> I’d be inclined to just skip image_set_rotation when on a platform
> that doesn’t support it.

That'd mean putting too much w32-specific code in image.c, something
I'd like to avoid if possible.

> Or storing the basic crop and scaling information separately so you
> don’t have to worry about the matrices at all.

I'm beginning to think we should do this on all platforms, and leave
the matrix calculation, if needed, to the terminal-specific back-ends
(xterm.c, w32term.c, etc.).  It sounds like we gain nothing by
spilling XRender-specific stuff in image.c and letting all the other
platforms adapt.

reply via email to

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