update upstream sources
[clinton/guile-figl.git] / upstream-doc / man3 / 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>
8 <year>1991-2006</year>
9 <holder>Silicon Graphics, Inc.</holder>
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>,
c7b31271 173 <emphasis>height</emphasis>, or <emphasis>depth</emphasis> parameters of the specified texture
7faf1d71
AW
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>
c7b31271 184 <constant>GL_INVALID_ENUM</constant> is generated if <parameter>target</parameter> is not <constant>GL_TEXTURE_3D</constant> or <constant>GL_TEXTURE_2D_ARRAY</constant>.
7faf1d71
AW
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 is the returned value of <constant>GL_MAX_3D_TEXTURE_SIZE</constant> if <parameter>target</parameter>
213 is <constant>GL_TEXTURE_3D</constant> or the returned value of <constant>GL_MAX_ARRAY_TEXTURE_LAYERS</constant>
214 if <parameter>target</parameter> is <constant>GL_TEXTURE_2D_ARRAY</constant>.
215 </para>
216 <para>
217 <constant>GL_INVALID_VALUE</constant> is generated if
218 <inlineequation><mml:math>
219 <!-- eqn: xoffset < -b: -->
220 <mml:mrow>
221 <mml:mi mathvariant="italic">xoffset</mml:mi>
222 <mml:mo>&lt;</mml:mo>
c7b31271 223 <mml:mn>0</mml:mn>
7faf1d71
AW
224 </mml:mrow>
225 </mml:math></inlineequation>,
226 <inlineequation><mml:math>
227 <!-- eqn: (xoffset + width) > (w - b): -->
228 <mml:mrow>
229 <mml:mfenced open="(" close=")">
230 <mml:mrow>
231 <mml:mi mathvariant="italic">xoffset</mml:mi>
232 <mml:mo>+</mml:mo>
233 <mml:mi mathvariant="italic">width</mml:mi>
234 </mml:mrow>
235 </mml:mfenced>
236 <mml:mo>&gt;</mml:mo>
c7b31271 237 <mml:mi mathvariant="italic">w</mml:mi>
7faf1d71
AW
238 </mml:mrow>
239 </mml:math></inlineequation>,
240 <inlineequation><mml:math>
241 <!-- eqn: yoffset < -b: -->
242 <mml:mrow>
243 <mml:mi mathvariant="italic">yoffset</mml:mi>
244 <mml:mo>&lt;</mml:mo>
c7b31271 245 <mml:mn>0</mml:mn>
7faf1d71
AW
246 </mml:mrow>
247 </mml:math></inlineequation>,
248 <inlineequation><mml:math>
249 <!-- eqn: (yoffset + height) > (h - b): -->
250 <mml:mrow>
251 <mml:mfenced open="(" close=")">
252 <mml:mrow>
253 <mml:mi mathvariant="italic">yoffset</mml:mi>
254 <mml:mo>+</mml:mo>
255 <mml:mi mathvariant="italic">height</mml:mi>
256 </mml:mrow>
257 </mml:mfenced>
258 <mml:mo>&gt;</mml:mo>
c7b31271 259 <mml:mi mathvariant="italic">h</mml:mi>
7faf1d71
AW
260 </mml:mrow>
261 </mml:math></inlineequation>,
262 <inlineequation><mml:math>
263 <!-- eqn: zoffset < -b: -->
264 <mml:mrow>
265 <mml:mi mathvariant="italic">zoffset</mml:mi>
266 <mml:mo>&lt;</mml:mo>
c7b31271 267 <mml:mn>0</mml:mn>
7faf1d71
AW
268 </mml:mrow>
269 </mml:math></inlineequation>,
270 or
271 <inlineequation><mml:math>
272 <!-- eqn: (zoffset + 1) > (d - b): -->
273 <mml:mrow>
274 <mml:mfenced open="(" close=")">
275 <mml:mrow>
276 <mml:mi mathvariant="italic">zoffset</mml:mi>
277 <mml:mo>+</mml:mo>
278 <mml:mn>1</mml:mn>
279 </mml:mrow>
280 </mml:mfenced>
281 <mml:mo>&gt;</mml:mo>
c7b31271 282 <mml:mi mathvariant="italic">d</mml:mi>
7faf1d71
AW
283 </mml:mrow>
284 </mml:math></inlineequation>,
285 where
286 <inlineequation><mml:math><mml:mi mathvariant="italic">w</mml:mi></mml:math></inlineequation>
287 is the <constant>GL_TEXTURE_WIDTH</constant>,
288 <inlineequation><mml:math><mml:mi mathvariant="italic">h</mml:mi></mml:math></inlineequation>
c7b31271 289 is the <constant>GL_TEXTURE_HEIGHT</constant>, and
7faf1d71 290 <inlineequation><mml:math><mml:mi mathvariant="italic">d</mml:mi></mml:math></inlineequation>
c7b31271 291 is the <constant>GL_TEXTURE_DEPTH</constant>
7faf1d71 292 of the texture image being modified.
7faf1d71
AW
293 </para>
294 </refsect1>
295 <refsect1 id="associatedgets"><title>Associated Gets</title>
296 <para>
297 <citerefentry><refentrytitle>glGetTexImage</refentrytitle></citerefentry>
298 </para>
299 </refsect1>
300 <refsect1 id="seealso"><title>See Also</title>
301 <para>
302 <citerefentry><refentrytitle>glCopyTexImage1D</refentrytitle></citerefentry>,
303 <citerefentry><refentrytitle>glCopyTexImage2D</refentrytitle></citerefentry>,
304 <citerefentry><refentrytitle>glCopyTexSubImage1D</refentrytitle></citerefentry>,
305 <citerefentry><refentrytitle>glCopyTexSubImage2D</refentrytitle></citerefentry>,
306 <citerefentry><refentrytitle>glPixelStore</refentrytitle></citerefentry>,
307 <citerefentry><refentrytitle>glReadBuffer</refentrytitle></citerefentry>,
308 <citerefentry><refentrytitle>glTexImage1D</refentrytitle></citerefentry>,
309 <citerefentry><refentrytitle>glTexImage2D</refentrytitle></citerefentry>,
310 <citerefentry><refentrytitle>glTexImage3D</refentrytitle></citerefentry>,
311 <citerefentry><refentrytitle>glTexParameter</refentrytitle></citerefentry>,
312 <citerefentry><refentrytitle>glTexSubImage1D</refentrytitle></citerefentry>,
313 <citerefentry><refentrytitle>glTexSubImage2D</refentrytitle></citerefentry>,
314 <citerefentry><refentrytitle>glTexSubImage3D</refentrytitle></citerefentry>
315 </para>
316 </refsect1>
317 <refsect1 id="Copyright"><title>Copyright</title>
318 <para>
319 Copyright <trademark class="copyright"></trademark> 1991-2006
320 Silicon Graphics, Inc. This document is licensed under the SGI
321 Free Software B License. For details, see
322 <ulink url="http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/</ulink>.
323 </para>
324 </refsect1>
325</refentry>