emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: image scaling


From: Chong Yidong
Subject: Re: image scaling
Date: Thu, 21 Feb 2008 23:57:20 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.91 (gnu/linux)

David Kastrup <address@hidden> writes:

>> 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.

My main concern with outsourcing particular bits of the Emacs image
functionality to external libraries (which may or may not be linked
in) is how this will look at the Lisp level.  This problem is already
present to a small degree; for example, the `image-type-available-p'
function checks if a particular image format can be displayed.  But it
would be a mess if we force users (Lisp coders) to perform a similar
test before performing things like image rescaling---or, worse still,
having such functionality quietly disappear, by functions not being
defined or becoming no-ops.

Of course, we could take the approach of writing our own "fallback"
code for when the libraries aren't available, but that negates the
point of using the libraries in the first place.

As for refactoring the Emacs image code, I'm not sure if there's any
urgency for such a project.  The code isn't elegant, but it's simple
enough to understand and work on; and I don't know of any performance
problem in the way Emacs handles image pixmaps.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]