1GLCOPYCOLORTABLE(3G) OpenGL Manual GLCOPYCOLORTABLE(3G)
2
3
4
6 glCopyColorTable - copy pixels into a color table
7
9 void glCopyColorTable(GLenum target, GLenum internalformat, GLint x,
10 GLint y, GLsizei width);
11
13 target
14 The color table target. Must be GL_COLOR_TABLE,
15 GL_POST_CONVOLUTION_COLOR_TABLE, or
16 GL_POST_COLOR_MATRIX_COLOR_TABLE.
17
18 internalformat
19 The internal storage format of the texture image. Must be one of
20 the following symbolic constants: GL_ALPHA, GL_ALPHA4, GL_ALPHA8,
21 GL_ALPHA12, GL_ALPHA16, GL_LUMINANCE, GL_LUMINANCE4, GL_LUMINANCE8,
22 GL_LUMINANCE12, GL_LUMINANCE16, GL_LUMINANCE_ALPHA,
23 GL_LUMINANCE4_ALPHA4, GL_LUMINANCE6_ALPHA2, GL_LUMINANCE8_ALPHA8,
24 GL_LUMINANCE12_ALPHA4, GL_LUMINANCE12_ALPHA12,
25 GL_LUMINANCE16_ALPHA16, GL_INTENSITY, GL_INTENSITY4, GL_INTENSITY8,
26 GL_INTENSITY12, GL_INTENSITY16, GL_R3_G3_B2, GL_RGB, GL_RGB4,
27 GL_RGB5, GL_RGB8, GL_RGB10, GL_RGB12, GL_RGB16, GL_RGBA, GL_RGBA2,
28 GL_RGBA4, GL_RGB5_A1, GL_RGBA8, GL_RGB10_A2, GL_RGBA12, or
29 GL_RGBA16.
30
31 x
32 The x coordinate of the lower-left corner of the pixel rectangle to
33 be transferred to the color table.
34
35 y
36 The y coordinate of the lower-left corner of the pixel rectangle to
37 be transferred to the color table.
38
39 width
40 The width of the pixel rectangle.
41
43 glCopyColorTable loads a color table with pixels from the current
44 GL_READ_BUFFER (rather than from main memory, as is the case for
45 glColorTable()).
46
47 The screen-aligned pixel rectangle with lower-left corner at (x,\ y)
48 having width width and height 1 is loaded into the color table. If any
49 pixels within this region are outside the window that is associated
50 with the GL context, the values obtained for those pixels are
51 undefined.
52
53 The pixels in the rectangle are processed just as if glReadPixels()
54 were called, with internalformat set to RGBA, but processing stops
55 after the final conversion to RGBA.
56
57 The four scale parameters and the four bias parameters that are defined
58 for the table are then used to scale and bias the R, G, B, and A
59 components of each pixel. The scale and bias parameters are set by
60 calling glColorTableParameter().
61
62 Next, the R, G, B, and A values are clamped to the range 0 1. Each
63 pixel is then converted to the internal format specified by
64 internalformat. This conversion simply maps the component values of the
65 pixel (R, G, B, and A) to the values included in the internal format
66 (red, green, blue, alpha, luminance, and intensity). The mapping is as
67 follows:
68
69 ┌─────────────────────────────────┬─────────────────────────────┬───────────────────────────────┬──────────────────────────────┬───────────────────────────────┬───────────────────────────────────┬───────────────────────────────────┐
70 │ │ │ │ │ │ │ │
71 │ Internal │ Red │ Green │ Blue │ Alpha │ Luminance │ Intensity │
72 │Format │ │ │ │ │ │ │
73 │ │ │ │ │ │ │ │
74 ├─────────────────────────────────┼─────────────────────────────┼───────────────────────────────┼──────────────────────────────┼───────────────────────────────┼───────────────────────────────────┼───────────────────────────────────┤
75 │GL_ALPHA │ │ │ │ A │ │ │
76 ├─────────────────────────────────┼─────────────────────────────┼───────────────────────────────┼──────────────────────────────┼───────────────────────────────┼───────────────────────────────────┼───────────────────────────────────┤
77 │GL_LUMINANCE │ │ │ │ │ R │ │
78 ├─────────────────────────────────┼─────────────────────────────┼───────────────────────────────┼──────────────────────────────┼───────────────────────────────┼───────────────────────────────────┼───────────────────────────────────┤
79 │GL_LUMINANCE_ALPHA │ │ │ │ A │ R │ │
80 ├─────────────────────────────────┼─────────────────────────────┼───────────────────────────────┼──────────────────────────────┼───────────────────────────────┼───────────────────────────────────┼───────────────────────────────────┤
81 │GL_INTENSITY │ │ │ │ │ │ R │
82 ├─────────────────────────────────┼─────────────────────────────┼───────────────────────────────┼──────────────────────────────┼───────────────────────────────┼───────────────────────────────────┼───────────────────────────────────┤
83 │GL_RGB │ R │ G │ B │ │ │ │
84 ├─────────────────────────────────┼─────────────────────────────┼───────────────────────────────┼──────────────────────────────┼───────────────────────────────┼───────────────────────────────────┼───────────────────────────────────┤
85 │GL_RGBA │ R │ G │ B │ A │ │ │
86 └─────────────────────────────────┴─────────────────────────────┴───────────────────────────────┴──────────────────────────────┴───────────────────────────────┴───────────────────────────────────┴───────────────────────────────────┘
87
88 Finally, the red, green, blue, alpha, luminance, and/or intensity
89 components of the resulting pixels are stored in the color table. They
90 form a one-dimensional table with indices in the range 0 width - 1.
91
93 glCopyColorTable is available only if ARB_imaging is returned from
94 calling glGetString() with an argument of GL_EXTENSIONS.
95
97 GL_INVALID_ENUM is generated when target is not one of the allowable
98 values.
99
100 GL_INVALID_VALUE is generated if width is less than zero.
101
102 GL_INVALID_VALUE is generated if internalformat is not one of the
103 allowable values.
104
105 GL_TABLE_TOO_LARGE is generated if the requested color table is too
106 large to be supported by the implementation.
107
108 GL_INVALID_OPERATION is generated if glCopyColorTable is executed
109 between the execution of glBegin() and the corresponding execution of
110 glEnd().
111
113 glGetColorTable(), glGetColorTableParameter()
114
116 glColorTable(), glColorTableParameter(), glReadPixels()
117
119 Copyright © 1991-2006 Silicon Graphics, Inc. This document is licensed
120 under the SGI Free Software B License. For details, see
121 http://oss.sgi.com/projects/FreeB/.
122
124 opengl.org
125
126
127
128opengl.org 07/13/2018 GLCOPYCOLORTABLE(3G)