emacs-devel
[Top][All Lists]
Advanced

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

Re: png images in tool-bar / alpha mask


From: David Reitter
Subject: Re: png images in tool-bar / alpha mask
Date: Sun, 6 Apr 2008 14:42:08 +0100

On 6 Apr 2008, at 03:52, YAMAMOTO Mitsuharu wrote:

This is not the only place where NULL-check of img->mask is used for
determining the existence of the image mask.  At least, xdisp.c and
macterm.c also assume that.

Yes, but doesn't that happen in order to check whether there is a bitmap mask that will be used for something?

x_draw_image_foreground actually uses that mask to draw the image, and my understanding is that we want to use the original (platform specific) image data for that, including its alpha channel. As we can't do that (yet) on X or W32, we don't set the platform specific image data in the first place there. In macterm.c, we want to call mac_copy_area rather than mac_copy_area_with_mask, right?

In x_draw_image_foreground (macterm.c), it is always safe to draw a rectangle around given that we don't know what the alpha channel specifies, but one could go through Fimage_mask_pp to get the same semantics.

As for image.c: I don't understand all of the code. In general, it appears safe to assume we don't have a mask on the C level.

The alternative would be to acquire a bitmap mask from the PNG when loading it. Maybe that would be cleaner.

Attachment: smime.p7s
Description: S/MIME cryptographic signature


reply via email to

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