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 22:47:38 +0300 Message-ID: <83zhmlxo6d.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> <834l4u11dr.fsf@gnu.org> <20190613165804.GB11266@breton.holly.idiocy.org> <83d0jhz9za.fsf@gnu.org> <20190613192724.GA11945@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="88398"; 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 Thu Jun 13 21:51:51 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 1hbVlG-000MqP-PK for ged-emacs-devel@m.gmane.org; Thu, 13 Jun 2019 21:51:50 +0200 Original-Received: from localhost ([::1]:45240 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hbVlF-0005ek-NX for ged-emacs-devel@m.gmane.org; Thu, 13 Jun 2019 15:51:49 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53176) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hbVhr-0005d0-Rz for emacs-devel@gnu.org; Thu, 13 Jun 2019 15:48:21 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:39459) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hbVhH-0000xY-IR; Thu, 13 Jun 2019 15:47:46 -0400 Original-Received: from [176.228.60.248] (port=4515 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hbVhG-0006tz-Ry; Thu, 13 Jun 2019 15:47:43 -0400 In-reply-to: <20190613192724.GA11945@breton.holly.idiocy.org> (message from Alan Third on Thu, 13 Jun 2019 20:27:24 +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:237551 Archived-At: > Date: Thu, 13 Jun 2019 20:27:24 +0100 > From: Alan Third > Cc: emacs-devel@gnu.org > > 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. Thanks. > 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.