Commit | Line | Data |
---|---|---|
7faf1d71 AW |
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "xhtml1-transitional.dtd"> |
2 | <!-- saved from url=(0013)about:internet --> | |
3 | <?xml-stylesheet type="text/xsl" href="mathml.xsl"?><html xmlns="http://www.w3.org/1999/xhtml" xmlns:pref="http://www.w3.org/2002/Math/preference" pref:renderer="mathplayer-dl"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>glGetColorTable</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /></head><body><div class="refentry" lang="en" xml:lang="en"><a id="glGetColorTable"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>glGetColorTable — retrieve contents of a color lookup table</p></div><div class="refsynopsisdiv"><h2>C Specification</h2><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef">void <b class="fsfunc">glGetColorTable</b>(</code></td><td>GLenum </td><td><var class="pdparam">target</var>, </td></tr><tr><td> </td><td>GLenum </td><td><var class="pdparam">format</var>, </td></tr><tr><td> </td><td>GLenum </td><td><var class="pdparam">type</var>, </td></tr><tr><td> </td><td>GLvoid * </td><td><var class="pdparam">table</var><code>)</code>;</td></tr></table></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="parameters"></a><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term"><em class="parameter"><code>target</code></em></span></dt><dd><p> | |
4 | Must be <code class="constant">GL_COLOR_TABLE</code>, | |
5 | <code class="constant">GL_POST_CONVOLUTION_COLOR_TABLE</code>, | |
6 | or | |
7 | <code class="constant">GL_POST_COLOR_MATRIX_COLOR_TABLE</code>. | |
8 | </p></dd><dt><span class="term"><em class="parameter"><code>format</code></em></span></dt><dd><p> | |
9 | The format of the pixel data in <em class="parameter"><code>table</code></em>. | |
10 | The possible values are | |
11 | <code class="constant">GL_RED</code>, | |
12 | <code class="constant">GL_GREEN</code>, | |
13 | <code class="constant">GL_BLUE</code>, | |
14 | <code class="constant">GL_ALPHA</code>, | |
15 | <code class="constant">GL_LUMINANCE</code>, | |
16 | <code class="constant">GL_LUMINANCE_ALPHA</code>, | |
17 | <code class="constant">GL_RGB</code>, | |
18 | <code class="constant">GL_BGR</code>, | |
19 | <code class="constant">GL_RGBA</code>, and | |
20 | <code class="constant">GL_BGRA</code>. | |
21 | </p></dd><dt><span class="term"><em class="parameter"><code>type</code></em></span></dt><dd><p> | |
22 | The type of the pixel data in <em class="parameter"><code>table</code></em>. | |
23 | Symbolic constants | |
24 | <code class="constant">GL_UNSIGNED_BYTE</code>, | |
25 | <code class="constant">GL_BYTE</code>, | |
26 | <code class="constant">GL_BITMAP</code>, | |
27 | <code class="constant">GL_UNSIGNED_SHORT</code>, | |
28 | <code class="constant">GL_SHORT</code>, | |
29 | <code class="constant">GL_UNSIGNED_INT</code>, | |
30 | <code class="constant">GL_INT</code>, | |
31 | <code class="constant">GL_FLOAT</code>, | |
32 | <code class="constant">GL_UNSIGNED_BYTE_3_3_2</code>, | |
33 | <code class="constant">GL_UNSIGNED_BYTE_2_3_3_REV</code>, | |
34 | <code class="constant">GL_UNSIGNED_SHORT_5_6_5</code>, | |
35 | <code class="constant">GL_UNSIGNED_SHORT_5_6_5_REV</code>, | |
36 | <code class="constant">GL_UNSIGNED_SHORT_4_4_4_4</code>, | |
37 | <code class="constant">GL_UNSIGNED_SHORT_4_4_4_4_REV</code>, | |
38 | <code class="constant">GL_UNSIGNED_SHORT_5_5_5_1</code>, | |
39 | <code class="constant">GL_UNSIGNED_SHORT_1_5_5_5_REV</code>, | |
40 | <code class="constant">GL_UNSIGNED_INT_8_8_8_8</code>, | |
41 | <code class="constant">GL_UNSIGNED_INT_8_8_8_8_REV</code>, | |
42 | <code class="constant">GL_UNSIGNED_INT_10_10_10_2</code>, and | |
43 | <code class="constant">GL_UNSIGNED_INT_2_10_10_10_REV</code> | |
44 | are accepted. | |
45 | </p></dd><dt><span class="term"><em class="parameter"><code>table</code></em></span></dt><dd><p> | |
46 | Pointer to a one-dimensional array of pixel data containing the contents | |
47 | of the color table. | |
48 | </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="description"></a><h2>Description</h2><p> | |
49 | <code class="function">glGetColorTable</code> returns in <em class="parameter"><code>table</code></em> the contents of the color table specified | |
50 | by <em class="parameter"><code>target</code></em>. No pixel transfer operations are performed, but pixel | |
51 | storage modes that are applicable to | |
52 | <a class="citerefentry" href="glReadPixels.xml"><span class="citerefentry"><span class="refentrytitle">glReadPixels</span></span></a> are performed. | |
53 | </p><p> | |
54 | If a non-zero named buffer object is bound to the <code class="constant">GL_PIXEL_PACK_BUFFER</code> target | |
55 | (see <a class="citerefentry" href="glBindBuffer.xml"><span class="citerefentry"><span class="refentrytitle">glBindBuffer</span></span></a>) while a histogram table is | |
56 | requested, <em class="parameter"><code>table</code></em> is treated as a byte offset into the buffer object's data store. | |
57 | </p><p> | |
58 | Color components that are requested in | |
59 | the specified <em class="parameter"><code>format</code></em>, but which are not included in the internal | |
60 | format of the color lookup table, are returned as zero. The | |
61 | assignments of internal color components to the components | |
62 | requested by <em class="parameter"><code>format</code></em> are | |
63 | </p><div class="informaltable"><table border="1"><colgroup><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left"><span class="bold"><strong> | |
64 | Internal Component | |
65 | </strong></span></th><th align="left"><span class="bold"><strong> | |
66 | Resulting Component | |
67 | </strong></span></th></tr></thead><tbody><tr><td align="left"> | |
68 | Red | |
69 | </td><td align="left"> | |
70 | Red | |
71 | </td></tr><tr><td align="left"> | |
72 | Green | |
73 | </td><td align="left"> | |
74 | Green | |
75 | </td></tr><tr><td align="left"> | |
76 | Blue | |
77 | </td><td align="left"> | |
78 | Blue | |
79 | </td></tr><tr><td align="left"> | |
80 | Alpha | |
81 | </td><td align="left"> | |
82 | Alpha | |
83 | </td></tr><tr><td align="left"> | |
84 | Luminance | |
85 | </td><td align="left"> | |
86 | Red | |
87 | </td></tr><tr><td align="left"> | |
88 | Intensity | |
89 | </td><td align="left"> | |
90 | Red | |
91 | </td></tr></tbody></table></div><p> | |
92 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="notes"></a><h2>Notes</h2><p> | |
93 | <code class="function">glGetColorTable</code> is present only if <code class="code">ARB_imaging</code> is returned when <a class="citerefentry" href="glGetString.xml"><span class="citerefentry"><span class="refentrytitle">glGetString</span></span></a> | |
94 | is called with an argument of <code class="constant">GL_EXTENSIONS</code>. | |
95 | </p><p> | |
96 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="errors"></a><h2>Errors</h2><p> | |
97 | <code class="constant">GL_INVALID_ENUM</code> is generated if <em class="parameter"><code>target</code></em> is not one of the allowable | |
98 | values. | |
99 | </p><p> | |
100 | <code class="constant">GL_INVALID_ENUM</code> is generated if <em class="parameter"><code>format</code></em> is not one of the allowable | |
101 | values. | |
102 | </p><p> | |
103 | <code class="constant">GL_INVALID_ENUM</code> is generated if <em class="parameter"><code>type</code></em> is not one of the allowable | |
104 | values. | |
105 | </p><p> | |
106 | <code class="constant">GL_INVALID_OPERATION</code> is generated if <em class="parameter"><code>type</code></em> is one of | |
107 | <code class="constant">GL_UNSIGNED_BYTE_3_3_2</code>, | |
108 | <code class="constant">GL_UNSIGNED_BYTE_2_3_3_REV</code>, | |
109 | <code class="constant">GL_UNSIGNED_SHORT_5_6_5</code>, or | |
110 | <code class="constant">GL_UNSIGNED_SHORT_5_6_5_REV</code> | |
111 | and <em class="parameter"><code>format</code></em> is not <code class="constant">GL_RGB</code>. | |
112 | </p><p> | |
113 | <code class="constant">GL_INVALID_OPERATION</code> is generated if <em class="parameter"><code>type</code></em> is one of | |
114 | <code class="constant">GL_UNSIGNED_SHORT_4_4_4_4</code>, | |
115 | <code class="constant">GL_UNSIGNED_SHORT_4_4_4_4_REV</code>, | |
116 | <code class="constant">GL_UNSIGNED_SHORT_5_5_5_1</code>, | |
117 | <code class="constant">GL_UNSIGNED_SHORT_1_5_5_5_REV</code>, | |
118 | <code class="constant">GL_UNSIGNED_INT_8_8_8_8</code>, | |
119 | <code class="constant">GL_UNSIGNED_INT_8_8_8_8_REV</code>, | |
120 | <code class="constant">GL_UNSIGNED_INT_10_10_10_2</code>, or | |
121 | <code class="constant">GL_UNSIGNED_INT_2_10_10_10_REV</code> | |
122 | and <em class="parameter"><code>format</code></em> is neither <code class="constant">GL_RGBA</code> nor <code class="constant">GL_BGRA</code>. | |
123 | </p><p> | |
124 | <code class="constant">GL_INVALID_OPERATION</code> is generated if a non-zero buffer object name is bound to the | |
125 | <code class="constant">GL_PIXEL_PACK_BUFFER</code> target and the buffer object's data store is currently mapped. | |
126 | </p><p> | |
127 | <code class="constant">GL_INVALID_OPERATION</code> is generated if a non-zero buffer object name is bound to the | |
128 | <code class="constant">GL_PIXEL_PACK_BUFFER</code> target and the data would be packed to the buffer | |
129 | object such that the memory writes required would exceed the data store size. | |
130 | </p><p> | |
131 | <code class="constant">GL_INVALID_OPERATION</code> is generated if a non-zero buffer object name is bound to the | |
132 | <code class="constant">GL_PIXEL_PACK_BUFFER</code> target and <em class="parameter"><code>table</code></em> is not evenly divisible | |
133 | into the number of bytes needed to store in memory a datum indicated by <em class="parameter"><code>type</code></em>. | |
134 | </p><p> | |
135 | <code class="constant">GL_INVALID_OPERATION</code> is generated if <code class="function">glGetColorTable</code> is executed | |
136 | between the execution of <a class="citerefentry" href="glBegin.xml"><span class="citerefentry"><span class="refentrytitle">glBegin</span></span></a> and the corresponding | |
137 | execution of <a class="citerefentry" href="glEnd.xml"><span class="citerefentry"><span class="refentrytitle">glEnd</span></span></a>. | |
138 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="associatedgets"></a><h2>Associated Gets</h2><p> | |
139 | <a class="citerefentry" href="glGetColorTableParameter.xml"><span class="citerefentry"><span class="refentrytitle">glGetColorTableParameter</span></span></a> | |
140 | </p><p> | |
141 | <a class="citerefentry" href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_PIXEL_PACK_BUFFER_BINDING</code> | |
142 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p> | |
143 | <a class="citerefentry" href="glColorTable.xml"><span class="citerefentry"><span class="refentrytitle">glColorTable</span></span></a>, | |
144 | <a class="citerefentry" href="glColorTableParameter.xml"><span class="citerefentry"><span class="refentrytitle">glColorTableParameter</span></span></a> | |
145 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="Copyright"></a><h2>Copyright</h2><p> | |
146 | Copyright <span class="trademark"></span>© 1991-2006 | |
147 | Silicon Graphics, Inc. This document is licensed under the SGI | |
148 | Free Software B License. For details, see | |
149 | <a class="ulink" href="http://oss.sgi.com/projects/FreeB/" target="_top">http://oss.sgi.com/projects/FreeB/</a>. | |
150 | </p></div></div></body></html> |