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
HP-UX Starbase Device Drivers Manual - Vol1: HP 9000 Series 700 Computers > Chapter 3 The HCRX Family of Device Drivers

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 3-3 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 and pixel value 255 is 111 red, 111 green, and 11 blue which results in white. These and other examples are shown in .

Table 3-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 at 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 12 window

    or

    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 12 -visual TrueColor window
    xwcreate -g 600x500+300+200 -depth 12 -visual DirectColor window

    or

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

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

  • If you try to modify the TrueColor color map, you will not get the results you expected as it 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 effected by this color map description are those that attempt to perform gamma correction.

  • If your application searches for a visual by traversing the visual list that is returned from the X server, you will find that the order of visuals in this list has changed because of the addition of the new TrueColor visuals. 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
© 1989 - 1995 Hewlett-Packard Development Company, L.P.