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

Overlay Plane Transparency and the X Windows System

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Index

The default X11 mode on the HP Visualize-48 and HP Visualize-48XP do not provide an overlay visual with a transparent property. If you need an overlay color map that supports transparency, create the color map using the visual that has transparency in its SERVER_OVERLAY_VISUALS property (see the next section).

An overlay visual's transparency feature enables you to render opaque objects (for example, menus and text) to a transparent overlay window and at the same time view rendered objects in an image window. For example, you may want to show a map of a country without all of its internal borders, and then add the internal borders as you need them. This can be done by creating two X windows with the same geometry: one in the overlay planes and one in the images planes. The country's terrain and boundaries would be drawn in the image planes window and the internal borders in a transparent overlay window.

The following section describes the default frame buffer configuration for the HP Visualize-48 and HP Visualize-48XP.

  • The default visual configuration is:

    • overlay planes

    • depth 8

    • PseudoColor

    • opaque (no transparency)

    with 256 color map entries. Note that when using the default X server mode of the HP Visualize-48 and HP Visualize-48XP, if you query the X server for the number of entries in the default color map, the server will reply that there are 256 entries available. Although these entries are available, the X server reserves the last entry (index 255). So, that entry is not writable and should not be used.

  • The default X11 color map is locked into one of the hardware color maps in the overlay planes. For a description of how to move the default visual to images planes, read the subsequent section "Moving the Default Visual to the Images Planes" in this chapter.

In the default overlay visual, the number of overlay color map entries is 255 because the last entry is the transparent color map value. If your application requires that you have 256 entries in your color map, you need to set the environment variable CountTransparentInOverlayVisual. To do this, use SAM. Or you can manually edit the 〈x11-admin[9]/X*screens file to add the following option:

ScreenOptions
CountTransparentInOverlayVisual

before starting the X11 server. Any attempts to modify entry 255 will silently ignored, and will have no effect on the color map.

The Default Frame Buffer Configuration for the HP VISUALIZE-48 and VISUALIZE-48XP

Table 3-5 “The Default Frame Buffer Configuration for the HP Visualize-48 and HP Visualize-48XP shows the default HP Visualize-48 and HP Visualize-48XP frame buffer configurations. These configurations are not changed by using overlay transparency.

Table 3-5 The Default Frame Buffer Configuration for the HP Visualize-48 and HP Visualize-48XP

Frame Buffer Layer

Window Depth

Hardware Buffering

Hardware Color Maps

Overlay Transparency

Visual

overlay

8

single

2

no

PseudoColor [1]

overlay

8

single

2

yes

PseudoColor

image

8

single or double

4

N/A

PseudoColor [2] TrueColor

image

24

single or double

4

N/A

DirectColor TrueColor

[1] This is the default overlay visual.

[2] This is the first visual returned by xdpyinfo.

 

If you need an overlay color map that supports transparency, create the color map using the visual that has transparency in its SERVER_OVERLAY_VISUALS property. To look at the contents of this property, you would use code similar to the following:

/* First, get the list of visuals for this screen. */
.
.
*pVisuals = XGetVisualInfo(display, mask, &getVisInfo,
numVisuals);
.
.
/* Now, get the overlay visual information for this screen. To
obtain this information, get the SERVER_OVERLAY_VISUALS
property. */

overlayVisualsAtom = XInternAtom(display,
"SERVER_OVERLAY_VISUALS", True);
if (overlayVisualsAtom != None)
{
/* Since the Atom exists, we can request the property's
contents. */
bytesAfter = 0;
numLongs = sizeof(OverlayVisualPropertyRec) / 4;
do
{
numLongs += bytesAfter * 4;
XGetWindowProperty(display, RootWindow(display, screen),
overlayVisualsAtom, 0, numLongs, False,
overlayVisualsAtom, &actualType, &actualFormat,
&numLongs, &bytesAfter, pOverlayVisuals);
} while (bytesAfter > 0);
}
.
.
/* Process the pOverlayVisuals array. */
while (nVisuals >= 0) {
nOVisuals = *numOverlayVisuals;
pOVis = *pOverlayVisuals;
imageVisual = True;
while (nOVisuals >= 0) {
pOOldVis = (OverlayVisualPropertyRec *) pOVis;
if (pVis->visualid == pOOldVis->visualID)
{
imageVisual = False;
pOVis->pOverlayVisualInfo = pVis;
/* Found the transparent visual */
if (pOVis->transparentType == TransparentPixel);
}
pOVis++;
}
}

This program segment is not complete; however, its main purpose is to give you an idea of how a visual is checked for overlay transparency. The source for the above code can be found in the file[10]:

sb-utils〉/wsutils.c


[9] The actual path names of directories in angle brackets depend on the file system structure. See the Graphics Administration Guide for details.

[10] The actual path names of directories in angle brackets depend on the file system structure. See the Graphics Administration Guide for details.

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