Commit | Line | Data |
---|---|---|
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="glCopyTexSubImage2D"> | |
5 | <refmeta> | |
6 | <refmetainfo> | |
7 | <copyright> | |
8 | <year>1991-2006</year> | |
9 | <holder>Silicon Graphics, Inc.</holder> | |
10 | </copyright> | |
11 | </refmetainfo> | |
12 | <refentrytitle>glCopyTexSubImage2D</refentrytitle> | |
13 | <manvolnum>3G</manvolnum> | |
14 | </refmeta> | |
15 | <refnamediv> | |
16 | <refname>glCopyTexSubImage2D</refname> | |
17 | <refpurpose>copy a two-dimensional texture subimage</refpurpose> | |
18 | </refnamediv> | |
19 | <refsynopsisdiv><title>C Specification</title> | |
20 | <funcsynopsis> | |
21 | <funcprototype> | |
22 | <funcdef>void <function>glCopyTexSubImage2D</function></funcdef> | |
23 | <paramdef>GLenum <parameter>target</parameter></paramdef> | |
24 | <paramdef>GLint <parameter>level</parameter></paramdef> | |
25 | <paramdef>GLint <parameter>xoffset</parameter></paramdef> | |
26 | <paramdef>GLint <parameter>yoffset</parameter></paramdef> | |
27 | <paramdef>GLint <parameter>x</parameter></paramdef> | |
28 | <paramdef>GLint <parameter>y</parameter></paramdef> | |
29 | <paramdef>GLsizei <parameter>width</parameter></paramdef> | |
30 | <paramdef>GLsizei <parameter>height</parameter></paramdef> | |
31 | </funcprototype> | |
32 | </funcsynopsis> | |
33 | </refsynopsisdiv> | |
34 | <!-- eqn: ignoring delim $$ --> | |
35 | <para> | |
36 | </para> | |
37 | <refsect1 id="parameters"><title>Parameters</title> | |
38 | <variablelist> | |
39 | <varlistentry> | |
40 | <term><parameter>target</parameter></term> | |
41 | <listitem> | |
42 | <para> | |
43 | Specifies the target texture. | |
44 | Must be <constant>GL_TEXTURE_2D</constant>, | |
45 | <constant>GL_TEXTURE_CUBE_MAP_POSITIVE_X</constant>, | |
46 | <constant>GL_TEXTURE_CUBE_MAP_NEGATIVE_X</constant>, | |
47 | <constant>GL_TEXTURE_CUBE_MAP_POSITIVE_Y</constant>, | |
48 | <constant>GL_TEXTURE_CUBE_MAP_NEGATIVE_Y</constant>, | |
49 | <constant>GL_TEXTURE_CUBE_MAP_POSITIVE_Z</constant>, | |
50 | <constant>GL_TEXTURE_CUBE_MAP_NEGATIVE_Z</constant>, or | |
51 | <constant>GL_TEXTURE_1D_ARRAY</constant>. | |
52 | </para> | |
53 | </listitem> | |
54 | </varlistentry> | |
55 | <varlistentry> | |
56 | <term><parameter>level</parameter></term> | |
57 | <listitem> | |
58 | <para> | |
59 | Specifies the level-of-detail number. | |
60 | Level 0 is the base image level. | |
61 | Level <emphasis>n</emphasis> is the <emphasis>n</emphasis>th mipmap reduction image. | |
62 | </para> | |
63 | </listitem> | |
64 | </varlistentry> | |
65 | <varlistentry> | |
66 | <term><parameter>xoffset</parameter></term> | |
67 | <listitem> | |
68 | <para> | |
69 | Specifies a texel offset in the x direction within the texture array. | |
70 | </para> | |
71 | </listitem> | |
72 | </varlistentry> | |
73 | <varlistentry> | |
74 | <term><parameter>yoffset</parameter></term> | |
75 | <listitem> | |
76 | <para> | |
77 | Specifies a texel offset in the y direction within the texture array. | |
78 | </para> | |
79 | </listitem> | |
80 | </varlistentry> | |
81 | <varlistentry> | |
82 | <term><parameter>x</parameter></term> | |
83 | <term><parameter>y</parameter></term> | |
84 | <listitem> | |
85 | <para> | |
86 | Specify the window coordinates of the lower left corner | |
87 | of the rectangular region of pixels to be copied. | |
88 | </para> | |
89 | </listitem> | |
90 | </varlistentry> | |
91 | <varlistentry> | |
92 | <term><parameter>width</parameter></term> | |
93 | <listitem> | |
94 | <para> | |
95 | Specifies the width of the texture subimage. | |
96 | </para> | |
97 | </listitem> | |
98 | </varlistentry> | |
99 | <varlistentry> | |
100 | <term><parameter>height</parameter></term> | |
101 | <listitem> | |
102 | <para> | |
103 | Specifies the height of the texture subimage. | |
104 | </para> | |
105 | </listitem> | |
106 | </varlistentry> | |
107 | </variablelist> | |
108 | </refsect1> | |
109 | <refsect1 id="description"><title>Description</title> | |
110 | <para> | |
111 | <function>glCopyTexSubImage2D</function> replaces a rectangular portion of a two-dimensional texture image, | |
112 | cube-map texture image or a linear portion of a number of slices of a one-dimensional array texture | |
113 | with pixels from the current <constant>GL_READ_BUFFER</constant> | |
114 | (rather than from main memory, as is the case for <citerefentry><refentrytitle>glTexSubImage2D</refentrytitle></citerefentry>). | |
115 | </para> | |
116 | <para> | |
117 | The screen-aligned pixel rectangle with lower left corner at | |
118 | <inlineequation><mml:math> | |
119 | <!-- eqn: (x, y): --> | |
120 | <mml:mfenced open="(" close=")"> | |
121 | <mml:mi mathvariant="italic">x</mml:mi> | |
122 | <mml:mi mathvariant="italic">y</mml:mi> | |
123 | </mml:mfenced> | |
124 | </mml:math></inlineequation> | |
125 | and with | |
126 | width <parameter>width</parameter> and height <parameter>height</parameter> replaces the portion of the | |
127 | texture array with x indices <parameter>xoffset</parameter> through | |
128 | <inlineequation><mml:math> | |
129 | <!-- eqn: xoffset + width - 1: --> | |
130 | <mml:mrow> | |
131 | <mml:mi mathvariant="italic">xoffset</mml:mi> | |
132 | <mml:mo>+</mml:mo> | |
133 | <mml:mi mathvariant="italic">width</mml:mi> | |
134 | <mml:mo>-</mml:mo> | |
135 | <mml:mn>1</mml:mn> | |
136 | </mml:mrow> | |
137 | </mml:math></inlineequation>, | |
138 | inclusive, and y indices <parameter>yoffset</parameter> through | |
139 | <inlineequation><mml:math> | |
140 | <!-- eqn: yoffset + height - 1: --> | |
141 | <mml:mrow> | |
142 | <mml:mi mathvariant="italic">yoffset</mml:mi> | |
143 | <mml:mo>+</mml:mo> | |
144 | <mml:mi mathvariant="italic">height</mml:mi> | |
145 | <mml:mo>-</mml:mo> | |
146 | <mml:mn>1</mml:mn> | |
147 | </mml:mrow> | |
148 | </mml:math></inlineequation>, | |
149 | inclusive, at the mipmap level specified by <parameter>level</parameter>. | |
150 | </para> | |
151 | <para> | |
152 | The pixels in the rectangle are processed exactly as if | |
153 | <citerefentry><refentrytitle>glReadPixels</refentrytitle></citerefentry> had been called, but the process stops just before | |
154 | final conversion. | |
155 | At this point, all pixel component values are clamped to the range | |
156 | <inlineequation><mml:math> | |
157 | <!-- eqn: [0,1]: --> | |
158 | <mml:mfenced open="[" close="]"> | |
159 | <mml:mn>0</mml:mn> | |
160 | <mml:mn>1</mml:mn> | |
161 | </mml:mfenced> | |
162 | </mml:math></inlineequation> | |
163 | and then converted to the texture's internal format for storage in the texel | |
164 | array. | |
165 | </para> | |
166 | <para> | |
167 | The destination rectangle in the texture array may not include any texels | |
168 | outside the texture array as it was originally specified. | |
169 | It is not an error to specify a subtexture with zero width or height, but | |
170 | such a specification has no effect. | |
171 | </para> | |
172 | <para> | |
173 | When <parameter>target</parameter> is <constant>GL_TEXTURE_1D_ARRAY</constant> | |
174 | then the y coordinate and height are treated as the start slice and number | |
175 | of slices to modify. | |
176 | </para> | |
177 | <para> | |
178 | If any of the pixels within the specified rectangle of the current | |
179 | <constant>GL_READ_BUFFER</constant> are outside the read window associated with the current | |
180 | rendering context, then the values obtained for those pixels are undefined. | |
181 | </para> | |
182 | <para> | |
183 | No change is made to the <emphasis>internalformat</emphasis>, <emphasis>width</emphasis>, | |
184 | <emphasis>height</emphasis>, or <emphasis>border</emphasis> parameters of the specified texture | |
185 | array or to texel values outside the specified subregion. | |
186 | </para> | |
187 | </refsect1> | |
188 | <refsect1 id="notes"><title>Notes</title> | |
189 | <para> | |
190 | <citerefentry><refentrytitle>glPixelStore</refentrytitle></citerefentry> modes affect texture images. | |
191 | </para> | |
192 | </refsect1> | |
193 | <refsect1 id="errors"><title>Errors</title> | |
194 | <para> | |
195 | <constant>GL_INVALID_ENUM</constant> is generated if <parameter>target</parameter> is not <constant>GL_TEXTURE_2D</constant>, | |
196 | <constant>GL_TEXTURE_CUBE_MAP_POSITIVE_X</constant>, | |
197 | <constant>GL_TEXTURE_CUBE_MAP_NEGATIVE_X</constant>, | |
198 | <constant>GL_TEXTURE_CUBE_MAP_POSITIVE_Y</constant>, | |
199 | <constant>GL_TEXTURE_CUBE_MAP_NEGATIVE_Y</constant>, | |
200 | <constant>GL_TEXTURE_CUBE_MAP_POSITIVE_Z</constant>, | |
201 | <constant>GL_TEXTURE_CUBE_MAP_NEGATIVE_Z</constant>, or | |
202 | <constant>GL_TEXTURE_1D_ARRAY</constant>. | |
203 | </para> | |
204 | <para> | |
205 | <constant>GL_INVALID_OPERATION</constant> is generated if the texture array has not been | |
206 | defined by a previous <citerefentry><refentrytitle>glTexImage2D</refentrytitle></citerefentry> or <citerefentry><refentrytitle>glCopyTexImage2D</refentrytitle></citerefentry> operation. | |
207 | </para> | |
208 | <para> | |
209 | <constant>GL_INVALID_VALUE</constant> is generated if <parameter>level</parameter> is less than 0. | |
210 | </para> | |
211 | <para> | |
212 | <constant>GL_INVALID_VALUE</constant> may be generated if | |
213 | <inlineequation><mml:math> | |
214 | <!-- eqn: level > log sub 2(max): --> | |
215 | <mml:mrow> | |
216 | <mml:mi mathvariant="italic">level</mml:mi> | |
217 | <mml:mo>></mml:mo> | |
218 | <mml:mrow> | |
219 | <mml:msub><mml:mi mathvariant="italic">log</mml:mi> | |
220 | <mml:mn>2</mml:mn> | |
221 | </mml:msub> | |
222 | <mml:mo>⁡</mml:mo> | |
223 | <mml:mfenced open="(" close=")"> | |
224 | <mml:mi mathvariant="italic">max</mml:mi> | |
225 | </mml:mfenced> | |
226 | </mml:mrow> | |
227 | </mml:mrow> | |
228 | </mml:math></inlineequation>, | |
229 | where | |
230 | <inlineequation><mml:math><mml:mi mathvariant="italic">max</mml:mi></mml:math></inlineequation> | |
231 | is the returned value of <constant>GL_MAX_TEXTURE_SIZE</constant>. | |
232 | </para> | |
233 | <para> | |
234 | <constant>GL_INVALID_VALUE</constant> is generated if | |
235 | <inlineequation><mml:math> | |
236 | <!-- eqn: xoffset < -b: --> | |
237 | <mml:mrow> | |
238 | <mml:mi mathvariant="italic">xoffset</mml:mi> | |
239 | <mml:mo><</mml:mo> | |
240 | <mml:mrow> | |
241 | <mml:mo>-</mml:mo> | |
242 | <mml:mi mathvariant="italic">b</mml:mi> | |
243 | </mml:mrow> | |
244 | </mml:mrow> | |
245 | </mml:math></inlineequation>, | |
246 | <inlineequation><mml:math> | |
247 | <!-- eqn: (xoffset + width) > (w - b): --> | |
248 | <mml:mrow> | |
249 | <mml:mfenced open="(" close=")"> | |
250 | <mml:mrow> | |
251 | <mml:mi mathvariant="italic">xoffset</mml:mi> | |
252 | <mml:mo>+</mml:mo> | |
253 | <mml:mi mathvariant="italic">width</mml:mi> | |
254 | </mml:mrow> | |
255 | </mml:mfenced> | |
256 | <mml:mo>></mml:mo> | |
257 | <mml:mfenced open="(" close=")"> | |
258 | <mml:mrow> | |
259 | <mml:mi mathvariant="italic">w</mml:mi> | |
260 | <mml:mo>-</mml:mo> | |
261 | <mml:mi mathvariant="italic">b</mml:mi> | |
262 | </mml:mrow> | |
263 | </mml:mfenced> | |
264 | </mml:mrow> | |
265 | </mml:math></inlineequation>, | |
266 | <inlineequation><mml:math> | |
267 | <!-- eqn: yoffset < -b: --> | |
268 | <mml:mrow> | |
269 | <mml:mi mathvariant="italic">yoffset</mml:mi> | |
270 | <mml:mo><</mml:mo> | |
271 | <mml:mrow> | |
272 | <mml:mo>-</mml:mo> | |
273 | <mml:mi mathvariant="italic">b</mml:mi> | |
274 | </mml:mrow> | |
275 | </mml:mrow> | |
276 | </mml:math></inlineequation>, | |
277 | or | |
278 | <inlineequation><mml:math> | |
279 | <!-- eqn: (yoffset + height) > (h - b): --> | |
280 | <mml:mrow> | |
281 | <mml:mfenced open="(" close=")"> | |
282 | <mml:mrow> | |
283 | <mml:mi mathvariant="italic">yoffset</mml:mi> | |
284 | <mml:mo>+</mml:mo> | |
285 | <mml:mi mathvariant="italic">height</mml:mi> | |
286 | </mml:mrow> | |
287 | </mml:mfenced> | |
288 | <mml:mo>></mml:mo> | |
289 | <mml:mfenced open="(" close=")"> | |
290 | <mml:mrow> | |
291 | <mml:mi mathvariant="italic">h</mml:mi> | |
292 | <mml:mo>-</mml:mo> | |
293 | <mml:mi mathvariant="italic">b</mml:mi> | |
294 | </mml:mrow> | |
295 | </mml:mfenced> | |
296 | </mml:mrow> | |
297 | </mml:math></inlineequation>, | |
298 | where | |
299 | <inlineequation><mml:math><mml:mi mathvariant="italic">w</mml:mi></mml:math></inlineequation> | |
300 | is the <constant>GL_TEXTURE_WIDTH</constant>, | |
301 | <inlineequation><mml:math><mml:mi mathvariant="italic">h</mml:mi></mml:math></inlineequation> | |
302 | is the <constant>GL_TEXTURE_HEIGHT</constant>, | |
303 | and | |
304 | <inlineequation><mml:math><mml:mi mathvariant="italic">b</mml:mi></mml:math></inlineequation> | |
305 | is the <constant>GL_TEXTURE_BORDER</constant> | |
306 | of the texture image being modified. | |
307 | Note that | |
308 | <inlineequation><mml:math><mml:mi mathvariant="italic">w</mml:mi></mml:math></inlineequation> | |
309 | and | |
310 | <inlineequation><mml:math><mml:mi mathvariant="italic">h</mml:mi></mml:math></inlineequation> | |
311 | include twice the border width. | |
312 | </para> | |
313 | </refsect1> | |
314 | <refsect1 id="associatedgets"><title>Associated Gets</title> | |
315 | <para> | |
316 | <citerefentry><refentrytitle>glGetTexImage</refentrytitle></citerefentry> | |
317 | </para> | |
318 | </refsect1> | |
319 | <refsect1 id="seealso"><title>See Also</title> | |
320 | <para> | |
321 | <citerefentry><refentrytitle>glCopyTexImage1D</refentrytitle></citerefentry>, | |
322 | <citerefentry><refentrytitle>glCopyTexImage2D</refentrytitle></citerefentry>, | |
323 | <citerefentry><refentrytitle>glCopyTexSubImage1D</refentrytitle></citerefentry>, | |
324 | <citerefentry><refentrytitle>glCopyTexSubImage3D</refentrytitle></citerefentry>, | |
325 | <citerefentry><refentrytitle>glPixelStore</refentrytitle></citerefentry>, | |
326 | <citerefentry><refentrytitle>glReadBuffer</refentrytitle></citerefentry>, | |
327 | <citerefentry><refentrytitle>glTexImage1D</refentrytitle></citerefentry>, | |
328 | <citerefentry><refentrytitle>glTexImage2D</refentrytitle></citerefentry>, | |
329 | <citerefentry><refentrytitle>glTexImage3D</refentrytitle></citerefentry>, | |
330 | <citerefentry><refentrytitle>glTexParameter</refentrytitle></citerefentry>, | |
331 | <citerefentry><refentrytitle>glTexSubImage1D</refentrytitle></citerefentry>, | |
332 | <citerefentry><refentrytitle>glTexSubImage2D</refentrytitle></citerefentry>, | |
333 | <citerefentry><refentrytitle>glTexSubImage3D</refentrytitle></citerefentry> | |
334 | </para> | |
335 | </refsect1> | |
336 | <refsect1 id="Copyright"><title>Copyright</title> | |
337 | <para> | |
338 | Copyright <trademark class="copyright"></trademark> 1991-2006 | |
339 | Silicon Graphics, Inc. Copyright <trademark class="copyright"></trademark> 2012 Khronos Group. | |
340 | This document is licensed under the SGI | |
341 | Free Software B License. For details, see | |
342 | <ulink url="http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/</ulink>. | |
343 | </para> | |
344 | </refsect1> | |
345 | </refentry> |