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