1GLPIXELMAP(3G) OpenGL Manual GLPIXELMAP(3G)
2
3
4
6 glPixelMap - set up pixel transfer maps
7
9 void glPixelMapfv(GLenum map, GLsizei mapsize, const GLfloat * values);
10
11 void glPixelMapuiv(GLenum map, GLsizei mapsize, const GLuint * values);
12
13 void glPixelMapusv(GLenum map, GLsizei mapsize,
14 const GLushort * values);
15
17 map
18 Specifies a symbolic map name. Must be one of the following:
19 GL_PIXEL_MAP_I_TO_I, GL_PIXEL_MAP_S_TO_S, GL_PIXEL_MAP_I_TO_R,
20 GL_PIXEL_MAP_I_TO_G, GL_PIXEL_MAP_I_TO_B, GL_PIXEL_MAP_I_TO_A,
21 GL_PIXEL_MAP_R_TO_R, GL_PIXEL_MAP_G_TO_G, GL_PIXEL_MAP_B_TO_B, or
22 GL_PIXEL_MAP_A_TO_A.
23
24 mapsize
25 Specifies the size of the map being defined.
26
27 values
28 Specifies an array of mapsize values.
29
31 glPixelMap sets up translation tables, or maps, used by glCopyPixels(),
32 glCopyTexImage1D(), glCopyTexImage2D(), glCopyTexSubImage1D(),
33 glCopyTexSubImage2D(), glCopyTexSubImage3D(), glDrawPixels(),
34 glReadPixels(), glTexImage1D(), glTexImage2D(), glTexImage3D(),
35 glTexSubImage1D(), glTexSubImage2D(), and glTexSubImage3D().
36 Additionally, if the ARB_imaging subset is supported, the routines
37 glColorTable(), glColorSubTable(), glConvolutionFilter1D(),
38 glConvolutionFilter2D(), glHistogram(), glMinmax(), and
39 glSeparableFilter2D(). Use of these maps is described completely in the
40 glPixelTransfer() reference page, and partly in the reference pages for
41 the pixel and texture image commands. Only the specification of the
42 maps is described in this reference page.
43
44 map is a symbolic map name, indicating one of ten maps to set. mapsize
45 specifies the number of entries in the map, and values is a pointer to
46 an array of mapsize map values.
47
48 If a non-zero named buffer object is bound to the
49 GL_PIXEL_UNPACK_BUFFER target (see glBindBuffer()) while a pixel
50 transfer map is specified, values is treated as a byte offset into the
51 buffer object's data store.
52
53 The ten maps are as follows:
54
55 GL_PIXEL_MAP_I_TO_I
56 Maps color indices to color indices.
57
58 GL_PIXEL_MAP_S_TO_S
59 Maps stencil indices to stencil indices.
60
61 GL_PIXEL_MAP_I_TO_R
62 Maps color indices to red components.
63
64 GL_PIXEL_MAP_I_TO_G
65 Maps color indices to green components.
66
67 GL_PIXEL_MAP_I_TO_B
68 Maps color indices to blue components.
69
70 GL_PIXEL_MAP_I_TO_A
71 Maps color indices to alpha components.
72
73 GL_PIXEL_MAP_R_TO_R
74 Maps red components to red components.
75
76 GL_PIXEL_MAP_G_TO_G
77 Maps green components to green components.
78
79 GL_PIXEL_MAP_B_TO_B
80 Maps blue components to blue components.
81
82 GL_PIXEL_MAP_A_TO_A
83 Maps alpha components to alpha components.
84
85 The entries in a map can be specified as single-precision
86 floating-point numbers, unsigned short integers, or unsigned int
87 integers. Maps that store color component values (all but
88 GL_PIXEL_MAP_I_TO_I and GL_PIXEL_MAP_S_TO_S) retain their values in
89 floating-point format, with unspecified mantissa and exponent sizes.
90 Floating-point values specified by glPixelMapfv are converted directly
91 to the internal floating-point format of these maps, then clamped to
92 the range [0,1]. Unsigned integer values specified by glPixelMapusv and
93 glPixelMapuiv are converted linearly such that the largest
94 representable integer maps to 1.0, and 0 maps to 0.0.
95
96 Maps that store indices, GL_PIXEL_MAP_I_TO_I and GL_PIXEL_MAP_S_TO_S,
97 retain their values in fixed-point format, with an unspecified number
98 of bits to the right of the binary point. Floating-point values
99 specified by glPixelMapfv are converted directly to the internal
100 fixed-point format of these maps. Unsigned integer values specified by
101 glPixelMapusv and glPixelMapuiv specify integer values, with all 0's to
102 the right of the binary point.
103
104 The following table shows the initial sizes and values for each of the
105 maps. Maps that are indexed by either color or stencil indices must
106 have mapsize = 2 n for some n or the results are undefined. The maximum
107 allowable size for each map depends on the implementation and can be
108 determined by calling glGet() with argument GL_MAX_PIXEL_MAP_TABLE. The
109 single maximum applies to all maps; it is at least 32.
110
111 ┌────────────────────────────┬────────────────────────────────┬────────────────────────────────┬─────────────────────────────────┬─────────────────────────────────┐
112 │ │ │ │ │ │
113 │ map │ Lookup │ Lookup │ Initial │ Initial │
114 │ │ Index │ Value │ Size │ Value │
115 │ │ │ │ │ │
116 ├────────────────────────────┼────────────────────────────────┼────────────────────────────────┼─────────────────────────────────┼─────────────────────────────────┤
117 │GL_PIXEL_MAP_I_TO_I │ color index │ color index │ 1 │ 0 │
118 ├────────────────────────────┼────────────────────────────────┼────────────────────────────────┼─────────────────────────────────┼─────────────────────────────────┤
119 │GL_PIXEL_MAP_S_TO_S │ stencil index │ stencil index │ 1 │ 0 │
120 ├────────────────────────────┼────────────────────────────────┼────────────────────────────────┼─────────────────────────────────┼─────────────────────────────────┤
121 │GL_PIXEL_MAP_I_TO_R │ color index │ R │ 1 │ 0 │
122 ├────────────────────────────┼────────────────────────────────┼────────────────────────────────┼─────────────────────────────────┼─────────────────────────────────┤
123 │GL_PIXEL_MAP_I_TO_G │ color index │ G │ 1 │ 0 │
124 ├────────────────────────────┼────────────────────────────────┼────────────────────────────────┼─────────────────────────────────┼─────────────────────────────────┤
125 │GL_PIXEL_MAP_I_TO_B │ color index │ B │ 1 │ 0 │
126 ├────────────────────────────┼────────────────────────────────┼────────────────────────────────┼─────────────────────────────────┼─────────────────────────────────┤
127 │GL_PIXEL_MAP_I_TO_A │ color index │ A │ 1 │ 0 │
128 ├────────────────────────────┼────────────────────────────────┼────────────────────────────────┼─────────────────────────────────┼─────────────────────────────────┤
129 │GL_PIXEL_MAP_R_TO_R │ R │ R │ 1 │ 0 │
130 ├────────────────────────────┼────────────────────────────────┼────────────────────────────────┼─────────────────────────────────┼─────────────────────────────────┤
131 │GL_PIXEL_MAP_G_TO_G │ G │ G │ 1 │ 0 │
132 ├────────────────────────────┼────────────────────────────────┼────────────────────────────────┼─────────────────────────────────┼─────────────────────────────────┤
133 │GL_PIXEL_MAP_B_TO_B │ B │ B │ 1 │ 0 │
134 ├────────────────────────────┼────────────────────────────────┼────────────────────────────────┼─────────────────────────────────┼─────────────────────────────────┤
135 │GL_PIXEL_MAP_A_TO_A │ A │ A │ 1 │ 0 │
136 └────────────────────────────┴────────────────────────────────┴────────────────────────────────┴─────────────────────────────────┴─────────────────────────────────┘
137
139 GL_INVALID_ENUM is generated if map is not an accepted value.
140
141 GL_INVALID_VALUE is generated if mapsize is less than one or larger
142 than GL_MAX_PIXEL_MAP_TABLE.
143
144 GL_INVALID_VALUE is generated if map is GL_PIXEL_MAP_I_TO_I,
145 GL_PIXEL_MAP_S_TO_S, GL_PIXEL_MAP_I_TO_R, GL_PIXEL_MAP_I_TO_G,
146 GL_PIXEL_MAP_I_TO_B, or GL_PIXEL_MAP_I_TO_A, and mapsize is not a power
147 of two.
148
149 GL_INVALID_OPERATION is generated if a non-zero buffer object name is
150 bound to the GL_PIXEL_UNPACK_BUFFER target and the buffer object's data
151 store is currently mapped.
152
153 GL_INVALID_OPERATION is generated if a non-zero buffer object name is
154 bound to the GL_PIXEL_UNPACK_BUFFER target and the data would be
155 unpacked from the buffer object such that the memory reads required
156 would exceed the data store size.
157
158 GL_INVALID_OPERATION is generated by glPixelMapfv if a non-zero buffer
159 object name is bound to the GL_PIXEL_UNPACK_BUFFER target and values is
160 not evenly divisible into the number of bytes needed to store in memory
161 a GLfloat datum.
162
163 GL_INVALID_OPERATION is generated by glPixelMapuiv if a non-zero buffer
164 object name is bound to the GL_PIXEL_UNPACK_BUFFER target and values is
165 not evenly divisible into the number of bytes needed to store in memory
166 a GLuint datum.
167
168 GL_INVALID_OPERATION is generated by glPixelMapusv if a non-zero buffer
169 object name is bound to the GL_PIXEL_UNPACK_BUFFER target and values is
170 not evenly divisible into the number of bytes needed to store in memory
171 a GLushort datum.
172
173 GL_INVALID_OPERATION is generated if glPixelMap is executed between the
174 execution of glBegin() and the corresponding execution of glEnd().
175
177 glGetPixelMap()
178
179 glGet() with argument GL_PIXEL_MAP_I_TO_I_SIZE
180
181 glGet() with argument GL_PIXEL_MAP_S_TO_S_SIZE
182
183 glGet() with argument GL_PIXEL_MAP_I_TO_R_SIZE
184
185 glGet() with argument GL_PIXEL_MAP_I_TO_G_SIZE
186
187 glGet() with argument GL_PIXEL_MAP_I_TO_B_SIZE
188
189 glGet() with argument GL_PIXEL_MAP_I_TO_A_SIZE
190
191 glGet() with argument GL_PIXEL_MAP_R_TO_R_SIZE
192
193 glGet() with argument GL_PIXEL_MAP_G_TO_G_SIZE
194
195 glGet() with argument GL_PIXEL_MAP_B_TO_B_SIZE
196
197 glGet() with argument GL_PIXEL_MAP_A_TO_A_SIZE
198
199 glGet() with argument GL_MAX_PIXEL_MAP_TABLE
200
201 glGet() with argument GL_PIXEL_UNPACK_BUFFER_BINDING
202
204 glColorTable(), glColorSubTable(), glConvolutionFilter1D(),
205 glConvolutionFilter2D(), glCopyPixels(), glCopyTexImage1D(),
206 glCopyTexImage2D(), glCopyTexSubImage1D(), glCopyTexSubImage2D(),
207 glDrawPixels(), glHistogram(), glMinmax(), glPixelStore(),
208 glPixelTransfer(), glReadPixels(), glSeparableFilter2D(),
209 glTexImage1D(), glTexImage2D(), glTexImage3D(), glTexSubImage1D(),
210 glTexSubImage2D(), glTexSubImage3D()
211
213 Copyright © 1991-2006 Silicon Graphics, Inc. This document is licensed
214 under the SGI Free Software B License. For details, see
215 http://oss.sgi.com/projects/FreeB/.
216
218 opengl.org
219
220
221
222opengl.org 06/10/2014 GLPIXELMAP(3G)