Page 1 of 1

Getting at the raw bits to make an X11 Pixmap

Posted: 2010-03-04T16:23:20-07:00
by per-spective
I want to display tiled images in an X11 application. So far I can load and scale images but am having trouble figuring out how I get at the raw bits to make X11 Pixmaps or the like which I can then copy in to X.

It looks like maybe I could get at the raw bits with

Image scaled(filename);
scaled.zoom("100x80");
scaled.magick(FORMAT);
Blob blob;
scaled.write(&blob);
ptr = blob.data();

but what do I use for FORMAT? And if I am operating on a shallow display are there varying formats that will do color flattening for me, so I can minimize data copying?

Alternatively, maybe the Pixel interface is what I want, but I don't see how to reach "inside" a pixel.

Pointers? Thanks.