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 3 The HP VISUALIZE-48 and HP VISUALIZE-48XP 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 24-plane TrueColor visual uses 8 bits each to describe the red, green, and blue components. This is illustrated as follows:

Figure 3-4 Pixel Representation for the 8- and 24-Plane TrueColor Visuals

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

The following example refers to an depth 8 TrueColor visual; however, the example can be expanded to apply to depth 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. There are 4 different shades of blue represented by 2 bits. As the component value 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 3-4 “Examples of Pixel Color Values ”.

Table 3-4 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 increase 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 a command line similar to the following:

    xwcreate -g 600x500 -depth 24 window

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

    xwcreate -g 600x500 -depth 24 -visual TrueColor window
    xwcreate -g 600x500 -depth 24 -visual DirectColor
    \ window

    Note the addition of the command line option -visual for declaring TrueColor and DirectColor visuals. The HP Visualize-48 and HP Visualize-48XP devices default to PseudoColor if the visual is not specified.

  • The TrueColor color map is read-only, so it cannot be modified. Note that any attempt to modify the TrueColor color map will not produce an error message.

    One class of applications that could be effected by this are those that perform their own gamma correction.

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