Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
Starbase Technical Addendum for the July, 1997 Workstation ACE for 10.20 HP-UX: HP 9000 Workstations and Servers > Chapter 2 The HCRX Family of Devices

Device Support for the TrueColor Visual

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Index

TrueColor Visual Description

A TrueColor visual can be thought of as having a read-only color map where, for any given pixel value, about one third of the bits are used to describe each of the red, green, and blue colors, respectively. For an 8-plane TrueColor visual, 3 bits describe the red component, 3 bits describe the green component, and 2 bits describe the blue component. A 12-plane TrueColor visual uses 4 bits each to describe the red, green, and blue components. A 24-plane TrueColor visual uses 8 bits each to describe the red, green, and blue components. This is illustrated as follows:

Figure 2-4 Pixel Representation for the 8-, 12-, and 24-Plane TrueColor Visuals

Pixel Representation for the 8-, 12-, and 24-Plane TrueColor Visuals

The following example refers to an 8-plane TrueColor visual; however, the example can be expanded to apply to 12-plane or 24-plane TrueColor visuals.

Example

Since the red and green components consist of 3 bits each, there are 8 different shades of red and 8 different shades of green available. Also, there are 4 different shades of blue represented by 2 bits. As the component increases, the intensity of that color increases. For example, a red component of 000 represents no red, and a red component of 111 represents full red. Therefore, pixel value 0 is 000 red, 000 green, and 00 blue, which results in black. Pixel value 255 is 111 red, 111 green, and 11 blue, which results in white. These and other examples are shown in Table 2-3 “Examples of Pixel Color Values ”.

Table 2-3 Examples of Pixel Color Values

Pixel Value

Binary

Red

Green

Blue

0

000 000 00

shade 0

shade 0

shade 0

53

001 101 01

shade 1

shade 5

shade 1

139

100 010 11

shade 4

shade 2

shade 3

218

110 110 10

shade 6

shade 6

shade 2

255

111 111 11

shade 7

shade 7

shade 3

 

Note that the red, green and blue intensities for the color shades ramp uniformly between 0 and 255.

Device Specific Visuals Information

Note that the TrueColor Visual always uses a shade_mode of CMAP_FULL. When the TrueColor visual window is gopened, your application will automatically be in CMAP_FULL mode and the shade_mode call will ignore any attempts to go into another mode.

With the addition of the TrueColor visual (beginning with the 9.03 release of HP-UX), you need to consider the following information:

  • If you originally created your windows using command lines similar to the following:

    xwcreate -g 600x500+300+200 -depth 8 window
    xwcreate -g 600x500+300+200 -depth 24 window

    you will have to change how you create your windows by using command lines similar to these:

    xwcreate -g 600x500+300+200 -depth 8 -visual TrueColor \ 		window
    xwcreate -g 600x500+300+200 -depth 24 -visual
    \ TrueColor window

    Note the addition of the command line option -visual for declaring TrueColor and DirectColor visuals.

  • The TrueColor color map is a read-only color map and cannot be modified. You should note that any attempt to modify the TrueColor color map will not cause an error.

    One class of applications that could be affected by this color map description are those that perform their own gamma correction. This is because the color map is read-only, thus preventing Starbase from adjusting the color ramp to perform gamma correction.

  • If your application searches for a visual by traversing the visual list that is returned by the X server, you will find that the order of visuals in this list may change from device to device and release to release. Therefore, your application code should always explicitly search for a particular visual rather than assuming that it occurs in a fixed position within the list of visuals returned by X11.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1996 Hewlett-Packard Development Company, L.P.