From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Image transformations Date: Thu, 13 Jun 2019 20:05:32 +0300 Message-ID: <83ef3xza8z.fsf@gnu.org> References: <9A21DE14-BB5F-426E-BBB2-19C87930E733@gnu.org> <20190611200233.GA80199@breton.holly.idiocy.org> <83imta95z0.fsf@gnu.org> <20190612220746.GA89208@breton.holly.idiocy.org> <835zpa11qp.fsf@gnu.org> <20190613161215.GA11266@breton.holly.idiocy.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="94596"; mail-complaints-to="usenet@blaine.gmane.org" Cc: alptekin.aker@gmail.com, emacs-devel@gnu.org To: Alan Third Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jun 13 20:59:45 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hbUwq-000ORr-DJ for ged-emacs-devel@m.gmane.org; Thu, 13 Jun 2019 20:59:44 +0200 Original-Received: from localhost ([::1]:44006 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hbUwp-0003TY-DE for ged-emacs-devel@m.gmane.org; Thu, 13 Jun 2019 14:59:43 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36685) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hbTT8-00038V-OI for emacs-devel@gnu.org; Thu, 13 Jun 2019 13:25:01 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:36090) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hbTAZ-00050Y-37; Thu, 13 Jun 2019 13:05:47 -0400 Original-Received: from [176.228.60.248] (port=2408 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hbTAJ-00014b-Qf; Thu, 13 Jun 2019 13:05:32 -0400 In-reply-to: <20190613161215.GA11266@breton.holly.idiocy.org> (message from Alan Third on Thu, 13 Jun 2019 17:12:15 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:237543 Archived-At: > Date: Thu, 13 Jun 2019 17:12:15 +0100 > From: Alan Third > Cc: Alp Aker , emacs-devel@gnu.org > > 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.