all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Andreas Politz <politza@fh-trier.de>
Cc: emacs-devel@gnu.org
Subject: Re: new image-type: composite, or not
Date: Wed, 30 Jan 2013 19:21:35 -0500	[thread overview]
Message-ID: <jwvwquu6wjp.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87pq0m4h6e.fsf@fh-trier.de> (Andreas Politz's message of "Wed, 30 Jan 2013 20:14:17 +0100")

> http://public.fh-trier.de/~politza/emacs/pdf-isearch.png
> Because of anti-aliasing, the background is not merely a single color,
> such that my (single-color) mask is not perfect.  `convert' seems to do
> some fuzzy comparing of colors by default.

Ah, so your composite has the PDF on top and the highlighting below?
That means you need to know the background color of the PDF document.
I though you'd be put the highlighting above, but then it tends to
obscure the text it highlights, unless you use something like
α-blending.

>>> Alas, all this made me realize, that maybe a simpler approach would
>>> suffice.  Something like a single function
>>> (mark-image foreground background &rest edges-list)
>> I'm not sure exactly how that would work, can you give some details?
> This kind of function was what I was looking for.  I have a list of
> rectangles ((x0 y0 x1 y1)...) and want to ,,fontify'' the image at these
> places.  

Right, but I'm not sure what foreground and background mean (if you
assume the document is back-on-white, I can guess what you might want
to say, but if the document is a colorful image it's much less clear).

Also, it would require an `image' argument, other it wouldn't know which
image to mark.  And it would need to store the mark-data somehow
somewhere (probably within the `image' descriptor), so that redisplay
knows to put the mark next time it refreshes the display.

> I don't know.  I just thought, that maybe this kind of low-level
> tinkering with images, masks and slices is not really needed and maybe
> it does not really fit nicely in the current image-framework.  If that
> is true, then some more high-level function could simplify an
> implementation or make it cleaner.

That would be nice indeed, but I'm not sure if mark-image would let us
avoid such low-level tinkering.

>> Not sure what other candidates there can be, neither for mark-image nor
>> for a composite image.
> Well, customizing tree-widgets images...

You're thinking of using composite images in the tree-widget icons?


        Stefan



  reply	other threads:[~2013-01-31  0:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-26 17:30 new image-type: composite, or not Andreas Politz
2013-01-30 17:28 ` Stefan Monnier
2013-01-30 19:14   ` Andreas Politz
2013-01-31  0:21     ` Stefan Monnier [this message]
2013-01-31  7:06       ` Andreas Politz
2013-02-01 22:28       ` Andreas Politz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvwquu6wjp.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=politza@fh-trier.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.