rename upstream-man-pages to upstream-doc
[clinton/guile-figl.git] / upstream-doc / man2 / glPixelMap.xml
CommitLineData
7faf1d71
AW
1<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
3 "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
4<refentry id="glPixelMap">
5 <refmeta>
6 <refmetainfo>
7 <copyright>
8 <year>1991-2006</year>
9 <holder>Silicon Graphics, Inc.</holder>
10 </copyright>
11 </refmetainfo>
12 <refentrytitle>glPixelMap</refentrytitle>
13 <manvolnum>3G</manvolnum>
14 </refmeta>
15 <refnamediv>
16 <refname>glPixelMap</refname>
17 <refpurpose>set up pixel transfer maps</refpurpose>
18 </refnamediv>
19 <refsynopsisdiv><title>C Specification</title>
20 <funcsynopsis>
21 <funcprototype>
22 <funcdef>void <function>glPixelMapfv</function></funcdef>
23 <paramdef>GLenum <parameter>map</parameter></paramdef>
24 <paramdef>GLsizei <parameter>mapsize</parameter></paramdef>
25 <paramdef>const GLfloat * <parameter>values</parameter></paramdef>
26 </funcprototype>
27 </funcsynopsis>
28 <funcsynopsis>
29 <funcprototype>
30 <funcdef>void <function>glPixelMapuiv</function></funcdef>
31 <paramdef>GLenum <parameter>map</parameter></paramdef>
32 <paramdef>GLsizei <parameter>mapsize</parameter></paramdef>
33 <paramdef>const GLuint * <parameter>values</parameter></paramdef>
34 </funcprototype>
35 </funcsynopsis>
36 <funcsynopsis>
37 <funcprototype>
38 <funcdef>void <function>glPixelMapusv</function></funcdef>
39 <paramdef>GLenum <parameter>map</parameter></paramdef>
40 <paramdef>GLsizei <parameter>mapsize</parameter></paramdef>
41 <paramdef>const GLushort * <parameter>values</parameter></paramdef>
42 </funcprototype>
43 </funcsynopsis>
44 </refsynopsisdiv>
45 <!-- eqn: ignoring delim $$ -->
46 <refsect1 id="parameters"><title>Parameters</title>
47 <variablelist>
48 <varlistentry>
49 <term><parameter>map</parameter></term>
50 <listitem>
51 <para>
52 Specifies a symbolic map name.
53 Must be one of the following:
54 <constant>GL_PIXEL_MAP_I_TO_I</constant>,
55 <constant>GL_PIXEL_MAP_S_TO_S</constant>,
56 <constant>GL_PIXEL_MAP_I_TO_R</constant>,
57 <constant>GL_PIXEL_MAP_I_TO_G</constant>,
58 <constant>GL_PIXEL_MAP_I_TO_B</constant>,
59 <constant>GL_PIXEL_MAP_I_TO_A</constant>,
60 <constant>GL_PIXEL_MAP_R_TO_R</constant>,
61 <constant>GL_PIXEL_MAP_G_TO_G</constant>,
62 <constant>GL_PIXEL_MAP_B_TO_B</constant>, or
63 <constant>GL_PIXEL_MAP_A_TO_A</constant>.
64 </para>
65 </listitem>
66 </varlistentry>
67 <varlistentry>
68 <term><parameter>mapsize</parameter></term>
69 <listitem>
70 <para>
71 Specifies the size of the map being defined.
72 </para>
73 </listitem>
74 </varlistentry>
75 <varlistentry>
76 <term><parameter>values</parameter></term>
77 <listitem>
78 <para>
79 Specifies an array of <parameter>mapsize</parameter> values.
80 </para>
81 </listitem>
82 </varlistentry>
83 </variablelist>
84 </refsect1>
85 <refsect1 id="description"><title>Description</title>
86 <para>
87 <function>glPixelMap</function> sets up translation tables,
88 or <emphasis>maps</emphasis>,
89 used by
90 <citerefentry><refentrytitle>glCopyPixels</refentrytitle></citerefentry>,
91 <citerefentry><refentrytitle>glCopyTexImage1D</refentrytitle></citerefentry>,
92 <citerefentry><refentrytitle>glCopyTexImage2D</refentrytitle></citerefentry>,
93 <citerefentry><refentrytitle>glCopyTexSubImage1D</refentrytitle></citerefentry>,
94 <citerefentry><refentrytitle>glCopyTexSubImage2D</refentrytitle></citerefentry>,
95 <citerefentry><refentrytitle>glCopyTexSubImage3D</refentrytitle></citerefentry>,
96 <citerefentry><refentrytitle>glDrawPixels</refentrytitle></citerefentry>,
97 <citerefentry><refentrytitle>glReadPixels</refentrytitle></citerefentry>,
98 <citerefentry><refentrytitle>glTexImage1D</refentrytitle></citerefentry>,
99 <citerefentry><refentrytitle>glTexImage2D</refentrytitle></citerefentry>,
100 <citerefentry><refentrytitle>glTexImage3D</refentrytitle></citerefentry>,
101 <citerefentry><refentrytitle>glTexSubImage1D</refentrytitle></citerefentry>,
102 <citerefentry><refentrytitle>glTexSubImage2D</refentrytitle></citerefentry>, and
103 <citerefentry><refentrytitle>glTexSubImage3D</refentrytitle></citerefentry>.
104 Additionally, if the <code>ARB_imaging</code> subset is supported, the
105 routines
106 <citerefentry><refentrytitle>glColorTable</refentrytitle></citerefentry>,
107 <citerefentry><refentrytitle>glColorSubTable</refentrytitle></citerefentry>,
108 <citerefentry><refentrytitle>glConvolutionFilter1D</refentrytitle></citerefentry>,
109 <citerefentry><refentrytitle>glConvolutionFilter2D</refentrytitle></citerefentry>,
110 <citerefentry><refentrytitle>glHistogram</refentrytitle></citerefentry>,
111 <citerefentry><refentrytitle>glMinmax</refentrytitle></citerefentry>, and
112 <citerefentry><refentrytitle>glSeparableFilter2D</refentrytitle></citerefentry>.
113 Use of these maps is described completely in the
114 <citerefentry><refentrytitle>glPixelTransfer</refentrytitle></citerefentry> reference page,
115 and partly in the reference pages for the pixel and texture image commands.
116 Only the specification of the maps is described in this reference page.
117 </para>
118 <para>
119 <parameter>map</parameter> is a symbolic map name,
120 indicating one of ten maps to set.
121 <parameter>mapsize</parameter> specifies the number of entries in the map,
122 and <parameter>values</parameter> is a pointer to an array of <parameter>mapsize</parameter> map values.
123 </para>
124 <para>
125 If a non-zero named buffer object is bound to the <constant>GL_PIXEL_UNPACK_BUFFER</constant> target
126 (see <citerefentry><refentrytitle>glBindBuffer</refentrytitle></citerefentry>) while a pixel transfer map is
127 specified, <parameter>values</parameter> is treated as a byte offset into the buffer object's data store.
128 </para>
129 <para>
130 The ten maps are as follows:
131 </para>
132 <variablelist>
133 <varlistentry>
134 <term><constant>GL_PIXEL_MAP_I_TO_I</constant></term>
135 <listitem>
136 <para>
137 Maps color indices to color indices.
138 </para>
139 </listitem>
140 </varlistentry>
141 <varlistentry>
142 <term><constant>GL_PIXEL_MAP_S_TO_S</constant></term>
143 <listitem>
144 <para>
145 Maps stencil indices to stencil indices.
146 </para>
147 </listitem>
148 </varlistentry>
149 <varlistentry>
150 <term><constant>GL_PIXEL_MAP_I_TO_R</constant></term>
151 <listitem>
152 <para>
153 Maps color indices to red components.
154 </para>
155 </listitem>
156 </varlistentry>
157 <varlistentry>
158 <term><constant>GL_PIXEL_MAP_I_TO_G</constant></term>
159 <listitem>
160 <para>
161 Maps color indices to green components.
162 </para>
163 </listitem>
164 </varlistentry>
165 <varlistentry>
166 <term><constant>GL_PIXEL_MAP_I_TO_B</constant></term>
167 <listitem>
168 <para>
169 Maps color indices to blue components.
170 </para>
171 </listitem>
172 </varlistentry>
173 <varlistentry>
174 <term><constant>GL_PIXEL_MAP_I_TO_A</constant></term>
175 <listitem>
176 <para>
177 Maps color indices to alpha components.
178 </para>
179 </listitem>
180 </varlistentry>
181 <varlistentry>
182 <term><constant>GL_PIXEL_MAP_R_TO_R</constant></term>
183 <listitem>
184 <para>
185 Maps red components to red components.
186 </para>
187 </listitem>
188 </varlistentry>
189 <varlistentry>
190 <term><constant>GL_PIXEL_MAP_G_TO_G</constant></term>
191 <listitem>
192 <para>
193 Maps green components to green components.
194 </para>
195 </listitem>
196 </varlistentry>
197 <varlistentry>
198 <term><constant>GL_PIXEL_MAP_B_TO_B</constant></term>
199 <listitem>
200 <para>
201 Maps blue components to blue components.
202 </para>
203 </listitem>
204 </varlistentry>
205 <varlistentry>
206 <term><constant>GL_PIXEL_MAP_A_TO_A</constant></term>
207 <listitem>
208 <para>
209 Maps alpha components to alpha components.
210 </para>
211 </listitem>
212 </varlistentry>
213 </variablelist>
214 <para>
215 The entries in a map can be specified as single-precision
216 floating-point numbers,
217 unsigned short integers,
218 or unsigned int integers.
219 Maps that store color component values
220 (all but <constant>GL_PIXEL_MAP_I_TO_I</constant> and <constant>GL_PIXEL_MAP_S_TO_S</constant>)
221 retain their values in floating-point format,
222 with unspecified mantissa and exponent sizes.
223 Floating-point values specified by <function>glPixelMapfv</function> are converted directly
224 to the internal floating-point format of these maps,
225 then clamped to the range [0,1].
226 Unsigned integer values specified by <function>glPixelMapusv</function> and
227 <function>glPixelMapuiv</function> are converted linearly such that
228 the largest representable integer maps to 1.0,
229 and 0 maps to 0.0.
230 </para>
231 <para>
232 Maps that store indices,
233 <constant>GL_PIXEL_MAP_I_TO_I</constant> and <constant>GL_PIXEL_MAP_S_TO_S</constant>,
234 retain their values in fixed-point format,
235 with an unspecified number of bits to the right of the binary point.
236 Floating-point values specified by <function>glPixelMapfv</function> are converted directly
237 to the internal fixed-point format of these maps.
238 Unsigned integer values specified by <function>glPixelMapusv</function> and
239 <function>glPixelMapuiv</function> specify integer values,
240 with all 0's to the right of the binary point.
241 </para>
242 <para>
243 The following table shows the initial sizes and values for each of the maps.
244 Maps that are indexed by either color or stencil indices must have
245 <parameter>mapsize</parameter> =
246 <inlineequation><mml:math>
247 <!-- eqn: 2 sup n:-->
248 <mml:msup><mml:mn>2</mml:mn>
249 <mml:mi mathvariant="italic">n</mml:mi>
250 </mml:msup>
251 </mml:math></inlineequation>
252 for some
253 <inlineequation><mml:math><mml:mi mathvariant="italic">n</mml:mi></mml:math></inlineequation>
254 or the results are undefined.
255 The maximum allowable size for each map depends on the implementation
256 and can be determined by calling <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument
257 <constant>GL_MAX_PIXEL_MAP_TABLE</constant>.
258 The single maximum applies to all maps; it is at
259 least 32.
260 </para>
261 <informaltable frame="topbot">
262 <tgroup cols="5" align="left">
263 <colspec colwidth="4*" />
264 <colspec colwidth="2*" align="center"/>
265 <colspec colwidth="2*" align="center"/>
266 <colspec colwidth="1*" align="center"/>
267 <colspec colwidth="1*" align="center"/>
268 <thead>
269 <row>
270 <entry rowsep="1" align="left"><emphasis role="bold">
271 <parameter>map</parameter>
272 </emphasis></entry>
273 <entry rowsep="1" align="center"><emphasis role="bold">
274 Lookup Index
275 </emphasis></entry>
276 <entry rowsep="1" align="center"><emphasis role="bold">
277 Lookup Value
278 </emphasis></entry>
279 <entry rowsep="1" align="center"><emphasis role="bold">
280 Initial Size
281 </emphasis></entry>
282 <entry rowsep="1" align="center"><emphasis role="bold">
283 Initial Value
284 </emphasis></entry>
285 </row>
286 </thead>
287 <tbody>
288 <row>
289 <entry align="left">
290 <constant>GL_PIXEL_MAP_I_TO_I</constant>
291 </entry>
292 <entry align="center">
293 color index
294 </entry>
295 <entry align="center">
296 color index
297 </entry>
298 <entry align="center">
299 1
300 </entry>
301 <entry align="center">
302 0
303 </entry>
304 </row>
305 <row>
306 <entry align="left">
307 <constant>GL_PIXEL_MAP_S_TO_S</constant>
308 </entry>
309 <entry align="center">
310 stencil index
311 </entry>
312 <entry align="center">
313 stencil index
314 </entry>
315 <entry align="center">
316 1
317 </entry>
318 <entry align="center">
319 0
320 </entry>
321 </row>
322 <row>
323 <entry align="left">
324 <constant>GL_PIXEL_MAP_I_TO_R</constant>
325 </entry>
326 <entry align="center">
327 color index
328 </entry>
329 <entry align="center">
330 R
331 </entry>
332 <entry align="center">
333 1
334 </entry>
335 <entry align="center">
336 0
337 </entry>
338 </row>
339 <row>
340 <entry align="left">
341 <constant>GL_PIXEL_MAP_I_TO_G</constant>
342 </entry>
343 <entry align="center">
344 color index
345 </entry>
346 <entry align="center">
347 G
348 </entry>
349 <entry align="center">
350 1
351 </entry>
352 <entry align="center">
353 0
354 </entry>
355 </row>
356 <row>
357 <entry align="left">
358 <constant>GL_PIXEL_MAP_I_TO_B</constant>
359 </entry>
360 <entry align="center">
361 color index
362 </entry>
363 <entry align="center">
364 B
365 </entry>
366 <entry align="center">
367 1
368 </entry>
369 <entry align="center">
370 0
371 </entry>
372 </row>
373 <row>
374 <entry align="left">
375 <constant>GL_PIXEL_MAP_I_TO_A</constant>
376 </entry>
377 <entry align="center">
378 color index
379 </entry>
380 <entry align="center">
381 A
382 </entry>
383 <entry align="center">
384 1
385 </entry>
386 <entry align="center">
387 0
388 </entry>
389 </row>
390 <row>
391 <entry align="left">
392 <constant>GL_PIXEL_MAP_R_TO_R</constant>
393 </entry>
394 <entry align="center">
395 R
396 </entry>
397 <entry align="center">
398 R
399 </entry>
400 <entry align="center">
401 1
402 </entry>
403 <entry align="center">
404 0
405 </entry>
406 </row>
407 <row>
408 <entry align="left">
409 <constant>GL_PIXEL_MAP_G_TO_G</constant>
410 </entry>
411 <entry align="center">
412 G
413 </entry>
414 <entry align="center">
415 G
416 </entry>
417 <entry align="center">
418 1
419 </entry>
420 <entry align="center">
421 0
422 </entry>
423 </row>
424 <row>
425 <entry align="left">
426 <constant>GL_PIXEL_MAP_B_TO_B</constant>
427 </entry>
428 <entry align="center">
429 B
430 </entry>
431 <entry align="center">
432 B
433 </entry>
434 <entry align="center">
435 1
436 </entry>
437 <entry align="center">
438 0
439 </entry>
440 </row>
441 <row>
442 <entry align="left">
443 <constant>GL_PIXEL_MAP_A_TO_A</constant>
444 </entry>
445 <entry align="center">
446 A
447 </entry>
448 <entry align="center">
449 A
450 </entry>
451 <entry align="center">
452 1
453 </entry>
454 <entry align="center">
455 0
456 </entry>
457 </row>
458 </tbody>
459 </tgroup>
460 </informaltable>
461 </refsect1>
462 <refsect1 id="errors"><title>Errors</title>
463 <para>
464 <constant>GL_INVALID_ENUM</constant> is generated if <parameter>map</parameter> is not an accepted value.
465 </para>
466 <para>
467 <constant>GL_INVALID_VALUE</constant> is generated if <parameter>mapsize</parameter> is less than one
468 or larger than <constant>GL_MAX_PIXEL_MAP_TABLE</constant>.
469 </para>
470 <para>
471 <constant>GL_INVALID_VALUE</constant> is generated if <parameter>map</parameter> is
472 <constant>GL_PIXEL_MAP_I_TO_I</constant>,
473 <constant>GL_PIXEL_MAP_S_TO_S</constant>,
474 <constant>GL_PIXEL_MAP_I_TO_R</constant>,
475 <constant>GL_PIXEL_MAP_I_TO_G</constant>,
476 <constant>GL_PIXEL_MAP_I_TO_B</constant>, or
477 <constant>GL_PIXEL_MAP_I_TO_A</constant>,
478 and <parameter>mapsize</parameter> is not a power of two.
479 </para>
480 <para>
481 <constant>GL_INVALID_OPERATION</constant> is generated if a non-zero buffer object name is bound to the
482 <constant>GL_PIXEL_UNPACK_BUFFER</constant> target and the buffer object's data store is currently mapped.
483 </para>
484 <para>
485 <constant>GL_INVALID_OPERATION</constant> is generated if a non-zero buffer object name is bound to the
486 <constant>GL_PIXEL_UNPACK_BUFFER</constant> target and the data would be unpacked from the buffer
487 object such that the memory reads required would exceed the data store size.
488 </para>
489 <para>
490 <constant>GL_INVALID_OPERATION</constant> is generated by <function>glPixelMapfv</function> if a non-zero buffer object name is bound to the
491 <constant>GL_PIXEL_UNPACK_BUFFER</constant> target and <parameter>values</parameter> is not evenly divisible
492 into the number of bytes needed to store in memory a GLfloat datum.
493 </para>
494 <para>
495 <constant>GL_INVALID_OPERATION</constant> is generated by <function>glPixelMapuiv</function> if a non-zero buffer object name is bound to the
496 <constant>GL_PIXEL_UNPACK_BUFFER</constant> target and <parameter>values</parameter> is not evenly divisible
497 into the number of bytes needed to store in memory a GLuint datum.
498 </para>
499 <para>
500 <constant>GL_INVALID_OPERATION</constant> is generated by <function>glPixelMapusv</function> if a non-zero buffer object name is bound to the
501 <constant>GL_PIXEL_UNPACK_BUFFER</constant> target and <parameter>values</parameter> is not evenly divisible
502 into the number of bytes needed to store in memory a GLushort datum.
503 </para>
504 <para>
505 <constant>GL_INVALID_OPERATION</constant> is generated if <function>glPixelMap</function>
506 is executed between the execution of <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry>
507 and the corresponding execution of <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.
508 </para>
509 </refsect1>
510 <refsect1 id="associatedgets"><title>Associated Gets</title>
511 <para>
512 <citerefentry><refentrytitle>glGetPixelMap</refentrytitle></citerefentry>
513 </para>
514 <para>
515 <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_PIXEL_MAP_I_TO_I_SIZE</constant>
516 </para>
517 <para>
518 <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_PIXEL_MAP_S_TO_S_SIZE</constant>
519 </para>
520 <para>
521 <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_PIXEL_MAP_I_TO_R_SIZE</constant>
522 </para>
523 <para>
524 <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_PIXEL_MAP_I_TO_G_SIZE</constant>
525 </para>
526 <para>
527 <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_PIXEL_MAP_I_TO_B_SIZE</constant>
528 </para>
529 <para>
530 <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_PIXEL_MAP_I_TO_A_SIZE</constant>
531 </para>
532 <para>
533 <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_PIXEL_MAP_R_TO_R_SIZE</constant>
534 </para>
535 <para>
536 <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_PIXEL_MAP_G_TO_G_SIZE</constant>
537 </para>
538 <para>
539 <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_PIXEL_MAP_B_TO_B_SIZE</constant>
540 </para>
541 <para>
542 <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_PIXEL_MAP_A_TO_A_SIZE</constant>
543 </para>
544 <para>
545 <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_MAX_PIXEL_MAP_TABLE</constant>
546 </para>
547 <para>
548 <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_PIXEL_UNPACK_BUFFER_BINDING</constant>
549 </para>
550 </refsect1>
551 <refsect1 id="seealso"><title>See Also</title>
552 <para>
553 <citerefentry><refentrytitle>glColorTable</refentrytitle></citerefentry>,
554 <citerefentry><refentrytitle>glColorSubTable</refentrytitle></citerefentry>,
555 <citerefentry><refentrytitle>glConvolutionFilter1D</refentrytitle></citerefentry>,
556 <citerefentry><refentrytitle>glConvolutionFilter2D</refentrytitle></citerefentry>,
557 <citerefentry><refentrytitle>glCopyPixels</refentrytitle></citerefentry>,
558 <citerefentry><refentrytitle>glCopyTexImage1D</refentrytitle></citerefentry>,
559 <citerefentry><refentrytitle>glCopyTexImage2D</refentrytitle></citerefentry>,
560 <citerefentry><refentrytitle>glCopyTexSubImage1D</refentrytitle></citerefentry>,
561 <citerefentry><refentrytitle>glCopyTexSubImage2D</refentrytitle></citerefentry>,
562 <citerefentry><refentrytitle>glDrawPixels</refentrytitle></citerefentry>,
563 <citerefentry><refentrytitle>glHistogram</refentrytitle></citerefentry>,
564 <citerefentry><refentrytitle>glMinmax</refentrytitle></citerefentry>,
565 <citerefentry><refentrytitle>glPixelStore</refentrytitle></citerefentry>,
566 <citerefentry><refentrytitle>glPixelTransfer</refentrytitle></citerefentry>,
567 <citerefentry><refentrytitle>glReadPixels</refentrytitle></citerefentry>,
568 <citerefentry><refentrytitle>glSeparableFilter2D</refentrytitle></citerefentry>,
569 <citerefentry><refentrytitle>glTexImage1D</refentrytitle></citerefentry>,
570 <citerefentry><refentrytitle>glTexImage2D</refentrytitle></citerefentry>,
571 <citerefentry><refentrytitle>glTexImage3D</refentrytitle></citerefentry>,
572 <citerefentry><refentrytitle>glTexSubImage1D</refentrytitle></citerefentry>,
573 <citerefentry><refentrytitle>glTexSubImage2D</refentrytitle></citerefentry>,
574 <citerefentry><refentrytitle>glTexSubImage3D</refentrytitle></citerefentry>
575 </para>
576 </refsect1>
577 <refsect1 id="Copyright"><title>Copyright</title>
578 <para>
579 Copyright <trademark class="copyright"></trademark> 1991-2006
580 Silicon Graphics, Inc. This document is licensed under the SGI
581 Free Software B License. For details, see
582 <ulink url="http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/</ulink>.
583 </para>
584 </refsect1>
585</refentry>