Visuals

Visuals are Prolog terms of one of the following forms:

     gray(Writable, Depth, Size)
     
     direct_color(Writable, Depth, Size,Bits_per_RGB, Rmask, Gmask, Bmask)
     
     pseudo_color(Writable, Depth, Size, Bits_per_RGB)
     

Visual terms describe the color capability of a screen or window. A gray/3 visual means that pixel values in a window specify an entry in a colormap, but only one of the primary colors is actually used to drive the grayscale (or monochrome) display 1. direct_color/7 means that the window or screen support color hardware where separate bits in a pixel value specify entries in separate colormaps for each of the three primary colors. pseudo_color/4 means that each pixel value specifies an entry in a colormap, which specifies all three primary colors. Writable is either true or false, indicating whether or not is is possible to allocate and change cells in a colormap. Depth specifies the number of bitplanes that are supported on this screen or window. Size is the number of user-accessible colormap entries; this will always be less than or equal to 2 to the power of Depth. Bits_per_RGB is the number of bits used to specify each primary in a color specification. In some sense, this is the precision of color specifications. And finally, Rmask, Gmask, and Bmask are bit masks (i.e. integers) that specify which bits of a direct_color visual pixel specify the red, green, and blue primary, respectively.


Footnotes

  1. X does not specify which color drives the display, so R, G and B should all be the same for grayscale visuals.