From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: image scaling Date: Thu, 21 Feb 2008 22:49:23 +0100 Message-ID: <8563wiaskc.fsf@lola.goethe.zz> References: <87odaam9oy.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1203630601 23033 80.91.229.12 (21 Feb 2008 21:50:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 21 Feb 2008 21:50:01 +0000 (UTC) Cc: Stefan Monnier , emacs-devel@gnu.org To: Chong Yidong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Feb 21 22:50:25 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JSJIu-0002zr-9x for ged-emacs-devel@m.gmane.org; Thu, 21 Feb 2008 22:50:08 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JSJIP-0000HM-82 for ged-emacs-devel@m.gmane.org; Thu, 21 Feb 2008 16:49:37 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JSJIK-0000Cv-EA for emacs-devel@gnu.org; Thu, 21 Feb 2008 16:49:32 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JSJIF-0008UN-Kq for emacs-devel@gnu.org; Thu, 21 Feb 2008 16:49:32 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JSJIF-0008UD-HK for emacs-devel@gnu.org; Thu, 21 Feb 2008 16:49:27 -0500 Original-Received: from mail-in-05.arcor-online.net ([151.189.21.45]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JSJIE-0007KA-M6 for emacs-devel@gnu.org; Thu, 21 Feb 2008 16:49:27 -0500 Original-Received: from mail-in-04-z2.arcor-online.net (mail-in-04-z2.arcor-online.net [151.189.8.16]) by mail-in-05.arcor-online.net (Postfix) with ESMTP id F32071834FD; Thu, 21 Feb 2008 22:49:24 +0100 (CET) Original-Received: from mail-in-08.arcor-online.net (mail-in-08.arcor-online.net [151.189.21.48]) by mail-in-04-z2.arcor-online.net (Postfix) with ESMTP id E515AABB93; Thu, 21 Feb 2008 22:49:24 +0100 (CET) Original-Received: from lola.goethe.zz (dslb-084-061-055-017.pools.arcor-ip.net [84.61.55.17]) by mail-in-08.arcor-online.net (Postfix) with ESMTP id BB5542BBA42; Thu, 21 Feb 2008 22:49:24 +0100 (CET) Original-Received: by lola.goethe.zz (Postfix, from userid 1002) id F0CC11CDB1E6; Thu, 21 Feb 2008 22:49:23 +0100 (CET) In-Reply-To: <87odaam9oy.fsf@stupidchicken.com> (Chong Yidong's message of "Thu, 21 Feb 2008 13:43:57 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-Virus-Scanned: ClamAV 0.92.1/5919/Thu Feb 21 20:44:23 2008 on mail-in-08.arcor-online.net X-Virus-Status: Clean X-detected-kernel: by monty-python.gnu.org: Linux 2.4-2.6 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:89864 Archived-At: Chong Yidong writes: > Stefan Monnier writes: > >> Looking at the Elisp manual's "38.16.2 Image Descriptors", it seems that >> we do not support image scaling. >> >> I'd like to add such a feature to image-mode.el, but am wondering how we >> should go about doing it. Would there be some advantage to provide it >> at the C level (e.g. if some of the image libs we use already provide >> the necessary functionality) or should we just bite the bullet and call >> some external tool like "convert -scale ..." (with the disadvantage that >> flushing the image cache will not automatically cause the image to be >> re-scaled). > > I think the cleanest (but not necessarily easiest) approach is to add > a C level function to rescale an image. This C function would act on > the internal pixmap structures and implement its own image scaling > algorithm. The trouble with using external library functions is that > not all of them support rescaling. Since lot more people concerned about graphics work on those library functions than on Emacs' graphics, we should be factoring Emacs' image code in a manner that will allow us to make use of that functionality if it is given (and possibly be able to use gdk if it is available). Really: how pixels are passed one by one through Emacs before reaching the display is a mess. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum