[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]
GL3.2 for AIX: Graphics Library (GL) Technical Reference

mapcolor Subroutine

Purpose

Changes a color map entry to a specified RGB value.

Libraries

Graphics Library

C (libgl.a)

FORTRAN (libfgl.a)

C Syntax

void mapcolor
(Colorindex index,
Int16 red, Int16 green, Int16 blue)

FORTRAN Syntax

SUBROUTINE MAPCOL (index, red, green, blue)
INTEGER*4 index, red, green, blue
Note: For FORTRAN users: this subroutine accepts long integer parameters (INTEGER*4) when invoked from a FORTRAN program, although it accepts short integers when invoked from a C program. The C and FORTRAN syntax shown here reflect this difference.

Description

The mapcolor subroutine changes a single color map entry for the current drawing mode to a specified RGB value. The index parameter loads the color map entry that corresponds with the specified RGB intensities. The valid range for the index parameter depends on the drawing mode:

NORMALDRAW 0 to 4095, or 0 to 255 if the system has only eight color bitplanes or is in multimap mode.
OVERDRAW 1 to 3 if the overlay(2) subroutine has been called, or 1 to 15 if the overlay(4) subroutine has been called.
UNDERDRAW 0 to 3 if the underlay(2) subroutine has been called, or 0 to 15 if the underlay(4) subroutine has been called.
PUPDRAW 1 to 3.
CURSORDRAW 1 to 3.

In multimap mode, the mapcolor subroutine updates only the small color map currently selected by the setmap subroutine. The system ignores invalid indexes.

On most systems, this subroutine does not set the current drawing color, and so should not be used for this purpose. To set the current drawing color, use the c, color, cpack, or RGBcolor subroutine.

Instead of the mapcolor subroutine, it is suggested that you use the mapcolors subroutine for new development, because of its significantly improved performance.

Note: This subroutine cannot be used to add to a display list.

Parameters

index Specifies the index into the color map.
red Specifies the intensity of red associated with the index.
green Specifies the intensity of green associated with the index.
blue Specifies the intensity of blue associated with the index.

Example

The example C language program colored.c uses the mapcolor subroutine to edit the color map.

Implementation Specifics

This subroutine is part of GL in the AIXwindows Environment/6000 Version 1, Release 2 with AIXwindows/3D Feature.

The POWERgraphics GXT1000 supports a 12-bit colorindex frame buffer.

Files

/usr/include/gl/gl.h Contains C language constant and variable type definitions for GL.
/usr/include/gl/fgl.h Contains FORTRAN constant and variable type definitions for GL.

Related Information

Choosing a set of bitplanes for drawing with the drawmode subroutine.

Defining a color map ramp for gamma correction with the gammaramp subroutine.

Getting a copy of the RGB values for a color map entry with the getmcolor subroutine.

Organizing the color map as one large map with the onemap subroutine.

Organizing the color map as 16 small maps with the multimap subroutine.

Setting the number of bitplanes used for overlay colors with the overlay subroutine.

Selecting one of 16 small color maps with the setmap subroutine.

Setting the number of bitplanes used for underlay colors with the underlay subroutine.

Working in Color Map and RGB Modes.


[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]