Around 17 o'clock on Nov 18, Tor Andersson wrote:

> Second, I need a Visual in XCreateImage. Apparently, after testing,
> this has to be the same as the Visual of the Window.

No, you don't need a visual to create an image, just use NULL.  As there 
aren't generally any depth 32 ARGB visuals available, you'd have a hard 
time finding one to match your image.

> Third, bits per pixel is not advertised by the visual but can be inferred
> by creating an image with XCreateImage and checking the bits_per_pixel field.
> In the source to XCreateImage, _XGetBitsPerPixel is called and returns 32 for
> both 24 and 32 bit deep visuals

Visuals don't deal with wire pixel formats, so they don't have a 
bits-per-pixel.  BitsPerPixel comes from the pixmap format values which
you can get from XListPixmapFormats.  Or, given that you're using depth 32 
images, you can just assume 32 bits per pixel.  As bpp must always be no 
less than depth and no greater than 32, this will always work.

> Are the red/green/blue_masks specified in the word order of the X server,
> and as such be swapped if client and server have different byte orders?

You don't need to deal with the mask values stored in the XImage structure;
they're strictly informative for applications using GetImage.  The relevant
mask information for Render images comes from the associated PictFormat
structure.  And, data seen by your application is always in the 
applications byte order.

> Finally, what the hell is a DirectColor visual?

The LUTs in most hardware can be programmed to change the mapping from 
R, G and B values in the pixels to R, G, and B values sent to the DAC.
DirectColor exposes this mapping as a writable colormap.

Render ignores this mapping and just exposes the pixel values as if they 
were mapped directly to the DAC inputs, so it's not very productive to use 
a DirectColor visual with Render applications, unless you load the LUT 
with some kind of non-decreasing sequence.

Keith Packard        XFree86 Core Team        HP Cambridge Research Lab


_______________________________________________
Xpert mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xpert

Reply via email to