Next: , Previous: , Up: RENDER - A new rendering system for X11   [Contents][Index]


16.3.1 Picture formats

The following is what the X protocol rendering spec has to say about picture formats. http://www.xfree86.org/~keithp/render/protocol.html

The picture-format object holds information needed to translate pixel values into red, green, blue and alpha channels. The server has a list of picture formats corresponding to the various visuals on the screen. There are two classes of formats, Indexed and Direct. Indexed picture-formats hold a list of pixel values and RGBA values while Direct picture-formats hold bit masks for each of R, G, B and A.

The server must support a direct picture-format with 8 bits each of red, green, blue and alpha as well as a direct picture-format with 8 bits of red, green and blue and 0 bits of alpha. The server must also support direct picture-formats with 1, 4 and 8 bits of alpha and 0 bits of r, g and b.

Pixel component values lie in the closed range [0,1]. These values are encoded in a varying number of bits. Values are encoded in a straight forward manner. For a component encoded in m bits, a binary encoding b is equal to a component value of b/(2^m-1).

A direct picture-format with zero bits of alpha component is declared to have alpha == 1 everywhere. A direct picture-format with zero bits of red, green and blue is declared to have red, green, blue == 0 everywhere. If any of red, green or blue components are of zero size, all are of zero size. Direct picture-formats never have colormaps and are therefore screen independent.

Indexed picture-formats never have alpha channels and the direct component is all zeros. Indexed picture-formats always have a colormap in which the specified colors are allocated read- only and are therefore screen dependent.

These are valid accessors for picture-format objects.

picture-format-display

A display

picture-format-id

The X protocol resource-id

picture-format-type

(member :indexed :direct)

picture-format-depth

Bitdepth as card8

picture-format-red-byte

A bitmask

picture-format-green-byte
picture-format-blue-byte
picture-format-alpha-byte
picture-format-colormap

A colormap or nil


Next: , Previous: , Up: RENDER - A new rendering system for X11   [Contents][Index]