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>glTexSubImage1D</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /></head><body><div class="refentry" lang="en" xml:lang="en"><a id="glTexSubImage1D"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>glTexSubImage1D — specify a one-dimensional texture subimage</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">glTexSubImage1D</b>(</code></td><td>GLenum </td><td><var class="pdparam">target</var>, </td></tr><tr><td> </td><td>GLint </td><td><var class="pdparam">level</var>, </td></tr><tr><td> </td><td>GLint </td><td><var class="pdparam">xoffset</var>, </td></tr><tr><td> </td><td>GLsizei </td><td><var class="pdparam">width</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><p> | |
4 | </p><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> | |
5 | Specifies the target texture. | |
6 | Must be <code class="constant">GL_TEXTURE_1D</code>. | |
7 | </p></dd><dt><span class="term"><em class="parameter"><code>level</code></em></span></dt><dd><p> | |
8 | Specifies the level-of-detail number. | |
9 | Level 0 is the base image level. | |
10 | Level <span class="emphasis"><em>n</em></span> is the <span class="emphasis"><em>n</em></span>th mipmap reduction image. | |
11 | </p></dd><dt><span class="term"><em class="parameter"><code>xoffset</code></em></span></dt><dd><p> | |
12 | Specifies a texel offset in the x direction within the texture array. | |
13 | </p></dd><dt><span class="term"><em class="parameter"><code>width</code></em></span></dt><dd><p> | |
14 | Specifies the width of the texture subimage. | |
15 | </p></dd><dt><span class="term"><em class="parameter"><code>format</code></em></span></dt><dd><p> | |
16 | Specifies the format of the pixel data. | |
17 | The following symbolic values are accepted: | |
18 | <code class="constant">GL_COLOR_INDEX</code>, | |
19 | <code class="constant">GL_RED</code>, | |
20 | <code class="constant">GL_GREEN</code>, | |
21 | <code class="constant">GL_BLUE</code>, | |
22 | <code class="constant">GL_ALPHA</code>, | |
23 | <code class="constant">GL_RGB</code>, | |
24 | <code class="constant">GL_BGR</code>, | |
25 | <code class="constant">GL_RGBA</code>, | |
26 | <code class="constant">GL_BGRA</code>, | |
27 | <code class="constant">GL_LUMINANCE</code>, and | |
28 | <code class="constant">GL_LUMINANCE_ALPHA</code>. | |
29 | </p></dd><dt><span class="term"><em class="parameter"><code>type</code></em></span></dt><dd><p> | |
30 | Specifies the data type of the pixel data. | |
31 | The following symbolic values are accepted: | |
32 | <code class="constant">GL_UNSIGNED_BYTE</code>, | |
33 | <code class="constant">GL_BYTE</code>, | |
34 | <code class="constant">GL_BITMAP</code>, | |
35 | <code class="constant">GL_UNSIGNED_SHORT</code>, | |
36 | <code class="constant">GL_SHORT</code>, | |
37 | <code class="constant">GL_UNSIGNED_INT</code>, | |
38 | <code class="constant">GL_INT</code>, | |
39 | <code class="constant">GL_FLOAT</code>, | |
40 | <code class="constant">GL_UNSIGNED_BYTE_3_3_2</code>, | |
41 | <code class="constant">GL_UNSIGNED_BYTE_2_3_3_REV</code>, | |
42 | <code class="constant">GL_UNSIGNED_SHORT_5_6_5</code>, | |
43 | <code class="constant">GL_UNSIGNED_SHORT_5_6_5_REV</code>, | |
44 | <code class="constant">GL_UNSIGNED_SHORT_4_4_4_4</code>, | |
45 | <code class="constant">GL_UNSIGNED_SHORT_4_4_4_4_REV</code>, | |
46 | <code class="constant">GL_UNSIGNED_SHORT_5_5_5_1</code>, | |
47 | <code class="constant">GL_UNSIGNED_SHORT_1_5_5_5_REV</code>, | |
48 | <code class="constant">GL_UNSIGNED_INT_8_8_8_8</code>, | |
49 | <code class="constant">GL_UNSIGNED_INT_8_8_8_8_REV</code>, | |
50 | <code class="constant">GL_UNSIGNED_INT_10_10_10_2</code>, and | |
51 | <code class="constant">GL_UNSIGNED_INT_2_10_10_10_REV</code>. | |
52 | </p></dd><dt><span class="term"><em class="parameter"><code>data</code></em></span></dt><dd><p> | |
53 | Specifies a pointer to the image data in memory. | |
54 | </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="description"></a><h2>Description</h2><p> | |
55 | Texturing maps a portion of a specified texture image | |
56 | onto each graphical primitive for which texturing is enabled. | |
57 | To enable or disable one-dimensional texturing, call <a class="citerefentry" href="glEnable.xml"><span class="citerefentry"><span class="refentrytitle">glEnable</span></span></a> | |
58 | and <a class="citerefentry" href="glDisable.xml"><span class="citerefentry"><span class="refentrytitle">glDisable</span></span></a> with argument <code class="constant">GL_TEXTURE_1D</code>. | |
59 | </p><p> | |
60 | <code class="function">glTexSubImage1D</code> redefines a contiguous subregion of an existing one-dimensional | |
61 | texture image. | |
62 | The texels referenced by <em class="parameter"><code>data</code></em> replace the portion of the | |
63 | existing texture array with x indices <em class="parameter"><code>xoffset</code></em> and | |
64 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
65 | ||
66 | <mml:mrow> | |
67 | <mml:mi mathvariant="italic">xoffset</mml:mi> | |
68 | <mml:mo>+</mml:mo> | |
69 | <mml:mi mathvariant="italic">width</mml:mi> | |
70 | <mml:mo>-</mml:mo> | |
71 | <mml:mn>1</mml:mn> | |
72 | </mml:mrow> | |
73 | </mml:math>, | |
74 | inclusive. | |
75 | This region may not include any texels outside the range of the | |
76 | texture array as it was originally specified. | |
77 | It is not an error to specify a subtexture with width of 0, but | |
78 | such a specification has no effect. | |
79 | </p><p> | |
80 | If a non-zero named buffer object is bound to the <code class="constant">GL_PIXEL_UNPACK_BUFFER</code> target | |
81 | (see <a class="citerefentry" href="glBindBuffer.xml"><span class="citerefentry"><span class="refentrytitle">glBindBuffer</span></span></a>) while a texture image is | |
82 | specified, <em class="parameter"><code>data</code></em> is treated as a byte offset into the buffer object's data store. | |
83 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="notes"></a><h2>Notes</h2><p> | |
84 | <code class="function">glTexSubImage1D</code> is available only if the GL version is 1.1 or greater. | |
85 | </p><p> | |
86 | Texturing has no effect in color index mode. | |
87 | </p><p> | |
88 | <a class="citerefentry" href="glPixelStore.xml"><span class="citerefentry"><span class="refentrytitle">glPixelStore</span></span></a> and <a class="citerefentry" href="glPixelTransfer.xml"><span class="citerefentry"><span class="refentrytitle">glPixelTransfer</span></span></a> modes affect texture images | |
89 | in exactly the way they affect <a class="citerefentry" href="glDrawPixels.xml"><span class="citerefentry"><span class="refentrytitle">glDrawPixels</span></span></a>. | |
90 | </p><p> | |
91 | Formats <code class="constant">GL_BGR</code>, and <code class="constant">GL_BGRA</code> and types | |
92 | <code class="constant">GL_UNSIGNED_BYTE_3_3_2</code>, | |
93 | <code class="constant">GL_UNSIGNED_BYTE_2_3_3_REV</code>, | |
94 | <code class="constant">GL_UNSIGNED_SHORT_5_6_5</code>, | |
95 | <code class="constant">GL_UNSIGNED_SHORT_5_6_5_REV</code>, | |
96 | <code class="constant">GL_UNSIGNED_SHORT_4_4_4_4</code>, | |
97 | <code class="constant">GL_UNSIGNED_SHORT_4_4_4_4_REV</code>, | |
98 | <code class="constant">GL_UNSIGNED_SHORT_5_5_5_1</code>, | |
99 | <code class="constant">GL_UNSIGNED_SHORT_1_5_5_5_REV</code>, | |
100 | <code class="constant">GL_UNSIGNED_INT_8_8_8_8</code>, | |
101 | <code class="constant">GL_UNSIGNED_INT_8_8_8_8_REV</code>, | |
102 | <code class="constant">GL_UNSIGNED_INT_10_10_10_2</code>, and | |
103 | <code class="constant">GL_UNSIGNED_INT_2_10_10_10_REV</code> are available only if the GL version | |
104 | is 1.2 or greater. | |
105 | </p><p> | |
106 | For OpenGL versions 1.3 and greater, or when the <code class="code">ARB_multitexture</code> extension is supported, <code class="function">glTexSubImage1D</code> | |
107 | specifies a one-dimensional subtexture for the current texture unit, | |
108 | specified with <a class="citerefentry" href="glActiveTexture.xml"><span class="citerefentry"><span class="refentrytitle">glActiveTexture</span></span></a>. | |
109 | </p><p> | |
110 | When the <code class="code">ARB_imaging</code> extension is supported, the RGBA components | |
111 | specified in <em class="parameter"><code>data</code></em> may be processed by the imaging pipeline. See | |
112 | <a class="citerefentry" href="glTexImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage1D</span></span></a> for specific details. | |
113 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="errors"></a><h2>Errors</h2><p> | |
114 | <code class="constant">GL_INVALID_ENUM</code> is generated if <em class="parameter"><code>target</code></em> is not one of the | |
115 | allowable values. | |
116 | </p><p> | |
117 | <code class="constant">GL_INVALID_ENUM</code> is generated if <em class="parameter"><code>format</code></em> is not an accepted | |
118 | format constant. | |
119 | </p><p> | |
120 | <code class="constant">GL_INVALID_ENUM</code> is generated if <em class="parameter"><code>type</code></em> is not a type constant. | |
121 | </p><p> | |
122 | <code class="constant">GL_INVALID_ENUM</code> is generated if <em class="parameter"><code>type</code></em> is <code class="constant">GL_BITMAP</code> and | |
123 | <em class="parameter"><code>format</code></em> is not <code class="constant">GL_COLOR_INDEX</code>. | |
124 | </p><p> | |
125 | <code class="constant">GL_INVALID_VALUE</code> is generated if <em class="parameter"><code>level</code></em> is less than 0. | |
126 | </p><p> | |
127 | <code class="constant">GL_INVALID_VALUE</code> may be generated if <em class="parameter"><code>level</code></em> is greater | |
128 | than | |
129 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
130 | ||
131 | <mml:msub><mml:mi mathvariant="italic">log</mml:mi> | |
132 | <mml:mn>2</mml:mn> | |
133 | </mml:msub> | |
134 | </mml:math> | |
135 | <span class="emphasis"><em>max</em></span>, | |
136 | where <span class="emphasis"><em>max</em></span> is the returned value of <code class="constant">GL_MAX_TEXTURE_SIZE</code>. | |
137 | </p><p> | |
138 | <code class="constant">GL_INVALID_VALUE</code> is generated if | |
139 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
140 | ||
141 | <mml:mrow> | |
142 | <mml:mi mathvariant="italic">xoffset</mml:mi> | |
143 | <mml:mo><</mml:mo> | |
144 | <mml:mrow> | |
145 | <mml:mo>-</mml:mo> | |
146 | <mml:mi mathvariant="italic">b</mml:mi> | |
147 | </mml:mrow> | |
148 | </mml:mrow> | |
149 | </mml:math>, | |
150 | or if | |
151 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
152 | ||
153 | <mml:mrow> | |
154 | <mml:mfenced open="(" close=")"> | |
155 | <mml:mrow> | |
156 | <mml:mi mathvariant="italic">xoffset</mml:mi> | |
157 | <mml:mo>+</mml:mo> | |
158 | <mml:mi mathvariant="italic">width</mml:mi> | |
159 | </mml:mrow> | |
160 | </mml:mfenced> | |
161 | <mml:mo>></mml:mo> | |
162 | <mml:mfenced open="(" close=")"> | |
163 | <mml:mrow> | |
164 | <mml:mi mathvariant="italic">w</mml:mi> | |
165 | <mml:mo>-</mml:mo> | |
166 | <mml:mi mathvariant="italic">b</mml:mi> | |
167 | </mml:mrow> | |
168 | </mml:mfenced> | |
169 | </mml:mrow> | |
170 | </mml:math>, | |
171 | where | |
172 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">w</mml:mi></mml:math> | |
173 | is the <code class="constant">GL_TEXTURE_WIDTH</code>, and | |
174 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">b</mml:mi></mml:math> | |
175 | is | |
176 | the width of the <code class="constant">GL_TEXTURE_BORDER</code> | |
177 | of the texture image being modified. | |
178 | Note that | |
179 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">w</mml:mi></mml:math> | |
180 | includes twice the border width. | |
181 | </p><p> | |
182 | <code class="constant">GL_INVALID_VALUE</code> is generated if <em class="parameter"><code>width</code></em> is less than 0. | |
183 | </p><p> | |
184 | <code class="constant">GL_INVALID_OPERATION</code> is generated if the texture array has not | |
185 | been defined by a previous <a class="citerefentry" href="glTexImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage1D</span></span></a> operation. | |
186 | </p><p> | |
187 | <code class="constant">GL_INVALID_OPERATION</code> is generated if <em class="parameter"><code>type</code></em> is one of | |
188 | <code class="constant">GL_UNSIGNED_BYTE_3_3_2</code>, | |
189 | <code class="constant">GL_UNSIGNED_BYTE_2_3_3_REV</code>, | |
190 | <code class="constant">GL_UNSIGNED_SHORT_5_6_5</code>, or | |
191 | <code class="constant">GL_UNSIGNED_SHORT_5_6_5_REV</code> | |
192 | and <em class="parameter"><code>format</code></em> is not <code class="constant">GL_RGB</code>. | |
193 | </p><p> | |
194 | <code class="constant">GL_INVALID_OPERATION</code> is generated if <em class="parameter"><code>type</code></em> is one of | |
195 | <code class="constant">GL_UNSIGNED_SHORT_4_4_4_4</code>, | |
196 | <code class="constant">GL_UNSIGNED_SHORT_4_4_4_4_REV</code>, | |
197 | <code class="constant">GL_UNSIGNED_SHORT_5_5_5_1</code>, | |
198 | <code class="constant">GL_UNSIGNED_SHORT_1_5_5_5_REV</code>, | |
199 | <code class="constant">GL_UNSIGNED_INT_8_8_8_8</code>, | |
200 | <code class="constant">GL_UNSIGNED_INT_8_8_8_8_REV</code>, | |
201 | <code class="constant">GL_UNSIGNED_INT_10_10_10_2</code>, or | |
202 | <code class="constant">GL_UNSIGNED_INT_2_10_10_10_REV</code> | |
203 | and <em class="parameter"><code>format</code></em> is neither <code class="constant">GL_RGBA</code> nor <code class="constant">GL_BGRA</code>. | |
204 | </p><p> | |
205 | <code class="constant">GL_INVALID_OPERATION</code> is generated if a non-zero buffer object name is bound to the | |
206 | <code class="constant">GL_PIXEL_UNPACK_BUFFER</code> target and the buffer object's data store is currently mapped. | |
207 | </p><p> | |
208 | <code class="constant">GL_INVALID_OPERATION</code> is generated if a non-zero buffer object name is bound to the | |
209 | <code class="constant">GL_PIXEL_UNPACK_BUFFER</code> target and the data would be unpacked from the buffer | |
210 | object such that the memory reads required would exceed the data store size. | |
211 | </p><p> | |
212 | <code class="constant">GL_INVALID_OPERATION</code> is generated if a non-zero buffer object name is bound to the | |
213 | <code class="constant">GL_PIXEL_UNPACK_BUFFER</code> target and <em class="parameter"><code>data</code></em> is not evenly divisible | |
214 | into the number of bytes needed to store in memory a datum indicated by <em class="parameter"><code>type</code></em>. | |
215 | </p><p> | |
216 | <code class="constant">GL_INVALID_OPERATION</code> is generated if <code class="function">glTexSubImage1D</code> is executed | |
217 | between the execution of <a class="citerefentry" href="glBegin.xml"><span class="citerefentry"><span class="refentrytitle">glBegin</span></span></a> and the corresponding | |
218 | execution of <a class="citerefentry" href="glEnd.xml"><span class="citerefentry"><span class="refentrytitle">glEnd</span></span></a>. | |
219 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="associatedgets"></a><h2>Associated Gets</h2><p> | |
220 | <a class="citerefentry" href="glGetTexImage.xml"><span class="citerefentry"><span class="refentrytitle">glGetTexImage</span></span></a> | |
221 | </p><p> | |
222 | <a class="citerefentry" href="glIsEnabled.xml"><span class="citerefentry"><span class="refentrytitle">glIsEnabled</span></span></a> with argument <code class="constant">GL_TEXTURE_1D</code> | |
223 | </p><p> | |
224 | <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> | |
225 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p> | |
226 | <a class="citerefentry" href="glActiveTexture.xml"><span class="citerefentry"><span class="refentrytitle">glActiveTexture</span></span></a>, | |
227 | <a class="citerefentry" href="glCopyTexImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexImage1D</span></span></a>, | |
228 | <a class="citerefentry" href="glCopyTexImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexImage2D</span></span></a>, | |
229 | <a class="citerefentry" href="glCopyTexSubImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexSubImage1D</span></span></a>, | |
230 | <a class="citerefentry" href="glCopyTexSubImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexSubImage2D</span></span></a>, | |
231 | <a class="citerefentry" href="glCopyTexSubImage3D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexSubImage3D</span></span></a>, | |
232 | <a class="citerefentry" href="glDrawPixels.xml"><span class="citerefentry"><span class="refentrytitle">glDrawPixels</span></span></a>, | |
233 | <a class="citerefentry" href="glPixelStore.xml"><span class="citerefentry"><span class="refentrytitle">glPixelStore</span></span></a>, | |
234 | <a class="citerefentry" href="glPixelTransfer.xml"><span class="citerefentry"><span class="refentrytitle">glPixelTransfer</span></span></a>, | |
235 | <a class="citerefentry" href="glTexEnv.xml"><span class="citerefentry"><span class="refentrytitle">glTexEnv</span></span></a>, | |
236 | <a class="citerefentry" href="glTexGen.xml"><span class="citerefentry"><span class="refentrytitle">glTexGen</span></span></a>, | |
237 | <a class="citerefentry" href="glTexImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage1D</span></span></a>, | |
238 | <a class="citerefentry" href="glTexImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage2D</span></span></a>, | |
239 | <a class="citerefentry" href="glTexImage3D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage3D</span></span></a>, | |
240 | <a class="citerefentry" href="glTexParameter.xml"><span class="citerefentry"><span class="refentrytitle">glTexParameter</span></span></a>, | |
241 | <a class="citerefentry" href="glTexSubImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glTexSubImage2D</span></span></a>, | |
242 | <a class="citerefentry" href="glTexSubImage3D.xml"><span class="citerefentry"><span class="refentrytitle">glTexSubImage3D</span></span></a> | |
243 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="Copyright"></a><h2>Copyright</h2><p> | |
244 | Copyright <span class="trademark"></span>© 1991-2006 | |
245 | Silicon Graphics, Inc. This document is licensed under the SGI | |
246 | Free Software B License. For details, see | |
247 | <a class="ulink" href="http://oss.sgi.com/projects/FreeB/" target="_top">http://oss.sgi.com/projects/FreeB/</a>. | |
248 | </p></div></div></body></html> |