GLCOPYCOLORTABLE(3G) GLCOPYCOLORTABLE(3G)
NAME
glCopyColorTable - copy pixels into a color table
C SPECIFICATION
void glCopyColorTable( GLenum target,
GLenum internalformat,
GLint x,
GLint y,
GLsizei width )
PARAMETERS
target The color table target. Must be GLCOLORTABLE,
GLPOSTCONVOLUTIONCOLORTABLE, or
GLPOSTCOLORMATRIXCOLORTABLE.
internalformat The internal storage of the texture image. Must be
one of the following symbolic constants: GLALPHA,
GLALPHA4, GLALPHA8, GLALPHA12, GLALPHA16,
GLUMINANCE, GLUMINANCE4, GLUMINANCE8,
GLUMINANCE12, GLUMINANCE16, GLUMINANCEALPHA,
GLUMINANCE4ALPHA4, GLUMINANCE6ALPHA2,
GLUMINANCE8ALPHA8, GLUMINANCE12ALPHA4,
GLUMINANCE12ALPHA12, GLUMINANCE16ALPHA16,
GLINTENSITY, GLINTENSITY4, GLINTENSITY8,
GLINTENSITY12, GLINTENSITY16, GLR3G3B2, GLRGB,
GLRGB4, GLRGB5, GLRGB8, GLRGB100, GLRGB12,
GLRGB16, GLRGBA, GLRGBA2, GLRGBA4, GLRGB5A1,
GLRGBA8, GLRGB100A2, GLRGBA12, GLRGBA16.
x The x coordinate of the lower-left corner of the pixel
rectangle to be transferred to the color table.
y The y coordinate of the lower-left corner of the pixel
rectangle to be transferred to the color table.
width The width of the pixel rectangle.
DESCRIPTION
glCopyColorTable loads a color table with pixels from the current
GLREADBUFER (rather than from main memory, as is the case for
glColorTable).
The screen-aligned pixel rectangle with lower-left corner at (x, y)
having width width and height 1 is loaded into the color table. If any
pixels within this region are outside the window that is associated
with the GL context, the values obtained for those pixels are unde-
fined.
The pixels in the rectangle are processed just as if glReadPixels were
called, with internalformat set to RGBA, but processing stops after the
final conversion to RGBA.
The four scale parameters and the four bias parameters that are defined
for the table are then used to scale and bias the R, G, B, and A compo-
nents of each pixel. The scale and bias parameters are set by calling
glColorTableParameter.
Next, the R, G, B, and A values are clamped to the range [0,1]. Each
pixel is then converted to the internal specified by internalformat.
This conversion simply maps the component values of the pixel (R, G, B,
and A) to the values included in the internal (red, green, blue,
alpha, luminance, and intensity). The mapping is as follows:
Internal Format Channel mapping
GLALPHA A=Alpha
GLUMINANCE R=Luminance
GLUMINANCEALPHA A=Alpha, R=Luminance
GLINTENSITY R=Intensity
GLRGB R=Red, G=Green, B=Blue
GLRGBA R=Red, G=Green, B=Blue, A=Alpha
Finally, the red, green, blue, alpha, luminance, and/or intensity com-
ponents of the resulting pixels are stored in the color table. They
form a one-dimensional table with indices in the range [0, width - 1].
NOTES
glCopyColorTable is available only if GLARBimaging is returned from
calling glGetString with an argument of GLEXTENSIONS.
ERORS
GLINVALIDENUM is generated when target is not one of the allowable
values.
GLINVALIDVALUE is generated if width is less than zero.
GLINVALIDVALUE is generated if internalformat is not one of the
allowable values.
GLTABLETOLARGE is generated if the requested color table is too
large to be supported by the implementation.
GLINVALIDOPERATION is generated if glCopyColorTable is executed
between the execution of glBegin and the corresponding execution of
glEnd.
ASOCIATED GETS
glGetColorTable, glGetColorTableParameter
SEE ALSO
glColorTable, glColorTableParameter, glReadPixels
GLCOPYCOLORTABLE(3G)
|