emacs-devel
[Top][All Lists]
Advanced

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

Re: Image transformations


From: YAMAMOTO Mitsuharu
Subject: Re: Image transformations
Date: Wed, 26 Jun 2019 09:28:17 +0900
User-agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (Gojō) APEL/10.8 EasyPG/1.0.0 Emacs/25.3 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)

On Wed, 26 Jun 2019 00:35:54 +0900,
Eli Zaretskii wrote:
> 
> > It's really just out of curiosity, not directly related to what our code
> > should do: does the "inverse matrix" indicate that the Windows guys use
> > "fundamentally" different algorithms than the Cairo guys, or just that
> > inverting the matrix is considered "par for the course" because
> > sometimes you need one and sometimes you need the other.
> 
> I'm not the right person to answer these questions, as I don't have
> enough background and experience in this area.  I think the differences
> reflect the different designs and mindsets of the relevant
> environments, but that's just a guess.  Perhaps Yamamoto-san could
> comment on the nature of these differences.

I'm not the right person, either.  So the following is just a guess.
First, I couldn't find any Windows GDI API that deals with affine
transformation matrices directly.  PlgBlt that Eli mentioned takes
(integer-valued) coordinates of three corners of the destination.

  https://docs.microsoft.com/en-us/windows/desktop/api/wingdi/nf-wingdi-plgblt

Probably Eli uses "inverse matrix" (inverse with respect to what
Xrender uses) to calculate these coordinates from the source image
width and height.  If so, "inverse matrix" is considered not inherent
to Window GDI, but usually used indirectly at the user side.

Guessing from its API design, I think GDI does not internally perform
any (real-valued) matrix calculations, but uses some variant of
Bresenham's line algorithm for image transformations to prefer integer
arithmetics.

                                     YAMAMOTO Mitsuharu
                                address@hidden



reply via email to

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