copy pixels into a color table
glCopyColorTable( GLenum ( target ) , GLenum ( internalformat ) , GLint ( x ) , GLint ( y ) , GLsizei ( width ) )-> void
glCopyColorTable loads a color table with pixels from the current GL_READ_BUFFER (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 undefined.
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 components 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 . Each pixel is then converted to the internal format 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 format (red, green, blue, alpha, luminance, and intensity). The mapping is as follows:
Finally, the red, green, blue, alpha, luminance, and/or intensity components of the resulting pixels are stored in the color table. They form a one-dimensional table with indices in the range .
GL_INVALID_ENUM is generated when target is not one of the allowable values.
GL_INVALID_VALUE is generated if width is less than zero.
GL_INVALID_VALUE is generated if internalformat is not one of the allowable values.
GL_TABLE_TOO_LARGE is generated if the requested color table is too large to be supported by the implementation.
Copyright 1991-2006 Silicon Graphics, Inc. This document is licensed under the SGI Free Software B License. For details, see http://oss.sgi.com/projects/FreeB/ .