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>glColorSubTable</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /></head><body><div class="refentry" lang="en" xml:lang="en"><a id="glColorSubTable"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>glColorSubTable — respecify a portion of a color 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">glColorSubTable</b>(</code></td><td>GLenum </td><td><var class="pdparam">target</var>, </td></tr><tr><td> </td><td>GLsizei </td><td><var class="pdparam">start</var>, </td></tr><tr><td> </td><td>GLsizei </td><td><var class="pdparam">count</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>const GLvoid * </td><td><var class="pdparam">data</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 one of | |
5 | <code class="constant">GL_COLOR_TABLE</code>, | |
6 | <code class="constant">GL_POST_CONVOLUTION_COLOR_TABLE</code>, or | |
7 | <code class="constant">GL_POST_COLOR_MATRIX_COLOR_TABLE</code>. | |
8 | </p></dd><dt><span class="term"><em class="parameter"><code>start</code></em></span></dt><dd><p> | |
9 | The starting index of the portion of the color table to be replaced. | |
10 | </p></dd><dt><span class="term"><em class="parameter"><code>count</code></em></span></dt><dd><p> | |
11 | The number of table entries to replace. | |
12 | </p></dd><dt><span class="term"><em class="parameter"><code>format</code></em></span></dt><dd><p> | |
13 | The format of the pixel data in <em class="parameter"><code>data</code></em>. | |
14 | The allowable values are | |
15 | <code class="constant">GL_RED</code>, | |
16 | <code class="constant">GL_GREEN</code>, | |
17 | <code class="constant">GL_BLUE</code>, | |
18 | <code class="constant">GL_ALPHA</code>, | |
19 | <code class="constant">GL_LUMINANCE</code>, | |
20 | <code class="constant">GL_LUMINANCE_ALPHA</code>, | |
21 | <code class="constant">GL_RGB</code>, | |
22 | <code class="constant">GL_BGR</code>, | |
23 | <code class="constant">GL_RGBA</code>, and | |
24 | <code class="constant">GL_BGRA</code>. | |
25 | </p></dd><dt><span class="term"><em class="parameter"><code>type</code></em></span></dt><dd><p> | |
26 | The type of the pixel data in <em class="parameter"><code>data</code></em>. | |
27 | The allowable values are | |
28 | <code class="constant">GL_UNSIGNED_BYTE</code>, | |
29 | <code class="constant">GL_BYTE</code>, | |
30 | <code class="constant">GL_UNSIGNED_SHORT</code>, | |
31 | <code class="constant">GL_SHORT</code>, | |
32 | <code class="constant">GL_UNSIGNED_INT</code>, | |
33 | <code class="constant">GL_INT</code>, | |
34 | <code class="constant">GL_FLOAT</code>, | |
35 | <code class="constant">GL_UNSIGNED_BYTE_3_3_2</code>, | |
36 | <code class="constant">GL_UNSIGNED_BYTE_2_3_3_REV</code>, | |
37 | <code class="constant">GL_UNSIGNED_SHORT_5_6_5</code>, | |
38 | <code class="constant">GL_UNSIGNED_SHORT_5_6_5_REV</code>, | |
39 | <code class="constant">GL_UNSIGNED_SHORT_4_4_4_4</code>, | |
40 | <code class="constant">GL_UNSIGNED_SHORT_4_4_4_4_REV</code>, | |
41 | <code class="constant">GL_UNSIGNED_SHORT_5_5_5_1</code>, | |
42 | <code class="constant">GL_UNSIGNED_SHORT_1_5_5_5_REV</code>, | |
43 | <code class="constant">GL_UNSIGNED_INT_8_8_8_8</code>, | |
44 | <code class="constant">GL_UNSIGNED_INT_8_8_8_8_REV</code>, | |
45 | <code class="constant">GL_UNSIGNED_INT_10_10_10_2</code>, and | |
46 | <code class="constant">GL_UNSIGNED_INT_2_10_10_10_REV</code>. | |
47 | </p></dd><dt><span class="term"><em class="parameter"><code>data</code></em></span></dt><dd><p> | |
48 | Pointer to a one-dimensional array of pixel data that is processed to | |
49 | replace the specified region of the color table. | |
50 | </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="description"></a><h2>Description</h2><p> | |
51 | <code class="function">glColorSubTable</code> is used to respecify a contiguous portion of a color table previously | |
52 | defined using <a class="citerefentry" href="glColorTable.xml"><span class="citerefentry"><span class="refentrytitle">glColorTable</span></span></a>. The pixels referenced by <em class="parameter"><code>data</code></em> replace the | |
53 | portion of the existing table from indices <em class="parameter"><code>start</code></em> to | |
54 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
55 | ||
56 | <mml:mrow> | |
57 | <mml:mi mathvariant="italic">start</mml:mi> | |
58 | <mml:mo>+</mml:mo> | |
59 | <mml:mi mathvariant="italic">count</mml:mi> | |
60 | <mml:mo>-</mml:mo> | |
61 | <mml:mn>1</mml:mn> | |
62 | </mml:mrow> | |
63 | </mml:math>, | |
64 | inclusive. This region may not include any | |
65 | entries outside the range of the color table as it was originally specified. | |
66 | It is not an error to specify a subtexture with width of 0, but such a | |
67 | specification has no effect. | |
68 | </p><p> | |
69 | If a non-zero named buffer object is bound to the <code class="constant">GL_PIXEL_UNPACK_BUFFER</code> target | |
70 | (see <a class="citerefentry" href="glBindBuffer.xml"><span class="citerefentry"><span class="refentrytitle">glBindBuffer</span></span></a>) while a portion of a color table is | |
71 | respecified, <em class="parameter"><code>data</code></em> is treated as a byte offset into the buffer object's data store. | |
72 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="notes"></a><h2>Notes</h2><p> | |
73 | <code class="function">glColorSubTable</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> | |
74 | is called with an argument of <code class="constant">GL_EXTENSIONS</code>. | |
75 | </p><p> | |
76 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="errors"></a><h2>Errors</h2><p> | |
77 | <code class="constant">GL_INVALID_ENUM</code> is generated if <em class="parameter"><code>target</code></em> is not one of the allowable | |
78 | values. | |
79 | </p><p> | |
80 | <code class="constant">GL_INVALID_ENUM</code> is generated if <em class="parameter"><code>format</code></em> is not one of the allowable | |
81 | values. | |
82 | </p><p> | |
83 | <code class="constant">GL_INVALID_ENUM</code> is generated if <em class="parameter"><code>type</code></em> is not one of the allowable | |
84 | values. | |
85 | </p><p> | |
86 | <code class="constant">GL_INVALID_VALUE</code> is generated if | |
87 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
88 | ||
89 | <mml:mrow> | |
90 | <mml:mrow> | |
91 | <mml:mi mathvariant="italic">start</mml:mi> | |
92 | <mml:mo>+</mml:mo> | |
93 | <mml:mi mathvariant="italic">count</mml:mi> | |
94 | </mml:mrow> | |
95 | <mml:mo>></mml:mo> | |
96 | <mml:mi mathvariant="italic">width</mml:mi> | |
97 | </mml:mrow> | |
98 | </mml:math>. | |
99 | </p><p> | |
100 | <code class="constant">GL_INVALID_OPERATION</code> is generated if a non-zero buffer object name is bound to the | |
101 | <code class="constant">GL_PIXEL_UNPACK_BUFFER</code> target and the buffer object's data store is currently mapped. | |
102 | </p><p> | |
103 | <code class="constant">GL_INVALID_OPERATION</code> is generated if a non-zero buffer object name is bound to the | |
104 | <code class="constant">GL_PIXEL_UNPACK_BUFFER</code> target and the data would be unpacked from the buffer | |
105 | object such that the memory reads required would exceed the data store size. | |
106 | </p><p> | |
107 | <code class="constant">GL_INVALID_OPERATION</code> is generated if a non-zero buffer object name is bound to the | |
108 | <code class="constant">GL_PIXEL_UNPACK_BUFFER</code> target and <em class="parameter"><code>data</code></em> is not evenly divisible | |
109 | into the number of bytes needed to store in memory a datum indicated by <em class="parameter"><code>type</code></em>. | |
110 | </p><p> | |
111 | <code class="constant">GL_INVALID_OPERATION</code> is generated if <code class="function">glColorSubTable</code> is executed | |
112 | between the execution of <a class="citerefentry" href="glBegin.xml"><span class="citerefentry"><span class="refentrytitle">glBegin</span></span></a> and the corresponding | |
113 | execution of <a class="citerefentry" href="glEnd.xml"><span class="citerefentry"><span class="refentrytitle">glEnd</span></span></a>. | |
114 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="associatedgets"></a><h2>Associated Gets</h2><p> | |
115 | <a class="citerefentry" href="glGetColorTable.xml"><span class="citerefentry"><span class="refentrytitle">glGetColorTable</span></span></a>, | |
116 | <a class="citerefentry" href="glGetColorTableParameter.xml"><span class="citerefentry"><span class="refentrytitle">glGetColorTableParameter</span></span></a> | |
117 | </p><p> | |
118 | <a class="citerefentry" href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_PIXEL_UNPACK_BUFFER_BINDING</code> | |
119 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p> | |
120 | <a class="citerefentry" href="glColorTable.xml"><span class="citerefentry"><span class="refentrytitle">glColorTable</span></span></a>, | |
121 | <a class="citerefentry" href="glColorTableParameter.xml"><span class="citerefentry"><span class="refentrytitle">glColorTableParameter</span></span></a>, | |
122 | <a class="citerefentry" href="glCopyColorTable.xml"><span class="citerefentry"><span class="refentrytitle">glCopyColorTable</span></span></a>, | |
123 | <a class="citerefentry" href="glCopyColorSubTable.xml"><span class="citerefentry"><span class="refentrytitle">glCopyColorSubTable</span></span></a>, | |
124 | <a class="citerefentry" href="glGetColorTable.xml"><span class="citerefentry"><span class="refentrytitle">glGetColorTable</span></span></a> | |
125 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="Copyright"></a><h2>Copyright</h2><p> | |
126 | Copyright <span class="trademark"></span>© 1991-2006 | |
127 | Silicon Graphics, Inc. This document is licensed under the SGI | |
128 | Free Software B License. For details, see | |
129 | <a class="ulink" href="http://oss.sgi.com/projects/FreeB/" target="_top">http://oss.sgi.com/projects/FreeB/</a>. | |
130 | </p></div></div></body></html> |