glCopyColorTableSGI(3G) OpenGL Reference glCopyColorTableSGI(3G)
NAME
glCopyColorTableSGI - copy pixels into a color table
C SPECIFICATION
void glCopyColorTableSGI( GLenum target,
GLenum internalformat,
GLint x,
GLint y,
GLsizei width )
PARAMETERS
target The color table target. Must be
GLTEXTURECOLORTABLESGI, GLCOLORTABLESGI,
GLPOSTCONVOLUTIONCOLORTABLESGI, or
GLPOSTCOLORMATRIXCOLORTABLESGI.
internalformat The internal storage format of the texture image. Must
be one of the following symbolic constants: GLALPHA,
GLALPHA4EXT, GLALPHA8EXT, GLALPHA12EXT,
GLALPHA16EXT, GLLUMINANCE, GLLUMINANCE4EXT,
GLLUMINANCE8EXT, GLLUMINANCE12EXT,
GLLUMINANCE16EXT, GLLUMINANCEALPHA,
GLLUMINANCE4ALPHA4EXT, GLLUMINANCE6ALPHA2EXT,
GLLUMINANCE8ALPHA8EXT, GLLUMINANCE12ALPHA4EXT,
GLLUMINANCE12ALPHA12EXT, GLLUMINANCE16ALPHA16EXT,
GLINTENSITYEXT, GLINTENSITY4EXT, GLINTENSITY8EXT,
GLINTENSITY12EXT, GLINTENSITY16EXT, GLRGB,
GLRGB2EXT, GLRGB4EXT, GLRGB5EXT, GLRGB8EXT,
GLRGB10EXT, GLRGB12EXT, GLRGB16EXT, GLRGBA,
GLRGBA2EXT, GLRGBA4EXT, GLRGB5A1EXT, GLRGBA8EXT,
GLRGB10A2EXT, GLRGBA12EXT, GLRGBA16EXT.
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. Must be 0 or 1.
DESCRIPTION
glCopyColorTableSGI loads a color table with pixels from the current
GLREADBUFFER (rather than from main memory, as is the case for
glColorTableSGI).
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.
Page 1
glCopyColorTableSGI(3G) OpenGL Reference glCopyColorTableSGI(3G)
The pixels in the rectangle are processed just as if glReadPixels were
called, with format 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. ( Use glTexParameter to set the scale and bias
parameters for the texture color table. Use glColorTableParameterSGI, to
set the scale and bias parameters for the other color tables.)
Next, the R, G, B, and A values are clamped to the range [0,1]. 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:
Internal Format Red Green Blue Alpha Luminance Intensity
_______________________________________________________________________
GLALPHA A
GLLUMINANCE R
GLLUMINANCEALPHA A R
GLINTENSITYEXT R
GLRGB R G B
GLRGBA R G B A
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 [0, width - 1].
NOTES
glCopyColorTableSGI with target GLCOLORTABLESGI,
GLPOSTCONVOLUTIONCOLORTABLESGI, or
GLPOSTCOLORMATRIXCOLORTABLESGI is only available if both the
EXTcopytexture and the SGIcolortable extensions are supported.
glCopyColorTableSGI with target GLTEXTURECOLORTABLESGI is only
available if both the EXTcopytexture and the SGItexturecolortable
extensions are supported. See glIntro for more information about using
extensions.
ERRORS
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.
GLTABLETOOLARGEEXT is generated if the requested color table is too
large to be supported by the implementation.
Page 2
glCopyColorTableSGI(3G) OpenGL Reference glCopyColorTableSGI(3G)
GLINVALIDOPERATION is generated if glCopyColorTableSGI is executed
between the execution of glBegin and the corresponding execution of
glEnd.
ASSOCIATED GETS
glGetColorTableParameterSGI
MACHINE DEPENDENCIES
RealityEngine, RealityEngine2, and VTX systems do not support
glCopyColorTableSGI; calling it results in a GLINVALIDOPERATION error.
SEE ALSO
glColorTableSGI, glColorTableParameterSGI, glReadPixels.
Page 3