[Top][All Lists]

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

Re: Track mouse drags over an image

From: Roland Winkler
Subject: Re: Track mouse drags over an image
Date: Thu, 10 Jan 2019 22:55:55 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux)

On Tue, Jan 08 2019, Stefan Monnier wrote:
>> implemented in elisp to be usable.  Still I am wondering: would it
>> make sense to implement such code in a built-in function?
> Not sure what you mean by "such code" nor "built-in".  Providing an
> Elisp function to help coders like you would be very welcome, indeed.
> If you can try and extract the relevant code from djvu-mode, that
> would be great.

My question was indeed different: is there any possible use for such a
feature in other elisp packages that could justify such efforts?
Djvu-mode uses this for making annotations.  Could something like that
be useful for other packages, too (packages I do not know about)?

If the answer is yes, one can go from there.

> Implementing it in C would only be justified if the performance
> difference is relevant or if the semantics can be made cleaner.

The elisp implementation in djvu-mode has a terrible performance, as it
pushes the cpu load on my computer to 100% while doing its job.
Possibly, even elisp might permit a better solution than what djvu-mode
is currently doing.  But all this is not my area of expertise either.

> E.g. make it work for any image rather than only for PPM images of
> "depth" 255.  Images are pretty far from my area of expertise, tho, so
> someone else should look into this.

PPM (or PGM) images of "depth" 255 allow most easily to highlight the
dragged region as they represent each pixel by three (or one) byte that
can easily be addressed and inverted in elisp.  I do not know how to do
the same thing with, say, PBM images that otherwise could probably be
more efficient.

reply via email to

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