rename upstream-man-pages to upstream-doc
[clinton/guile-figl.git] / upstream-doc / man2 / glColorTable.xml
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="glColorTable">
5 <refmeta>
6 <refmetainfo>
7 <copyright>
8 <year>1991-2006</year>
9 <holder>Silicon Graphics, Inc.</holder>
10 </copyright>
11 </refmetainfo>
12 <refentrytitle>glColorTable</refentrytitle>
13 <manvolnum>3G</manvolnum>
14 </refmeta>
15 <refnamediv>
16 <refname>glColorTable</refname>
17 <refpurpose>define a color lookup table</refpurpose>
18 </refnamediv>
19 <refsynopsisdiv><title>C Specification</title>
20 <funcsynopsis>
21 <funcprototype>
22 <funcdef>void <function>glColorTable</function></funcdef>
23 <paramdef>GLenum <parameter>target</parameter></paramdef>
24 <paramdef>GLenum <parameter>internalformat</parameter></paramdef>
25 <paramdef>GLsizei <parameter>width</parameter></paramdef>
26 <paramdef>GLenum <parameter>format</parameter></paramdef>
27 <paramdef>GLenum <parameter>type</parameter></paramdef>
28 <paramdef>const GLvoid * <parameter>data</parameter></paramdef>
29 </funcprototype>
30 </funcsynopsis>
31 </refsynopsisdiv>
32 <refsect1 id="parameters"><title>Parameters</title>
33 <variablelist>
34 <varlistentry>
35 <term><parameter>target</parameter></term>
36 <listitem>
37 <para>
38 Must be one of
39 <constant>GL_COLOR_TABLE</constant>,
40 <constant>GL_POST_CONVOLUTION_COLOR_TABLE</constant>,
41 <constant>GL_POST_COLOR_MATRIX_COLOR_TABLE</constant>,
42 <constant>GL_PROXY_COLOR_TABLE</constant>,
43 <constant>GL_PROXY_POST_CONVOLUTION_COLOR_TABLE</constant>,
44 or
45 <constant>GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE</constant>.
46 </para>
47 </listitem>
48 </varlistentry>
49 <varlistentry>
50 <term><parameter>internalformat</parameter></term>
51 <listitem>
52 <para>
53 The internal format of the color table.
54 The allowable values are
55 <constant>GL_ALPHA</constant>,
56 <constant>GL_ALPHA4</constant>,
57 <constant>GL_ALPHA8</constant>,
58 <constant>GL_ALPHA12</constant>,
59 <constant>GL_ALPHA16</constant>,
60 <constant>GL_LUMINANCE</constant>,
61 <constant>GL_LUMINANCE4</constant>,
62 <constant>GL_LUMINANCE8</constant>,
63 <constant>GL_LUMINANCE12</constant>,
64 <constant>GL_LUMINANCE16</constant>,
65 <constant>GL_LUMINANCE_ALPHA</constant>,
66 <constant>GL_LUMINANCE4_ALPHA4</constant>,
67 <constant>GL_LUMINANCE6_ALPHA2</constant>,
68 <constant>GL_LUMINANCE8_ALPHA8</constant>,
69 <constant>GL_LUMINANCE12_ALPHA4</constant>,
70 <constant>GL_LUMINANCE12_ALPHA12</constant>,
71 <constant>GL_LUMINANCE16_ALPHA16</constant>,
72 <constant>GL_INTENSITY</constant>,
73 <constant>GL_INTENSITY4</constant>,
74 <constant>GL_INTENSITY8</constant>,
75 <constant>GL_INTENSITY12</constant>,
76 <constant>GL_INTENSITY16</constant>,
77 <constant>GL_R3_G3_B2</constant>,
78 <constant>GL_RGB</constant>,
79 <constant>GL_RGB4</constant>,
80 <constant>GL_RGB5</constant>,
81 <constant>GL_RGB8</constant>,
82 <constant>GL_RGB10</constant>,
83 <constant>GL_RGB12</constant>,
84 <constant>GL_RGB16</constant>,
85 <constant>GL_RGBA</constant>,
86 <constant>GL_RGBA2</constant>,
87 <constant>GL_RGBA4</constant>,
88 <constant>GL_RGB5_A1</constant>,
89 <constant>GL_RGBA8</constant>,
90 <constant>GL_RGB10_A2</constant>,
91 <constant>GL_RGBA12</constant>, and
92 <constant>GL_RGBA16</constant>.
93 </para>
94 </listitem>
95 </varlistentry>
96 <varlistentry>
97 <term><parameter>width</parameter></term>
98 <listitem>
99 <para>
100 The number of entries in the color lookup table specified by <parameter>data</parameter>.
101 </para>
102 </listitem>
103 </varlistentry>
104 <varlistentry>
105 <term><parameter>format</parameter></term>
106 <listitem>
107 <para>
108 The format of the pixel data in <parameter>data</parameter>.
109 The allowable values are
110 <constant>GL_RED</constant>,
111 <constant>GL_GREEN</constant>,
112 <constant>GL_BLUE</constant>,
113 <constant>GL_ALPHA</constant>,
114 <constant>GL_LUMINANCE</constant>,
115 <constant>GL_LUMINANCE_ALPHA</constant>,
116 <constant>GL_RGB</constant>,
117 <constant>GL_BGR</constant>,
118 <constant>GL_RGBA</constant>, and
119 <constant>GL_BGRA</constant>.
120 </para>
121 </listitem>
122 </varlistentry>
123 <varlistentry>
124 <term><parameter>type</parameter></term>
125 <listitem>
126 <para>
127 The type of the pixel data in <parameter>data</parameter>.
128 The allowable values are
129 <constant>GL_UNSIGNED_BYTE</constant>,
130 <constant>GL_BYTE</constant>,
131 <constant>GL_UNSIGNED_SHORT</constant>,
132 <constant>GL_SHORT</constant>,
133 <constant>GL_UNSIGNED_INT</constant>,
134 <constant>GL_INT</constant>,
135 <constant>GL_FLOAT</constant>,
136 <constant>GL_UNSIGNED_BYTE_3_3_2</constant>,
137 <constant>GL_UNSIGNED_BYTE_2_3_3_REV</constant>,
138 <constant>GL_UNSIGNED_SHORT_5_6_5</constant>,
139 <constant>GL_UNSIGNED_SHORT_5_6_5_REV</constant>,
140 <constant>GL_UNSIGNED_SHORT_4_4_4_4</constant>,
141 <constant>GL_UNSIGNED_SHORT_4_4_4_4_REV</constant>,
142 <constant>GL_UNSIGNED_SHORT_5_5_5_1</constant>,
143 <constant>GL_UNSIGNED_SHORT_1_5_5_5_REV</constant>,
144 <constant>GL_UNSIGNED_INT_8_8_8_8</constant>,
145 <constant>GL_UNSIGNED_INT_8_8_8_8_REV</constant>,
146 <constant>GL_UNSIGNED_INT_10_10_10_2</constant>, and
147 <constant>GL_UNSIGNED_INT_2_10_10_10_REV</constant>.
148 </para>
149 </listitem>
150 </varlistentry>
151 <varlistentry>
152 <term><parameter>data</parameter></term>
153 <listitem>
154 <para>
155 Pointer to a one-dimensional array of pixel data that is processed to
156 build the color table.
157 </para>
158 </listitem>
159 </varlistentry>
160 </variablelist>
161 </refsect1>
162 <refsect1 id="description"><title>Description</title>
163 <para>
164 <function>glColorTable</function> may be used in two ways:
165 to test the actual size and color resolution of a lookup table
166 given a particular set of parameters,
167 or to load the contents of a color lookup
168 table.
169 Use the targets <constant>GL_PROXY_*</constant> for the first case
170 and the other targets for the second case.
171 </para>
172 <para>
173 If a non-zero named buffer object is bound to the <constant>GL_PIXEL_UNPACK_BUFFER</constant> target
174 (see <citerefentry><refentrytitle>glBindBuffer</refentrytitle></citerefentry>) while a color table is
175 specified, <parameter>data</parameter> is treated as a byte offset into the buffer object's data store.
176 </para>
177 <para>
178 If <parameter>target</parameter> is <constant>GL_COLOR_TABLE</constant>,
179 <constant>GL_POST_CONVOLUTION_COLOR_TABLE</constant>,
180 or
181 <constant>GL_POST_COLOR_MATRIX_COLOR_TABLE</constant>,
182 <function>glColorTable</function> builds a color lookup table from an array of pixels.
183 The pixel array specified by <parameter>width</parameter>, <parameter>format</parameter>, <parameter>type</parameter>, and <parameter>data</parameter>
184 is extracted from memory and
185 processed just as if <citerefentry><refentrytitle>glDrawPixels</refentrytitle></citerefentry> were called, but processing
186 stops after the final expansion to RGBA is completed.
187 </para>
188 <para>
189 The four scale parameters and the four bias parameters that are defined
190 for the table are then used to scale and bias the R, G, B, and A components
191 of each pixel.
192 (Use <function>glColorTableParameter</function> to set these scale and bias
193 parameters.)
194 </para>
195 <para>
196 Next, the R, G, B, and A values are clamped to the range
197 <inlineequation><mml:math>
198 <!-- eqn: [0,1]:-->
199 <mml:mfenced open="[" close="]">
200 <mml:mn>0</mml:mn>
201 <mml:mn>1</mml:mn>
202 </mml:mfenced>
203 </mml:math></inlineequation>.
204 Each pixel is then converted to the internal format specified by
205 <parameter>internalformat</parameter>.
206 This conversion simply maps the component values of the pixel (R, G, B,
207 and A) to the values included in the internal format (red, green, blue,
208 alpha, luminance, and intensity). The mapping is as follows:
209 </para>
210 <para>
211 </para>
212 <informaltable frame="topbot">
213 <tgroup cols="7" align="left">
214 <colspec colwidth="3*" />
215 <colspec colwidth="1*" align="center"/>
216 <colspec colwidth="1*" align="center"/>
217 <colspec colwidth="1*" align="center"/>
218 <colspec colwidth="1*" align="center"/>
219 <colspec colwidth="1.5*" align="center"/>
220 <colspec colwidth="1.5*" align="center"/>
221 <thead>
222 <row>
223 <entry rowsep="1" align="left"><emphasis role="bold">
224 Internal Format
225 </emphasis></entry>
226 <entry rowsep="1" align="center"><emphasis role="bold">
227 Red
228 </emphasis></entry>
229 <entry rowsep="1" align="center"><emphasis role="bold">
230 Green
231 </emphasis></entry>
232 <entry rowsep="1" align="center"><emphasis role="bold">
233 Blue
234 </emphasis></entry>
235 <entry rowsep="1" align="center"><emphasis role="bold">
236 Alpha
237 </emphasis></entry>
238 <entry rowsep="1" align="center"><emphasis role="bold">
239 Luminance
240 </emphasis></entry>
241 <entry rowsep="1" align="center"><emphasis role="bold">
242 Intensity
243 </emphasis></entry>
244 </row>
245 </thead>
246 <tbody>
247 <row>
248 <entry align="left">
249 <constant>GL_ALPHA</constant>
250 </entry>
251 <entry align="center">
252 </entry>
253 <entry align="center">
254 </entry>
255 <entry align="center">
256 </entry>
257 <entry align="center">
258 A
259 </entry>
260 <entry align="center">
261 </entry>
262 <entry align="center">
263
264 </entry>
265 </row>
266 <row>
267 <entry align="left">
268 <constant>GL_LUMINANCE</constant>
269 </entry>
270 <entry align="center">
271 </entry>
272 <entry align="center">
273 </entry>
274 <entry align="center">
275 </entry>
276 <entry align="center">
277 </entry>
278 <entry align="center">
279 R
280 </entry>
281 <entry align="center">
282
283 </entry>
284 </row>
285 <row>
286 <entry align="left">
287 <constant>GL_LUMINANCE_ALPHA</constant>
288 </entry>
289 <entry align="center">
290 </entry>
291 <entry align="center">
292 </entry>
293 <entry align="center">
294 </entry>
295 <entry align="center">
296 A
297 </entry>
298 <entry align="center">
299 R
300 </entry>
301 <entry align="center">
302
303 </entry>
304 </row>
305 <row>
306 <entry align="left">
307 <constant>GL_INTENSITY</constant>
308 </entry>
309 <entry align="center">
310 </entry>
311 <entry align="center">
312 </entry>
313 <entry align="center">
314 </entry>
315 <entry align="center">
316 </entry>
317 <entry align="center">
318 </entry>
319 <entry align="center">
320 R
321 </entry>
322 </row>
323 <row>
324 <entry align="left">
325 <constant>GL_RGB</constant>
326 </entry>
327 <entry align="center">
328 R
329 </entry>
330 <entry align="center">
331 G
332 </entry>
333 <entry align="center">
334 B
335 </entry>
336 <entry align="center">
337 </entry>
338 <entry align="center">
339 </entry>
340 <entry align="center">
341
342 </entry>
343 </row>
344 <row>
345 <entry align="left">
346 <constant>GL_RGBA</constant>
347 </entry>
348 <entry align="center">
349 R
350 </entry>
351 <entry align="center">
352 G
353 </entry>
354 <entry align="center">
355 B
356 </entry>
357 <entry align="center">
358 A
359 </entry>
360 <entry align="center">
361 </entry>
362 <entry align="center">
363
364 </entry>
365 </row>
366 </tbody>
367 </tgroup>
368 </informaltable>
369 <para>
370 Finally, the red, green, blue, alpha, luminance, and/or intensity components of
371 the resulting pixels are stored in the color table.
372 They form a one-dimensional table with indices in the range
373 <inlineequation><mml:math>
374 <!-- eqn: [0, width-1]:-->
375 <mml:mfenced open="[" close="]">
376 <mml:mn>0</mml:mn>
377 <mml:mrow>
378 <mml:mi mathvariant="italic">width</mml:mi>
379 <mml:mo>-</mml:mo>
380 <mml:mn>1</mml:mn>
381 </mml:mrow>
382 </mml:mfenced>
383 </mml:math></inlineequation>.
384 </para>
385 <para>
386 If <parameter>target</parameter> is <constant>GL_PROXY_*</constant>,
387 <function>glColorTable</function> recomputes and stores the values of the proxy color table's state
388 variables
389 <constant>GL_COLOR_TABLE_FORMAT</constant>,
390 <constant>GL_COLOR_TABLE_WIDTH</constant>,
391 <constant>GL_COLOR_TABLE_RED_SIZE</constant>,
392 <constant>GL_COLOR_TABLE_GREEN_SIZE</constant>,
393 <constant>GL_COLOR_TABLE_BLUE_SIZE</constant>,
394 <constant>GL_COLOR_TABLE_ALPHA_SIZE</constant>,
395 <constant>GL_COLOR_TABLE_LUMINANCE_SIZE</constant>, and
396 <constant>GL_COLOR_TABLE_INTENSITY_SIZE</constant>.
397 There is no effect on the image or state of any actual color table.
398 If the specified color table is too large to be supported, then all the
399 proxy state variables listed above are set to zero.
400 Otherwise, the color table could be supported by <function>glColorTable</function>
401 using the corresponding non-proxy target,
402 and the proxy state variables are set as if that target were being defined.
403 </para>
404 <para>
405 The proxy state variables can be retrieved by calling
406 <citerefentry><refentrytitle>glGetColorTableParameter</refentrytitle></citerefentry> with a target of
407 <constant>GL_PROXY_*</constant>.
408 This allows the application to decide if a particular <function>glColorTable</function>
409 command would succeed, and to determine what the resulting color table
410 attributes would be.
411 </para>
412 <para>
413 If a color table is enabled, and its width is non-zero, then its
414 contents are used to replace a subset of the components of each RGBA
415 pixel group, based on the internal format of the table.
416 </para>
417 <para>
418 Each pixel group has color components (R, G, B, A)
419 that are in the range
420 <inlineequation><mml:math>
421 <!-- eqn: [0.0, 1.0]:-->
422 <mml:mfenced open="[" close="]">
423 <mml:mn>0.0</mml:mn>
424 <mml:mn>1.0</mml:mn>
425 </mml:mfenced>
426 </mml:math></inlineequation>.
427 The color components are rescaled to
428 the size of the color lookup table to form an index.
429 Then a subset of the components based on the internal format of the table are
430 replaced by the table entry selected by that index.
431 If the color components and contents of the table are represented as follows:
432 </para>
433 <para>
434 </para>
435 <informaltable frame="topbot">
436 <tgroup cols="2" align="left">
437 <colspec align="center"/>
438 <colspec align="center"/>
439 <thead>
440 <row>
441 <entry rowsep="1" align="center"><emphasis role="bold">
442 Representation
443 </emphasis></entry>
444 <entry rowsep="1" align="center"><emphasis role="bold">
445 Meaning
446 </emphasis></entry>
447 </row>
448 </thead>
449 <tbody>
450 <row>
451 <entry align="center">
452 <code>r</code>
453 </entry>
454 <entry align="left">
455 Table index computed from <code>R</code>
456 </entry>
457 </row>
458 <row>
459 <entry align="center">
460 <code>g</code>
461 </entry>
462 <entry align="left">
463 Table index computed from <code>G</code>
464 </entry>
465 </row>
466 <row>
467 <entry align="center">
468 <code>b</code>
469 </entry>
470 <entry align="left">
471 Table index computed from <code>B</code>
472 </entry>
473 </row>
474 <row>
475 <entry align="center">
476 <code>a</code>
477 </entry>
478 <entry align="left">
479 Table index computed from <code>A</code>
480 </entry>
481 </row>
482 <row>
483 <entry align="center">
484 <code>L[i]</code>
485 </entry>
486 <entry align="left">
487 Luminance value at table index <code>i</code>
488 </entry>
489 </row>
490 <row>
491 <entry align="center">
492 <code>I[i]</code>
493 </entry>
494 <entry align="left">
495 Intensity value at table index <code>i</code>
496 </entry>
497 </row>
498 <row>
499 <entry align="center">
500 <code>R[i]</code>
501 </entry>
502 <entry align="left">
503 Red value at table index <code>i</code>
504 </entry>
505 </row>
506 <row>
507 <entry align="center">
508 <code>G[i]</code>
509 </entry>
510 <entry align="left">
511 Green value at table index <code>i</code>
512 </entry>
513 </row>
514 <row>
515 <entry align="center">
516 <code>B[i]</code>
517 </entry>
518 <entry align="left">
519 Blue value at table index <code>i</code>
520 </entry>
521 </row>
522 <row>
523 <entry align="center">
524 <code>A[i]</code>
525 </entry>
526 <entry align="left">
527 Alpha value at table index <code>i</code>
528 </entry>
529 </row>
530 </tbody>
531 </tgroup>
532 </informaltable>
533 <para>
534 then the result of color table lookup is as follows:
535 </para>
536 <para>
537 </para>
538 <informaltable frame="topbot">
539 <tgroup cols="5" align="left">
540 <colspec colwidth="2*" />
541 <colspec colwidth="1*" colname="r"/>
542 <colspec colwidth="1*" colname="g"/>
543 <colspec colwidth="1*" colname="b"/>
544 <colspec colwidth="1*" colname="a"/>
545 <thead>
546 <row>
547 <entry align="left"><emphasis role="bold">
548 </emphasis></entry>
549 <entry namest="r" nameend="a" align="center"><emphasis role="bold">
550 Resulting Texture Components
551 </emphasis></entry>
552 </row>
553 <row>
554 <entry rowsep="1" align="left"><emphasis role="bold">
555 Table Internal Format
556 </emphasis></entry>
557 <entry rowsep="1" align="center"><emphasis role="bold">
558 R
559 </emphasis></entry>
560 <entry rowsep="1" align="center"><emphasis role="bold">
561 G
562 </emphasis></entry>
563 <entry rowsep="1" align="center"><emphasis role="bold">
564 B
565 </emphasis></entry>
566 <entry rowsep="1" align="center"><emphasis role="bold">
567 A
568 </emphasis></entry>
569 </row>
570 </thead>
571 <tbody>
572 <row>
573 <entry align="left">
574 <constant>GL_ALPHA</constant>
575 </entry>
576 <entry align="center">
577 <code>R</code>
578 </entry>
579 <entry align="center">
580 <code>G</code>
581 </entry>
582 <entry align="center">
583 <code>B</code>
584 </entry>
585 <entry align="center">
586 <code>A[a]</code>
587 </entry>
588 </row>
589 <row>
590 <entry align="left">
591 <constant>GL_LUMINANCE</constant>
592 </entry>
593 <entry align="center">
594 <code>L[r]</code>
595 </entry>
596 <entry align="center">
597 <code>L[g]</code>
598 </entry>
599 <entry align="center">
600 <code>L[b]</code>
601 </entry>
602 <entry align="center">
603 <code>At</code>
604 </entry>
605 </row>
606 <row>
607 <entry align="left">
608 <constant>GL_LUMINANCE_ALPHA</constant>
609 </entry>
610 <entry align="center">
611 <code>L[r]</code>
612 </entry>
613 <entry align="center">
614 <code>L[g]</code>
615 </entry>
616 <entry align="center">
617 <code>L[b]</code>
618 </entry>
619 <entry align="center">
620 <code>A[a]</code>
621 </entry>
622 </row>
623 <row>
624 <entry align="left">
625 <constant>GL_INTENSITY</constant>
626 </entry>
627 <entry align="center">
628 <code>I[r]</code>
629 </entry>
630 <entry align="center">
631 <code>I[g]</code>
632 </entry>
633 <entry align="center">
634 <code>I[b]</code>
635 </entry>
636 <entry align="center">
637 <code>I[a]</code>
638 </entry>
639 </row>
640 <row>
641 <entry align="left">
642 <constant>GL_RGB</constant>
643 </entry>
644 <entry align="center">
645 <code>R[r]</code>
646 </entry>
647 <entry align="center">
648 <code>G[g]</code>
649 </entry>
650 <entry align="center">
651 <code>B[b]</code>
652 </entry>
653 <entry align="center">
654 <code>A</code>
655 </entry>
656 </row>
657 <row>
658 <entry align="left">
659 <constant>GL_RGBA</constant>
660 </entry>
661 <entry align="center">
662 <code>R[r]</code>
663 </entry>
664 <entry align="center">
665 <code>G[g]</code>
666 </entry>
667 <entry align="center">
668 <code>B[b]</code>
669 </entry>
670 <entry align="center">
671 <code>A[a]</code>
672 </entry>
673 </row>
674 </tbody>
675 </tgroup>
676 </informaltable>
677 <para>
678 When <constant>GL_COLOR_TABLE</constant> is enabled, the colors resulting from
679 the pixel map operation (if it is enabled) are mapped
680 by the color lookup table before being passed to the convolution
681 operation. The colors resulting from the convolution operation
682 are modified by the post convolution color lookup table when
683 <constant>GL_POST_CONVOLUTION_COLOR_TABLE</constant>
684 is enabled. These modified colors are then sent to the color matrix operation.
685 Finally, if <constant>GL_POST_COLOR_MATRIX_COLOR_TABLE</constant>
686 is enabled, the colors resulting from the color matrix operation
687 are mapped by the post color matrix color lookup table before being
688 used by the histogram operation.
689 </para>
690 <para>
691 </para>
692 </refsect1>
693 <refsect1 id="notes"><title>Notes</title>
694 <para>
695 <function>glColorTable</function> is present only if <code>ARB_imaging</code> is returned when <citerefentry><refentrytitle>glGetString</refentrytitle></citerefentry>
696 is called with an argument of <constant>GL_EXTENSIONS</constant>.
697 </para>
698 <para>
699 If <parameter>target</parameter> is set to <constant>GL_COLOR_TABLE</constant>,
700 <constant>GL_POST_CONVOLUTION_COLOR_TABLE</constant>,
701 or <constant>GL_POST_COLOR_MATRIX_COLOR_TABLE</constant>,
702 then <parameter>width</parameter> must be a power of two or a <constant>GL_INVALID_VALUE</constant>
703 error is generated.
704 </para>
705 <para>
706 </para>
707 </refsect1>
708 <refsect1 id="errors"><title>Errors</title>
709 <para>
710 <constant>GL_INVALID_ENUM</constant> is generated if <parameter>target</parameter> is not one of the allowable
711 values.
712 </para>
713 <para>
714 <constant>GL_INVALID_ENUM</constant> is generated if <parameter>internalformat</parameter> is not one of the
715 allowable values.
716 </para>
717 <para>
718 <constant>GL_INVALID_ENUM</constant> is generated if <parameter>format</parameter> is not one of the allowable
719 values.
720 </para>
721 <para>
722 <constant>GL_INVALID_ENUM</constant> is generated if <parameter>type</parameter> is not one of the allowable
723 values.
724 </para>
725 <para>
726 <constant>GL_INVALID_VALUE</constant> is generated if <parameter>width</parameter> is less than zero.
727 </para>
728 <para>
729 <constant>GL_TABLE_TOO_LARGE</constant> is generated if the requested color table
730 is too large to be supported by the implementation, and <parameter>target</parameter> is
731 not a <constant>GL_PROXY_*</constant> target.
732 </para>
733 <para>
734 <constant>GL_INVALID_OPERATION</constant> is generated if a non-zero buffer object name is bound to the
735 <constant>GL_PIXEL_UNPACK_BUFFER</constant> target and the buffer object's data store is currently mapped.
736 </para>
737 <para>
738 <constant>GL_INVALID_OPERATION</constant> is generated if a non-zero buffer object name is bound to the
739 <constant>GL_PIXEL_UNPACK_BUFFER</constant> target and the data would be unpacked from the buffer
740 object such that the memory reads required would exceed the data store size.
741 </para>
742 <para>
743 <constant>GL_INVALID_OPERATION</constant> is generated if a non-zero buffer object name is bound to the
744 <constant>GL_PIXEL_UNPACK_BUFFER</constant> target and <parameter>data</parameter> is not evenly divisible
745 into the number of bytes needed to store in memory a datum indicated by <parameter>type</parameter>.
746 </para>
747 <para>
748 <constant>GL_INVALID_OPERATION</constant> is generated if <function>glColorTable</function> is executed
749 between the execution of <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry> and the corresponding
750 execution of <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.
751 </para>
752 </refsect1>
753 <refsect1 id="associatedgets"><title>Associated Gets</title>
754 <para>
755 <citerefentry><refentrytitle>glGetColorTableParameter</refentrytitle></citerefentry>
756 </para>
757 <para>
758 <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_PIXEL_UNPACK_BUFFER_BINDING</constant>
759 </para>
760 </refsect1>
761 <refsect1 id="seealso"><title>See Also</title>
762 <para>
763 <citerefentry><refentrytitle>glColorSubTable</refentrytitle></citerefentry>,
764 <function>glColorTableParameter</function>,
765 <citerefentry><refentrytitle>glCopyColorTable</refentrytitle></citerefentry>,
766 <citerefentry><refentrytitle>glCopyColorSubTable</refentrytitle></citerefentry>,
767 <citerefentry><refentrytitle>glGetColorTable</refentrytitle></citerefentry>
768 </para>
769 </refsect1>
770 <refsect1 id="Copyright"><title>Copyright</title>
771 <para>
772 Copyright <trademark class="copyright"></trademark> 1991-2006
773 Silicon Graphics, Inc. This document is licensed under the SGI
774 Free Software B License. For details, see
775 <ulink url="http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/</ulink>.
776 </para>
777 </refsect1>
778 </refentry>