XImage Transparency

Daniel Stone daniel at fooishbar.org
Fri Jul 27 02:19:57 PDT 2007


On Fri, Jul 27, 2007 at 12:21:18AM +0200, Juliusz Chroboczek wrote:
> >> How can you make part of an XImage transparent (true transparency - as
> >> in I can see something under the transparent parts) ? 
> 
> > You can't.
> 
> > If you want to plot a "masked" image, you need a separate mask bitmap,
> > where 1 represents opaque and 0 represents transparent.
> >
> > First, the mask needs to exist as a 1-bit Pixmap. You can then set
> > this as the clip mask using XSetClipMask() and XSetClipOrigin(). When
> > you draw the image (XPutImage), it will be masked against the clip
> > mask.
> 
> And watch your X server collapse.
> 
> If you use XSetClipMask, the bitmap will be converted to a set of
> spans, which will kill performance.
> 
> Instead, you should be using the Render extension together with RGBA
> images.

Unfortunately, we don't have a1r8g8b8/a1b8g8r8 acceleration, because
apparently a bunch of hardware has trouble accelerating it, even though
it's orders of magnitude faster in software.

Cheers,
Daniel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.x.org/archives/xorg/attachments/20070727/1b95a197/attachment.pgp>


More information about the xorg mailing list