From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Testing native image scaling Date: Sun, 20 Jan 2019 21:41:02 +0200 Message-ID: <83y37f9kxd.fsf@gnu.org> References: <83fttpat8p.fsf@gnu.org> <20190119214543.GA13967@breton.holly.idiocy.org> <834la3b9hd.fsf@gnu.org> <20190120192631.GA40845@breton.holly.idiocy.org> NNTP-Posting-Host: ciao.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ciao.gmane.org 1548013316 241052 195.159.176.228 (20 Jan 2019 19:41:56 GMT) X-Complaints-To: usenet@ciao.gmane.org NNTP-Posting-Date: Sun, 20 Jan 2019 19:41:56 +0000 (UTC) Cc: emacs-devel@gnu.org To: Alan Third Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 20 20:41:54 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1glIye-0010cI-J1 for ged-emacs-devel@m.gmane.org; Sun, 20 Jan 2019 20:41:52 +0100 Original-Received: from localhost ([127.0.0.1]:43620 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1glIyn-0005DA-Ix for ged-emacs-devel@m.gmane.org; Sun, 20 Jan 2019 14:42:01 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:53938) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1glIy8-0005Cs-U9 for emacs-devel@gnu.org; Sun, 20 Jan 2019 14:41:21 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:52588) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1glIy8-0000xR-Iw; Sun, 20 Jan 2019 14:41:20 -0500 Original-Received: from [176.228.60.248] (port=4805 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1glIy7-0005bR-Gs; Sun, 20 Jan 2019 14:41:20 -0500 In-reply-to: <20190120192631.GA40845@breton.holly.idiocy.org> (message from Alan Third on Sun, 20 Jan 2019 19:26:31 +0000) 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.21 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:232551 Archived-At: > Date: Sun, 20 Jan 2019 19:26:31 +0000 > From: Alan Third > Cc: emacs-devel@gnu.org > > > Where's the NS support for that? AFAICT, :rotate is only handled in > > ImageMagick specific portions of the code, what did I miss? > > It’s buried in nsimage.m, ns_load_image gets both :rotation and > :index, then processes the image as appropriate. Thanks, I will take a look. > If we were to add XRender rotation support, I’d be tempted to do both > rotation and scaling using affine transformation matrices in both > XRender and NS, as they would then both use the same code to calculate > the transforms. I believe Windows supports transformation matrices > through D2D, but I assume Emacs doesn’t use D2D currently, so it may > not be straight forward to add. Windows can calculate and use transformation matrices without D2D as well, it's really quite simple. You calculate the matrix elements, and then call a function to install it for the next BitBlt. > If we were to go that far, it may be worth actually exposing the > matrices to lisp and handle the calculations there What advantages would that give us? Wouldn't it be better to support higher-level abstractions for the transformations, like scaling, rotation, and shear?