[ Previous | Next | Contents | Glossary | Home | Search ]
OpenGL 1.1 for AIX: Reference Manual

glPixelMap Subroutine

Purpose

Sets up pixel transfer maps.

Library

OpenGL C bindings library: libGL.a

C Syntax

void glPixelMapfv(GLenum Map, 
     GLint MapSize,
     const GLfloat *Values)
void glPixelMapuiv(GLenum Map, 
       GLint MapSize,
       const GLuint *Values)
void glPixelMapusv(GLenum Map, 
        GLint MapSize,
        const GLushort *Values)

Parameters

Map Specifies a symbolic map name. Map must be one of the following:

Description

The glPixelMap subroutine sets up translation tables, or maps, used by the glDrawPixels, glReadPixels, glCopyPixels, glTexImage1D, and glTexImage2D subroutines. See the glPixelTransfer subroutine for a complete description on using these maps. Use of these maps is also described in part in the pixel and texture image subroutines. Only the specification of the maps is described here.

The Map parameter is a symbolic map name, indicating one of 10 maps to set. The MapSize parameter specifies the number of entries in the map, and the Values parameter is a pointer to an array of MapSize map values.

The 10 maps are:

GL_PIXEL_MAP_I_TO_I Maps color indexes to color indexes.
GL_PIXEL_MAP_S_TO_S Maps stencil indexes to stencil indexes.
GL_PIXEL_MAP_I_TO_R Maps color indexes to red components.
GL_PIXEL_MAP_I_TO_G Maps color indexes to green components.
GL_PIXEL_MAP_I_TO_B Maps color indexes to blue components.
GL_PIXEL_MAP_I_TO_A Maps color indexes to alpha components.
GL_PIXEL_MAP_R_TO_R Maps red components to red components.
GL_PIXEL_MAP_G_TO_G Maps green components to green components.
GL_PIXEL_MAP_B_TO_B Maps blue components to blue components.
GL_PIXEL_MAP_A_TO_A Maps alpha components to alpha components.

The entries in a map can be specified as single precision floating-point numbers, unsigned short integers, or unsigned long integers. Maps that store color component values (all but the GL_PIXEL_MAP_I_TO_I and GL_PIXEL_MAP_S_TO_S maps) retain their values in floating-point format, with unspecified mantissa and exponent sizes. Floating-point values specified by glPixelMapfv are converted directly to the internal floating-point format of these maps, then clamped to the range [0,1]. Unsigned integer values specified by glPixelMapusv and glPixelMapuiv are converted linearly such that the largest representable integer maps to 1.0, and 0 (zero) maps to 0.0.

Maps that store indices, GL_PIXEL_MAP_I_TO_I and GL_PIXEL_MAP_S_TO_S, retain their values in fixed-point format, with an unspecified number of bits to the right of the binary point. Floating-point values specified by glPixelMapfv are converted directly to the internal fixed-point format of these maps. Unsigned integer values specified by glPixelMapusv and glPixelMapuiv specify integer values, with all 0s to the right of the binary point.

The following table shows the initial sizes and values for each of the maps. Maps that are indexed by either color or stencil indexes must have MapSize = 2n for some n or results are undefined. The maximum allowable size for each map depends on the implementation and can be determined by calling the glGet subroutine with argument GL_MAX_PIXEL_MAP_TABLE. The single maximum applies to all maps, and it is at least 32.

Map Lookup Index Lookup Value Initial Size Initial Value
GL_PIXEL_MAP_I_TO_I color index color index 1 0.0
GL_PIXEL_MAP_S_TO_S stencil index stencil index 1 0
GL_PIXEL_MAP_I_TO_R color index R 1 0.0
GL_PIXEL_MAP_I_TO_G color index G 1 0.0
GL_PIXEL_MAP_I_TO_B color index B 1 0.0
GL_PIXEL_MAP_I_TO_A color index A 1 0.0
GL_PIXEL_MAP_R_TO_R R R 1 0.0
GL_PIXEL_MAP_G_TO_G G G 1 0.0
GL_PIXEL_MAP_B_TO_B B B 1 0.0
GL_PIXEL_MAP_A_TO_A A A 1 0.0

Errors

GL_INVALID_ENUM Map is not an accepted value.
GL_INVALID_VALUE MapSize is negative or larger than GL_MAX_PIXEL_MAP_TABLE.
GL_INVALID_VALUE Map is GL_PIXEL_MAP_I_TO_I, GL_PIXEL_MAP_S_TO_S, GL_PIXEL_MAP_I_TO_R, GL_PIXEL_MAP_I_TO_G, GL_PIXEL_MAP_I_TO_B, or GL_PIXEL_MAP_I_TO_A, and MapSize is not a power of two.
GL_INVALID_OPERATION The glPixelMap subroutine is called between a call to glBegin and the corresponding call to glEnd.

Associated Gets

Associated gets for the glPixelMap subroutine are as follows. (See the glGet subroutine for more information.)

glGetPixelMap

glGet with argument GL_PIXEL_MAP_I_TO_I_SIZE

glGet with argument GL_PIXEL_MAP_S_TO_S_SIZE

glGet with argument GL_PIXEL_MAP_I_TO_R_SIZE

glGet with argument GL_PIXEL_MAP_I_TO_G_SIZE

glGet with argument GL_PIXEL_MAP_I_TO_B_SIZE

glGet with argument GL_PIXEL_MAP_I_TO_A_SIZE

glGet with argument GL_PIXEL_MAP_R_TO_R_SIZE

glGet with argument GL_PIXEL_MAP_G_TO_G_SIZE

glGet with argument GL_PIXEL_MAP_B_TO_B_SIZE

glGet with argument GL_PIXEL_MAP_A_TO_A_SIZE

glGet with argument GL_MAX_PIXEL_MAP_TABLE.

Files

/usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL.

Related Information

The glBegin or glEnd subroutine, glCopyPixels subroutine, glDrawPixels subroutine, glGetPixelMap subroutine, glPixelStore subroutine, glPixelTransfer subroutine, glReadPixels subroutine, glTexImage1D subroutine, glTexImage2D subroutine.

OpenGL Overview.


[ Previous | Next | Contents | Glossary | Home | Search ]