[Top][All Lists]

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

Re: Image transformations

From: YAMAMOTO Mitsuharu
Subject: Re: Image transformations
Date: Thu, 27 Jun 2019 12:37:15 +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 Thu, 27 Jun 2019 00:34:00 +0900,
Eli Zaretskii wrote:
> > Date: Wed, 26 Jun 2019 09:28:17 +0900
> > From: YAMAMOTO Mitsuharu <address@hidden>
> > Cc: Stefan Monnier <address@hidden>,
> >     address@hidden
> > 
> > First, I couldn't find any Windows GDI API that deals with affine
> > transformation matrices directly.
> The GDI API which uses the matrices directly is SetWorldTransform, see
> https://docs.microsoft.com/en-us/windows/desktop/api/wingdi/nf-wingdi-setworldtransform
> I eventually decided not to use it, because when I tried, it displayed
> a slightly stretched image even with a trivial matrix, i.e. no
> transform at all.  Also, the more general description of the topic,
> which you can find here:
> https://docs.microsoft.com/en-us/windows/desktop/gdi/about-coordinate-spaces-and-transformations
> and the examples here:
> https://docs.microsoft.com/en-us/windows/desktop/gdi/using-coordinate-spaces-and-transformations
> did not tell enough detail nor show enough examples for me to be sure
> I really understand the subject.  So I'm using PlgBlt instead.  But I
> still want to keep compatibility with the transform matrices as
> defined in the documentation of SetWorldTransform, and I'm using the
> equations shown there to produce the coordinates that PlgBlt needs.
> This will allow to use SetWorldTransform in the future if we want to
> (assuming someone will understand why it didn't work for me to be gin
> with).
> > 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.
> I think the fact that SetWorldTransform exists contradicts this
> conclusion.  The matrix is defined as an array of floats.

It seems that SetWorldTransform is only effective on vector drawings,
but not on bitmap image drawings.  So my reasoning above should be
restricted to bitmap images, but still just a guess, of course.

                                     YAMAMOTO Mitsuharu

reply via email to

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