glPixelMap(3G) OpenGL Reference glPixelMap(3G)
NAME
glPixelMapfv, glPixelMapuiv, glPixelMapusv - set up pixel transfer maps
C SPECIFICATION
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. Must be one of the following:
GLPIXELMAPITOI, GLPIXELMAPSTOS, GLPIXELMAPITOR,
GLPIXELMAPITOG, GLPIXELMAPITOB, GLPIXELMAPITOA,
GLPIXELMAPRTOR, GLPIXELMAPGTOG, GLPIXELMAPBTOB,
or GLPIXELMAPATOA.
mapsize Specifies the size of the map being defined.
values Specifies an array of mapsize values.
DESCRIPTION
glPixelMap sets up translation tables, or maps, used by glCopyPixels,
glCopyTexImage1D, glCopyTexImage2D, glCopyTexSubImage1D,
glCopyTexSubImage2D, glDrawPixels, glReadPixels, glTexImage1D,
glTexImage2D, glTexSubImage1D, and glTexSubImage2D. Use of these maps is
described completely in the glPixelTransfer reference page, and partly in
the reference pages for the pixel and texture image commands. Only the
specification of the maps is described in this reference page.
map is a symbolic map name, indicating one of ten maps to set. mapsize
specifies the number of entries in the map, and values is a pointer to an
array of mapsize map values.
The ten maps are as follows:
GLPIXELMAPITOI Maps color indices to color indices.
GLPIXELMAPSTOS Maps stencil indices to stencil indices.
GLPIXELMAPITOR Maps color indices to red components.
GLPIXELMAPITOG Maps color indices to green components.
Page 1
glPixelMap(3G) OpenGL Reference glPixelMap(3G)
GLPIXELMAPITOB Maps color indices to blue components.
GLPIXELMAPITOA Maps color indices to alpha components.
GLPIXELMAPRTOR Maps red components to red components.
GLPIXELMAPGTOG Maps green components to green components.
GLPIXELMAPBTOB Maps blue components to blue components.
GLPIXELMAPATOA 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 GLPIXELMAPITOI and
GLPIXELMAPSTOS) 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
maps to 0.0.
Maps that store indices, GLPIXELMAPITOI and GLPIXELMAPSTOS,
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 0's 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 indices must have
n
mapsize = 2 for some n or the results are undefined. The maximum
allowable size for each map depends on the implementation and can be
determined by calling glGet with argument GLMAXPIXELMAPTABLE. The
single maximum applies to all maps; it is at least 32.
map lookup index lookup value initial size initial value
____________________________________________________________________________
GLPIXELMAPITOI color index color index 1 0
GLPIXELMAPSTOS stencil index stencil index 1 0
GLPIXELMAPITOR color index R 1 0
GLPIXELMAPITOG color index G 1 0
GLPIXELMAPITOB color index B 1 0
GLPIXELMAPITOA color index A 1 0
GLPIXELMAPRTOR R R 1 0
GLPIXELMAPGTOG G G 1 0
GLPIXELMAPBTOB B B 1 0
GLPIXELMAPATOA A A 1 0
Page 2
glPixelMap(3G) OpenGL Reference glPixelMap(3G)
ERRORS
GLINVALIDENUM is generated if map is not an accepted value.
GLINVALIDVALUE is generated if mapsize is less than one or larger than
GLMAXPIXELMAPTABLE.
GLINVALIDVALUE is generated if map is GLPIXELMAPITOI,
GLPIXELMAPSTOS, GLPIXELMAPITOR, GLPIXELMAPITOG,
GLPIXELMAPITOB, or GLPIXELMAPITOA, and mapsize is not a power
of two.
GLINVALIDOPERATION is generated if glPixelMap is executed between the
execution of glBegin and the corresponding execution of glEnd.
ASSOCIATED GETS
glGetPixelMap
glGet with argument GLPIXELMAPITOISIZE
glGet with argument GLPIXELMAPSTOSSIZE
glGet with argument GLPIXELMAPITORSIZE
glGet with argument GLPIXELMAPITOGSIZE
glGet with argument GLPIXELMAPITOBSIZE
glGet with argument GLPIXELMAPITOASIZE
glGet with argument GLPIXELMAPRTORSIZE
glGet with argument GLPIXELMAPGTOGSIZE
glGet with argument GLPIXELMAPBTOBSIZE
glGet with argument GLPIXELMAPATOASIZE
glGet with argument GLMAXPIXELMAPTABLE
SEE ALSO
glCopyPixels, glCopyTexImage1D, glCopyTexImage2D, glCopyTexSubImage1D,
glCopyTexSubImage2D, glDrawPixels, glPixelStore, glPixelTransfer,
glReadPixels, glTexImage1D, glTexImage2D, glTexSubImage1D,
glTexSubImage2D
Page 3