Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ fill_color(3G) — HP-UX 5.50

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

backface_control(3G)

define_color_table(3G)

fill_dither(3G)

interior_style(3G)

light_model(3G)

polygon(3G)

rectangle(3G)

shade_mode(3G)

vertex_format(3G)

FILL_COLOR(3G)

NAME

fill_color − set color table index for filled areas on raster devices. 

SYNOPSIS

C Syntax:

void fill_color_index(fildes,index);
int fildes,index;

void fill_color(fildes,red,green,blue);
int fildes;
float red,green,blue;

FORTRAN77 Syntax:

subroutine fill_color_index(fildes,index)
integer*4 fildes,index

subroutine fill_color(fildes,red,green,blue)
integer*4 fildes
real red,green,blue

Pascal Syntax:

procedure fill_color_index(fildes,index:integer);

procedure fill_color(fildes:integer;red,green,blue:real);

DESCRIPTION

Input Parameters

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

index Integer index into the color table.  The fill color for subsequent fill primitives will be the color at that location in the color table.  Use inquire_sizes procedure to find the number of color table entries available for a specific device. 

red, green, blue Color components used for subsequent filled areas.  Values range from 0.0 to 1.0 where zero indicates minimum color (off) and 1.0 indicates full (maximum) color. Monochrome devices determine intensity by using the equation I=0.30*red+0.59*green+0.11*blue. 

Discussion

Polygons and rectangles are filled by the specified color when interior_style is INT_SOLID. 

The color of polygon primitives depends on:

• The state of the shading parameter as specified by shade_mode which determines whether or not polygons are sent through light source equations. 

• Coord, use, and normals parameters as specified by vertex_format which determines whether or not to use color coordinates supplied with each vertex. 

If shading is FALSE and use ==0:

When the fill color is set by use of red-green-blue parameters, determination of actual output depends on the state of the mode parameter set with shade_mode:

CMAP_NORMAL This is the default mode if shade_mode has not been called.  If colors (specified by fill_dither) is approximation to the specified color when fill_color is called.  When the closest color has been found, the corresponding index value is placed in each of the 16 pixel color index locations in the dither cell.  If colors (specified by fill_dither) is 2, the color table is searched to find two indexes that, when combined in a 50% mixture, will be closest to the color specified when fill_color is called.  Each index value is then copied into eight pixel locations in the dither cell.  If colors is 16, the color table is searched for a combination of 16 indexes that, when combined, come closest to the color requested.  In this case, it is unlikely that 16 different index values would be used to produce the specified color.  Note: Each color map search takes time.  Therefore, the more colors requested in the longer each call will take. 

CMAP_MONOTONIC The color values are converted to an intensity value by using the equation: I = 0.30(red) + 0.59(green) + 0.11(blue).  This intensity is mapped to an index, using the minimum and maximum limits defined by shade_range. If the intensity does not map to an exact index value, dithering is used between two adjacent indices if colors (specified by fill_dither) is greater than one.

CMAP_FULL Color values are mapped directly to an index with the assumption that the color map is set up to a predefined full-color state.  If the colors do not map to a exact index, dithering is used if colors (specified by fill_dither) is greater than 1.

When in CMAP_NORMAL mode, fill_color_index is faster than fill_color because less time is spent searching for an optimum color match in each dither cell. 

Search time can also be shortened by using fewer colors in a dither cell to further shorten color table search time.  However, the limited color resolution makes it more difficult to match a given specified color. 

For use >0, coord equal to 3, and normals FALSE, fill_color is ignored and the polygon color is determined by extra coordinates given with each vertex.  See vertex_format for more information. 

For shading TRUE, fill_color is used to set the reflectance coefficient for the light source equations (if no rgb values are provided for each vertex).  If an index is given, the color given by the corresponding color table location is used as the reflectance coefficient.  See light_model for information about light source equations. 

DEFAULTS

Color Index defaults to 1:  Device-dependent dithering for colors not specified with an index. 

SEE ALSO

backface_control(3G), define_color_table(3G), fill_dither(3G), interior_style(3G),
light_model(3G), polygon(3G), rectangle(3G), shade_mode(3G),
vertex_format(3G), Starbase Graphics Techniques.

Hewlett-Packard Company  —  May 11, 2021

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