NAME

glCopyColorTable - copy pixels into a color table

C SPECIFICATION

void ggllCCooppyyCCoolloorrTTaabbllee( GLenum _t_a_r_g_e_t,
                       GLenum _i_n_t_e_r_n_a_l_f_o_r_m_a_t,
                       GLint _x,
                       GLint _y,
                       GLsizei _w_i_d_t_h )

delim $$

PARAMETERS

_t_a_r_g_e_t
The color table target. Must be GGLL__CCOOLLOORR__TTAABBLLEE, GGLL__PPOOSSTT__CCOONNVVOOLLUUTTIIOONN__CCOOLLOORR__TTAABBLLEE, or GGLL__PPOOSSTT__CCOOLLOORR__MMAATTRRIIXX__CCOOLLOORR__TTAABBLLEE.
_i_n_t_e_r_n_a_l_f_o_r_m_a_t
The internal storage of the texture image. Must be one of the following symbolic constants: GGLL__AALLPPHHAA, GGLL__AALLPPHHAA44, GGLL__AALLPPHHAA88, GGLL__AALLPPHHAA1122, GGLL__AALLPPHHAA1166, GGLL__LLUUMMIINNAANNCCEE, GGLL__LLUUMMIINNAANNCCEE44, GGLL__LLUUMMIINNAANNCCEE88, GGLL__LLUUMMIINNAANNCCEE1122, GGLL__LLUUMMIINNAANNCCEE1166, GGLL__LLUUMMIINNAANNCCEE__AALLPPHHAA, GGLL__LLUUMMIINNAANNCCEE44__AALLPPHHAA44, GGLL__LLUUMMIINNAANNCCEE66__AALLPPHHAA22, GGLL__LLUUMMIINNAANNCCEE88__AALLPPHHAA88, GGLL__LLUUMMIINNAANNCCEE1122__AALLPPHHAA44, GGLL__LLUUMMIINNAANNCCEE1122__AALLPPHHAA1122, GGLL__LLUUMMIINNAANNCCEE1166__AALLPPHHAA1166, GGLL__IINNTTEENNSSIITTYY, GGLL__IINNTTEENNSSIITTYY44, GGLL__IINNTTEENNSSIITTYY88, GGLL__IINNTTEENNSSIITTYY1122, GGLL__IINNTTEENNSSIITTYY1166, GGLL__RR33__GG33__BB22, GGLL__RRGGBB, GGLL__RRGGBB44, GGLL__RRGGBB55, GGLL__RRGGBB88, GGLL__RRGGBB1100, GGLL__RRGGBB1122, GGLL__RRGGBB1166, GGLL__RRGGBBAA, GGLL__RRGGBBAA22, GGLL__RRGGBBAA44, GGLL__RRGGBB55__AA11, GGLL__RRGGBBAA88, GGLL__RRGGBB1100__AA22, GGLL__RRGGBBAA1122, GGLL__RRGGBBAA1166.
_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.
_w_i_d_t_h
The width of the pixel rectangle.

DESCRIPTION

ggllCCooppyyCCoolloorrTTaabbllee loads a color table with pixels from the current GGLL__RREEAADD__BBUUFFFFEERR (rather than from main memory, as is the case for ggllCCoolloorrTTaabbllee).

The screen-aligned pixel rectangle with lower-left corner at (_x, _y) having width _w_i_d_t_h 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 ggllRReeaaddPPiixxeellss were called, with _i_n_t_e_r_n_a_l_f_o_r_m_a_t 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 ggllCCoolloorrTTaabblleePPaarraammeetteerr.

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 _i_n_t_e_r_n_a_l_f_o_r_m_a_t. 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:

center;
lb cb cb cb cb cb cb
l c c c c c c.
_
Internal Format        RedGreenBlueAlphaLuminanceIntensity
_
GGLL__AALLPPHHAA               A
GGLL__LLUUMMIINNAANNCCEE           R
GGLL__LLUUMMIINNAANNCCEE__AALLPPHHAA     AR
GGLL__IINNTTEENNSSIITTYY           R
GGLL__RRGGBB                 RGB
GGLL__RRGGBBAA                RGBA
_

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, _w_i_d_t_h - 1].

NOTES

ggllCCooppyyCCoolloorrTTaabbllee is available only if GGLL__AARRBB__iimmaaggiinngg is returned from calling ggllGGeettSSttrriinngg with an argument of GGLL__EEXXTTEENNSSIIOONNSS.

ERRORS

GGLL__IINNVVAALLIIDD__EENNUUMM is generated when _t_a_r_g_e_t is not one of the allowable values.

GGLL__IINNVVAALLIIDD__VVAALLUUEE is generated if _w_i_d_t_h is less than zero.

GGLL__IINNVVAALLIIDD__VVAALLUUEE is generated if _i_n_t_e_r_n_a_l_f_o_r_m_a_t is not one of the allowable values.

GGLL__TTAABBLLEE__TTOOOO__LLAARRGGEE is generated if the requested color table is too large to be supported by the implementation.

GGLL__IINNVVAALLIIDD__OOPPEERRAATTIIOONN is generated if ggllCCooppyyCCoolloorrTTaabbllee is executed between the execution of ggllBBeeggiinn and the corresponding execution of ggllEEnndd.

ASSOCIATED GETS

ggllGGeettCCoolloorrTTaabbllee, ggllGGeettCCoolloorrTTaabblleePPaarraammeetteerr

SEE ALSO

ggllCCoolloorrTTaabbllee((33GG)), ggllCCoolloorrTTaabblleePPaarraammeetteerr((33GG)), ggllRReeaaddPPiixxeellss((33GG))