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

mapcolors Subroutine

Purpose

Loads a range of the color map.

Libraries

Graphics Library

C (libgl.a)

FORTRAN (libfgl.a)

C Syntax

void mapcolors(Int16 start_idx, Int16 end_idx, Int16 r [ ], Int16 g [ ], Int16 b [ ] )

FORTRAN Syntax

SUBROUTINE MAPCOLORS (start_idx, end_idx, r, g, b)
INTEGER*4 start_idx, end_idx
INTEGER*2 r(1), g(1), b(1)
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 mapcolors subroutine loads a range of color map table entries. The range that is loaded begins with start_idx and ends with end_idx, inclusive. The length of the array must be equal to end_idx - start_idx + 1. For instance to load only one color map entry, set start_idx and end_idx to the same number. To load two entries, set end_idx to start_idx + 1.

The mapcolors subroutine is functionally equivalent to the C code shown in the following fragment, although it will execute considerably faster.

 {
   int i;
   for (i=0; i< (end_idx - start_idx + 1); i++)
      mapcolor (start_idx+i, r[i],g[i],b[i]);
 }

The mapcolors subroutine can be used to load the underlay, overlay, cursor, popup, or main frame buffer color map. Which map is loaded depends on the current drawing mode (as set by the drawmode subroutine).

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 mapcolors subroutine updates only the small color map currently selected by the setmap subroutine. The system ignores invalid indexes.

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

Parameters

start_idx Specifies the starting index in the color map to be loaded.
end_idx Specifies the ending index in the color map to be loaded.
r Specifies an array containing the intensity of the red component.
g Specifies an array containing the intensity of the green component.
b Specifies an array containing the intensity of the blue component.

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 range of color map RGB entries with the getmcolors 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 ]