|
Visuals differ along several dimensions. They can be
grayscale or RGB, colormaps can be modifiable or fixed,
and the pixel value can either index a single colormap
or contain packed red, green, and blue indexes. Here
are the possible values for
GdkVisualType:
-
GDK_VISUAL_STATIC_GRAY means the display is
either monochrome or gray scale, and the colormap
cannot be modified. A pixel value is simply a level
of gray; each pixel is "hard coded" to represent a
certain on-screen color.
-
GDK_VISUAL_GRAYSCALE means the display has a
modifiable colormap, but only levels of gray are
possible. The pixel represents an entry in the
colormap, so a given pixel can represent a
different level of gray at different times.
-
GDK_VISUAL_STATIC_COLOR represents a color
display which uses a single read-only colormap
rather than a separate colormap for each of red,
green, and blue. The display is almost certainly
12-bit or less (a 24-bit display using a single
colormap would need a colormap with 2^24 entries,
occupying close to half a gigabyte---not very
practical!). This is an annoying visual, because
relatively few colors are available and you can't
change which colors they are.
-
GDK_VISUAL_PSEUDO_COLOR is the most common
visual on low-end PC hardware from several years
ago. If you have a one-megabyte 256-color video
card, this is most likely your X server's visual.
It represents a color display with a read/write
colormap. Pixels index a single colormap.
-
GDK_VISUAL_TRUE_COLOR is a color display
with three read-only colormaps, one for each of
red, green, and blue. A pixel contains three
indexes, one per colormap. There is a fixed
mathematical relationship between pixels and RGB
triplets; you can get a pixel from red, green, and
blue values in [0, 255] using the formula: gulong pixel =
(gulong)(red*65536 + green*256 + blue).
-
GDK_VISUAL_DIRECT_COLOR is a color display
with three read-write colormaps. If you use the GDK
color handling routines, they simply fill up all
three colormaps to emulate a true color display,
then pretend the direct color display is true
color.
|
|