12.07.2015 Views

Xlib − C Language X Interface

Xlib − C Language X Interface

Xlib − C Language X Interface

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Xlib</strong> − C LibraryX11, Release 6.7 DRAFTgrayscale screen. This leads to the following diagram:Color Gray-scaleR/O R/W R/O R/WUndecomposed Static Pseudo Static GrayColormap Color Color Gray ScaleDecomposed True DirectColormap Color ColorConceptually, aseach pixel is read out of video memory for display on the screen, it goes throughalook-up stage by indexing into a colormap. Colormaps can be manipulated arbitrarily on somehardware, in limited ways on other hardware, and not at all on other hardware. The visual typesaffect the colormap and the RGB values in the following ways:• For PseudoColor, apixel value indexes acolormap to produce independent RGB values,and the RGB values can be changed dynamically.• GrayScale is treated the same way as PseudoColor except that the primary that drives thescreen is undefined. Thus, the client should always store the same value for red, green, andblue in the colormaps.• For DirectColor, apixel value is decomposed into separate RGB subfields, and each subfieldseparately indexes the colormap for the corresponding value. The RGB values can bechanged dynamically.• TrueColor is treated the same way as DirectColor except that the colormap has predefined,read-only RGB values. These RGB values are server dependent but provide linear ornear-linear ramps in each primary.• StaticColor is treated the same way as PseudoColor except that the colormap has predefined,read-only, server-dependent RGB values.• StaticGray is treated the same way as StaticColor except that the RGB values are equalfor any single pixel value, thus resulting in shades of gray. StaticGray with a two-entrycolormap can be thought of as monochrome.The red_mask, green_mask, and blue_mask members are only defined for DirectColor andTrueColor. Each has one contiguous set of bits with no intersections. The bits_per_rgb memberspecifies the log base 2 of the number of distinct color values (individually) of red, green, andblue. Actual RGB values are unsigned 16-bit numbers. The colormap_size member defines thenumber of available colormap entries in a newly created colormap. For DirectColor and True-Color, this is the size of an individual pixel subfield.To obtain the visual ID from a Visual, use XVisualIDFromVisual.VisualID XVisualIDFromVisual (visual)Visual *visual;visualSpecifies the visual type.The XVisualIDFromVisual function returns the visual ID for the specified visual type.32

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!