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: Sat, 15 Jun 2019 14:31:41 +0300 Message-ID: <838su3w0de.fsf@gnu.org> References: <20190611200233.GA80199@breton.holly.idiocy.org> <83imta95z0.fsf@gnu.org> <20190612220746.GA89208@breton.holly.idiocy.org> <834l4u11dr.fsf@gnu.org> <20190613165804.GB11266@breton.holly.idiocy.org> <83d0jhz9za.fsf@gnu.org> <20190613192724.GA11945@breton.holly.idiocy.org> <83zhmlxo6d.fsf@gnu.org> <20190613222626.GA12971@breton.holly.idiocy.org> <83o930y7cl.fsf@gnu.org> <20190615104242.GA13368@breton.holly.idiocy.org> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="55244"; mail-complaints-to="usenet@blaine.gmane.org" Cc: emacs-devel@gnu.org To: Alan Third Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jun 15 13:31:48 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 1hc6uR-000EAw-2m for ged-emacs-devel@m.gmane.org; Sat, 15 Jun 2019 13:31:47 +0200 Original-Received: from localhost ([::1]:59910 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hc6uP-0007rA-DJ for ged-emacs-devel@m.gmane.org; Sat, 15 Jun 2019 07:31:45 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51959) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hc6uJ-0007r4-G3 for emacs-devel@gnu.org; Sat, 15 Jun 2019 07:31:40 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:35114) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hc6uG-0005uJ-Tn; Sat, 15 Jun 2019 07:31:37 -0400 Original-Received: from [176.228.60.248] (port=3392 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hc6uG-0000F1-6y; Sat, 15 Jun 2019 07:31:36 -0400 In-reply-to: <20190615104242.GA13368@breton.holly.idiocy.org> (message from Alan Third on Sat, 15 Jun 2019 11:42:42 +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:237667 Archived-At: > Date: Sat, 15 Jun 2019 11:42:42 +0100 > From: Alan Third > Cc: emacs-devel@gnu.org > > > 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. Even Richard and Alp were confused for a moment about this stuff. 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 rest here. Please let's not worry about this level, it's not the problem I'm talking about. > 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. Maybe I should stop talking about this and just go ahead and write the best code I can. Because instead of improving things, this discussion seems to just proliferate misunderstandings and bad feelings. Most probably, my fault, sorry. So please push your documentation changes, and let's move on.