At 00:15 22.09.00 +0100, Mike Bennett wrote:
>Does anyone know where I can find information on the various
>image formats which are internal to X, i.e. XYBitmap, XYPixmap
>and ZPixmap?
>>Pointers to C/C++ code would be good.
Actually this is one of those things that has bothered me for
years. Noone ever states what the hell these are, but heres
the deal
Bitmaps are 1 bit Images. So an XYBitmap just has pixels set to
0 or 1, the background and foreground of the current GC are used
to fill in the 0 and 1 when the Bitmap is used.
Pixmaps are multicoloured. ZPixmap is a true pixmap, that's
almost always what you want to use. They have standard rgb color
information. Now XYPixmaps are something that I never use, and
I don't think anyone else uses either, they appear to be an
insane Pixmap where the data is divided into three parts,
first all the red pixel values, then all the green pixels,
and then all the blue pixels. I'm sure with some thought I could
make up a reasonable sounding excuse for this, though it
escapes me right now.
This Bitmap vs Pixmap naming scheme is pretty standardized, Xbm's
are "X Bitmaps" and are correspondingly single bit, Xpm's are
"X Pixmaps" and are thus rgb.
A good resource for looking at these is the xmag program, the
source code to this uses the ZPixmaps in a standard way, and
does some fiddling with XYBitmaps, which to be honest I don't
play with.
This xlib intro has a little bit of info on XGetImage and friends
which is of use. http://www.multimania.com/babyloon/xlib.html
C.
p.s. If you ever figure out why you would want to use XGetSubImage
let me know :-)
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!