Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ inquire_col(3G) — HP-UX ANSI C A.10.11

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

define_color_table(3G)

rgb_to_index(3G)

shade_mode(3G)

inquire_color_table(3G)

NAME

inquire_color_table − return current color table settings for specified graphic device

SYNOPSIS

C Syntax:

void inquire_color_table ( fildes, start, count, response );
int fildes, start, count;
float response[][3];

FORTRAN77 Syntax:

subroutine inquire_color_table ( fildes, start, count, response )
integer*4 fildes, start, count
real response ( 3, count )

Pascal Syntax:

procedure inquire_color_table ( fildes, start, count:integer;
var response:array[lo..hi:integer]of rgb_color );

DESCRIPTION

Input Parameters

fildes Integer file descriptor returned by gopen when an I/O path to a graphics device is opened. 

start Integer index into the device color table at which to start the color table report. The first item in the color table is at index 0 (zero). 

count Integer value, equal to the number of color table entries to report.  Value range is one (1 entry) through the number of colors available on the device (256 for 256-color device).  To determine the number of available color table entries on a device, use inquire_sizes.

Output Parameters

response Returns red, green, and blue values for each color table entry (values are in the range of zero (0.0) to one (1.0), where 1.0 is full intensity).  In C terminology-

 response[start][0] = color_table[start][0];
response[start][1] = color_table[start][1];
response[start][2] = color_table[start][2];
response[count-1][2] = color_table[start+count-1][2];

Discussion

Each file descriptor (fildes) opened as an output device has a color table associated with it.  When this procedure is called, the color table is returned.  If multiple file descriptors are open to the same device, the color table and the device’s color map may not always be identical (because of a previous call to define_color_table). 

Some device drivers have a gescape (READ_COLOR_MAP) that reads the current color map into the color table.  See the appropriate device driver description for more information. 

For devices that support 12-bit indexing, the current color table can be either an 8-bit or a 12-bit color table (see double_buffer).  The respective color table settings returned by inquire_color_table will be those from the table which is currently active depending on the current indexing mode (e.g., 8-bit color table settings returned when in 8-bit indexing mode, 12-bit color table values returned in 12-bit indexing mode). 

For multi-bank graphics devices:

16 Planes Each bank of 8 has the same color map. 

24 Planes If the mode parameter of shade_mode is set to CMAP_FULL and an inquire operation is performed on the color table, blue entries specify the intensities of bank 0, green applies to bank 1, and red to bank 2.  If the device supports 12-bit indexing and is currently in 12-bit indexing mode, then the 12-bit color table is referenced.  Otherwise, the device appears to be a standard 8-plane graphics device. 

On grayscale devices, each color table entry will have identical values for R, G, and B. 

For details about color table usage in the X Window System see Starbase Graphics Techniques. 

SEE ALSO

Starbase Reference: define_color_table(3G), rgb_to_index(3G), shade_mode(3G). 
Starbase Device Drivers Manual. 

Hewlett-Packard Company  —  November 03, 1994

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026