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

getmcolors Subroutine

Purpose

Returns a range of color map RGB values.

Libraries

Graphics Library

C (libgl.a)

FORTRAN (libfgl.a)

C Syntax

void getmcolors(Int16 start_idx, Int16 end_idx, Int16 *r, Int16 *g, Int16 *b)

FORTRAN Syntax

SUBROUTINE GETMCOLORS (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 started from a FORTRAN program, although it accepts short integers when started from a C program. The C and FORTRAN syntax shown here reflect this difference.

Description

The getmcolors subroutine returns a range of color map table entries. The range that is returned begins with the start_idx parameter and ends with the end_idx parameter, inclusive. The length of the array must be equal to end_idx - start_idx + 1. For instance, to return only one color map entry, set start_idx and end_idx to the same number. To return two entries, set end_idx to start_idx + 1.

The getmcolors subroutine is functionally equivalent to the C code shown in the following fragment, although it executes considerably faster.

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

The getmcolors subroutine can be used to read the underlay, overlay, cursor, pop-up, or main frame buffer color map. Which map is read depends on the current drawing mode (as set by the drawmode subroutine).

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 returned.
end_idx Specifies the ending index in the color map to be returned.
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.

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.

Returning the current RGB color with the gRGBcolor subroutine.

Loading a range of color map entries with the mapcolors subroutine

Querying the System.

Working in Color Map and RGB Modes.


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