Hello Havoc, thank you for your fast answer :-) On Sun, Mar 30, 2003 at 04:11:16PM -0500, Havoc Pennington wrote: > It depends on the return of gdk_pixbuf_get_colorspace() and > gdk_pixbuf_get_n_channels(), though at the moment the only possible > values are RGB and RGBA. Ok, I will add something like an assert to my code, just to make sure. > > (1) What is a portable way to access the alpha values of a pixbuf? > > Does something like > > > > pixels = gdk_pixbuf_get_pixels(pixbuf); > > alpha = pixels [ 4*(y*width + x) + 3 ]; > > > > always work, or does this depend on the byte order? > > It doesn't depend on byte order, This is nice to hear. > but you need rowstride instead > of width, and you need to be sure the pixbuf has an alpha channel. Yes I knew this, but I wanted to keep my example simple. > 0x000000FF is always opaque black. It's defined as > R << 24 | G << 16 | B << 8 | A I believe. This is nice, too. Maybe something like this could be added to the gdk_pixbuf API reference? Should I file a wishlist bug? Thank you again, Jochen -- Omm (0)-(0) http://www.mathematik.uni-kl.de/~wwwstoch/voss/index.html
Attachment:
pgpczQqbbCKFb.pgp
Description: PGP signature