Name
gl.PixelMap -- set up pixel transfer maps
Synopsis
gl.PixelMap(map, valuesArray)
Function
gl.PixelMap() sets up translation tables, or maps, used by gl.CopyPixels(), gl.CopyTexImage(), gl.CopyTexSubImage(), gl.DrawPixels(), gl.ReadPixels(), gl.TexImage(), and also gl.TexImage1D(), gl.TexImage2D(), gl.TexSubImage(), gl.TexSubImage1D(), and gl.TexSubImage2D(). Use of these maps is described completely in the gl.PixelTransfer() 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. values is a table that contains an array of values for the specified map name. The ten maps are as follows:

#GL_PIXEL_MAP_I_TO_I
Maps color indices to color indices.

#GL_PIXEL_MAP_S_TO_S
Maps stencil indices to stencil indices.

#GL_PIXEL_MAP_I_TO_R
Maps color indices to red components.

#GL_PIXEL_MAP_I_TO_G
Maps color indices to green components.

#GL_PIXEL_MAP_I_TO_B
Maps color indices to blue components.

#GL_PIXEL_MAP_I_TO_A
Maps color indices 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 are specified as floating-point numbers. Maps that store color component values (all but #GL_PIXEL_MAP_I_TO_I and #GL_PIXEL_MAP_S_TO_S) retain their values in floating-point format, with unspecified mantissa and exponent sizes. Floating-point values specified by gl.PixelMap() are converted directly to the internal floating-point format of these maps, then clamped to the range [0,1].

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 gl.PixelMap() are converted directly to the internal fixed-point format of these maps.

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 mapsize = 2n 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 #GL_MAX_PIXEL_MAP_TABLE. The single maximum applies to all maps; it is at least 32.

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

Please consult an OpenGL reference manual for more information.

Inputs
map
specifies a symbolic map name (see above for supported names)
valuesArray
specifies a table containing an array of values
Errors
#GL_INVALID_ENUM is generated if map is not an accepted value.

#GL_INVALID_VALUE is generated if mapsize is less than one or larger than #GL_MAX_PIXEL_MAP_TABLE.

#GL_INVALID_VALUE is generated if 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 is generated if gl.PixelMap() is executed between the execution of gl.Begin() and the corresponding execution of gl.End().

Associated gets
gl.GetPixelMap()

gl.Get() with argument #GL_PIXEL_MAP_I_TO_I_SIZE

gl.Get() with argument #GL_PIXEL_MAP_S_TO_S_SIZE

gl.Get() with argument #GL_PIXEL_MAP_I_TO_R_SIZE

gl.Get() with argument #GL_PIXEL_MAP_I_TO_G_SIZE

gl.Get() with argument #GL_PIXEL_MAP_I_TO_B_SIZE

gl.Get() with argument #GL_PIXEL_MAP_I_TO_A_SIZE

gl.Get() with argument #GL_PIXEL_MAP_R_TO_R_SIZE

gl.Get() with argument #GL_PIXEL_MAP_G_TO_G_SIZE

gl.Get() with argument #GL_PIXEL_MAP_B_TO_B_SIZE

gl.Get() with argument #GL_PIXEL_MAP_A_TO_A_SIZE

gl.Get() with argument #GL_MAX_PIXEL_MAP_TABLE


Show TOC