Commit | Line | Data |
---|---|---|
7faf1d71 AW |
1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "xhtml1-transitional.dtd"> | |
3 | <!-- saved from url=(0013)about:internet --> | |
4 | <?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" /><link rel="stylesheet" type="text/css" href="opengl-man.css" /><title>glCopyTexSubImage3D - OpenGL 3.3 Reference Pages</title><meta name="generator" content="DocBook XSL Stylesheets V1.69.1" /></head><body><div class="refentry" lang="en" xml:lang="en"><a id="glCopyTexSubImage3D"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>glCopyTexSubImage3D — copy a three-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">glCopyTexSubImage3D</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>GLint </td><td><var class="pdparam">yoffset</var>, </td></tr><tr><td> </td><td>GLint </td><td><var class="pdparam">zoffset</var>, </td></tr><tr><td> </td><td>GLint </td><td><var class="pdparam">x</var>, </td></tr><tr><td> </td><td>GLint </td><td><var class="pdparam">y</var>, </td></tr><tr><td> </td><td>GLsizei </td><td><var class="pdparam">width</var>, </td></tr><tr><td> </td><td>GLsizei </td><td><var class="pdparam">height</var><code>)</code>;</td></tr></table></div></div><p> | |
5 | </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> | |
6 | Specifies the target texture. | |
7 | Must be <code class="constant">GL_TEXTURE_3D</code> or <code class="constant">GL_TEXTURE_2D_ARRAY</code>. | |
8 | </p></dd><dt><span class="term"><em class="parameter"><code>level</code></em></span></dt><dd><p> | |
9 | Specifies the level-of-detail number. | |
10 | Level 0 is the base image level. | |
11 | Level <span class="emphasis"><em>n</em></span> is the <span class="emphasis"><em>n</em></span>th mipmap reduction image. | |
12 | </p></dd><dt><span class="term"><em class="parameter"><code>xoffset</code></em></span></dt><dd><p> | |
13 | Specifies a texel offset in the x direction within the texture array. | |
14 | </p></dd><dt><span class="term"><em class="parameter"><code>yoffset</code></em></span></dt><dd><p> | |
15 | Specifies a texel offset in the y direction within the texture array. | |
16 | </p></dd><dt><span class="term"><em class="parameter"><code>zoffset</code></em></span></dt><dd><p> | |
17 | Specifies a texel offset in the z direction within the texture array. | |
18 | </p></dd><dt><span class="term"><em class="parameter"><code>x</code></em>, </span><span class="term"><em class="parameter"><code>y</code></em></span></dt><dd><p> | |
19 | Specify the window coordinates of the lower left corner | |
20 | of the rectangular region of pixels to be copied. | |
21 | </p></dd><dt><span class="term"><em class="parameter"><code>width</code></em></span></dt><dd><p> | |
22 | Specifies the width of the texture subimage. | |
23 | </p></dd><dt><span class="term"><em class="parameter"><code>height</code></em></span></dt><dd><p> | |
24 | Specifies the height of the texture subimage. | |
25 | </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="description"></a><h2>Description</h2><p> | |
26 | <code class="function">glCopyTexSubImage3D</code> replaces a rectangular portion of a three-dimensional | |
27 | or two-dimensional array texture image with pixels from the current <code class="constant">GL_READ_BUFFER</code> (rather | |
28 | than from main memory, as is the case for <a href="glTexSubImage3D.xml"><span class="citerefentry"><span class="refentrytitle">glTexSubImage3D</span></span></a>). | |
29 | </p><p> | |
30 | The screen-aligned pixel rectangle with lower left corner at | |
31 | (<em class="parameter"><code>x</code></em>, <em class="parameter"><code>y</code></em>) and with | |
32 | width <em class="parameter"><code>width</code></em> and height <em class="parameter"><code>height</code></em> replaces the portion of the | |
33 | texture array with x indices <em class="parameter"><code>xoffset</code></em> through | |
34 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
35 | ||
36 | <mml:mrow> | |
37 | <mml:mi mathvariant="italic">xoffset</mml:mi> | |
38 | <mml:mo>+</mml:mo> | |
39 | <mml:mi mathvariant="italic">width</mml:mi> | |
40 | <mml:mo>-</mml:mo> | |
41 | <mml:mn>1</mml:mn> | |
42 | </mml:mrow> | |
43 | </mml:math>, | |
44 | inclusive, and y indices <em class="parameter"><code>yoffset</code></em> through | |
45 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
46 | ||
47 | <mml:mrow> | |
48 | <mml:mi mathvariant="italic">yoffset</mml:mi> | |
49 | <mml:mo>+</mml:mo> | |
50 | <mml:mi mathvariant="italic">height</mml:mi> | |
51 | <mml:mo>-</mml:mo> | |
52 | <mml:mn>1</mml:mn> | |
53 | </mml:mrow> | |
54 | </mml:math>, | |
55 | inclusive, at z index <em class="parameter"><code>zoffset</code></em> and at the mipmap level specified by <em class="parameter"><code>level</code></em>. | |
56 | </p><p> | |
57 | The pixels in the rectangle are processed exactly as if | |
58 | <a href="glReadPixels.xml"><span class="citerefentry"><span class="refentrytitle">glReadPixels</span></span></a> had been called, but the process stops just before | |
59 | final conversion. | |
60 | At this point, all pixel component values are clamped to the range | |
61 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
62 | ||
63 | <mml:mfenced open="[" close="]"> | |
64 | <mml:mn>0</mml:mn> | |
65 | <mml:mn>1</mml:mn> | |
66 | </mml:mfenced> | |
67 | </mml:math> | |
68 | and then converted to the texture's internal format for storage in the texel | |
69 | array. | |
70 | </p><p> | |
71 | The destination rectangle in the texture array may not include any texels | |
72 | outside the texture array as it was originally specified. | |
73 | It is not an error to specify a subtexture with zero width or height, but | |
74 | such a specification has no effect. | |
75 | </p><p> | |
76 | If any of the pixels within the specified rectangle of the current | |
77 | <code class="constant">GL_READ_BUFFER</code> are outside the read window associated with the current | |
78 | rendering context, then the values obtained for those pixels are undefined. | |
79 | </p><p> | |
80 | No change is made to the <span class="emphasis"><em>internalformat</em></span>, <span class="emphasis"><em>width</em></span>, | |
81 | <span class="emphasis"><em>height</em></span>, <span class="emphasis"><em>depth</em></span>, or <span class="emphasis"><em>border</em></span> parameters of the specified texture | |
82 | array or to texel values outside the specified subregion. | |
83 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="notes"></a><h2>Notes</h2><p> | |
84 | <a href="glPixelStore.xml"><span class="citerefentry"><span class="refentrytitle">glPixelStore</span></span></a> modes affect texture images. | |
85 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="errors"></a><h2>Errors</h2><p> | |
86 | <code class="constant">GL_INVALID_ENUM</code> is generated if /<em class="parameter"><code>target</code></em> is not <code class="constant">GL_TEXTURE_3D</code>. | |
87 | </p><p> | |
88 | <code class="constant">GL_INVALID_OPERATION</code> is generated if the texture array has not | |
89 | been defined by a previous <a href="glTexImage3D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage3D</span></span></a> operation. | |
90 | </p><p> | |
91 | <code class="constant">GL_INVALID_VALUE</code> is generated if <em class="parameter"><code>level</code></em> is less than 0. | |
92 | </p><p> | |
93 | <code class="constant">GL_INVALID_VALUE</code> may be generated if | |
94 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
95 | ||
96 | <mml:mrow> | |
97 | <mml:mi mathvariant="italic">level</mml:mi> | |
98 | <mml:mo>></mml:mo> | |
99 | <mml:mrow> | |
100 | <mml:msub><mml:mi mathvariant="italic">log</mml:mi> | |
101 | <mml:mn>2</mml:mn> | |
102 | </mml:msub> | |
103 | <mml:mo></mml:mo> | |
104 | <mml:mfenced open="(" close=")"> | |
105 | <mml:mi mathvariant="italic">max</mml:mi> | |
106 | </mml:mfenced> | |
107 | </mml:mrow> | |
108 | </mml:mrow> | |
109 | </mml:math>, | |
110 | where | |
111 | is the returned value of <code class="constant">GL_MAX_3D_TEXTURE_SIZE</code> if <em class="parameter"><code>target</code></em> | |
112 | is <code class="constant">GL_TEXTURE_3D</code> or the returned value of <code class="constant">GL_MAX_ARRAY_TEXTURE_LAYERS</code> | |
113 | if <em class="parameter"><code>target</code></em> is <code class="constant">GL_TEXTURE_2D_ARRAY</code>. | |
114 | </p><p> | |
115 | <code class="constant">GL_INVALID_VALUE</code> is generated if | |
116 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
117 | ||
118 | <mml:mrow> | |
119 | <mml:mi mathvariant="italic">xoffset</mml:mi> | |
120 | <mml:mo><</mml:mo> | |
121 | <mml:mrow> | |
122 | <mml:mo>-</mml:mo> | |
123 | <mml:mi mathvariant="italic">b</mml:mi> | |
124 | </mml:mrow> | |
125 | </mml:mrow> | |
126 | </mml:math>, | |
127 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
128 | ||
129 | <mml:mrow> | |
130 | <mml:mfenced open="(" close=")"> | |
131 | <mml:mrow> | |
132 | <mml:mi mathvariant="italic">xoffset</mml:mi> | |
133 | <mml:mo>+</mml:mo> | |
134 | <mml:mi mathvariant="italic">width</mml:mi> | |
135 | </mml:mrow> | |
136 | </mml:mfenced> | |
137 | <mml:mo>></mml:mo> | |
138 | <mml:mfenced open="(" close=")"> | |
139 | <mml:mrow> | |
140 | <mml:mi mathvariant="italic">w</mml:mi> | |
141 | <mml:mo>-</mml:mo> | |
142 | <mml:mi mathvariant="italic">b</mml:mi> | |
143 | </mml:mrow> | |
144 | </mml:mfenced> | |
145 | </mml:mrow> | |
146 | </mml:math>, | |
147 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
148 | ||
149 | <mml:mrow> | |
150 | <mml:mi mathvariant="italic">yoffset</mml:mi> | |
151 | <mml:mo><</mml:mo> | |
152 | <mml:mrow> | |
153 | <mml:mo>-</mml:mo> | |
154 | <mml:mi mathvariant="italic">b</mml:mi> | |
155 | </mml:mrow> | |
156 | </mml:mrow> | |
157 | </mml:math>, | |
158 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
159 | ||
160 | <mml:mrow> | |
161 | <mml:mfenced open="(" close=")"> | |
162 | <mml:mrow> | |
163 | <mml:mi mathvariant="italic">yoffset</mml:mi> | |
164 | <mml:mo>+</mml:mo> | |
165 | <mml:mi mathvariant="italic">height</mml:mi> | |
166 | </mml:mrow> | |
167 | </mml:mfenced> | |
168 | <mml:mo>></mml:mo> | |
169 | <mml:mfenced open="(" close=")"> | |
170 | <mml:mrow> | |
171 | <mml:mi mathvariant="italic">h</mml:mi> | |
172 | <mml:mo>-</mml:mo> | |
173 | <mml:mi mathvariant="italic">b</mml:mi> | |
174 | </mml:mrow> | |
175 | </mml:mfenced> | |
176 | </mml:mrow> | |
177 | </mml:math>, | |
178 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
179 | ||
180 | <mml:mrow> | |
181 | <mml:mi mathvariant="italic">zoffset</mml:mi> | |
182 | <mml:mo><</mml:mo> | |
183 | <mml:mrow> | |
184 | <mml:mo>-</mml:mo> | |
185 | <mml:mi mathvariant="italic">b</mml:mi> | |
186 | </mml:mrow> | |
187 | </mml:mrow> | |
188 | </mml:math>, | |
189 | or | |
190 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
191 | ||
192 | <mml:mrow> | |
193 | <mml:mfenced open="(" close=")"> | |
194 | <mml:mrow> | |
195 | <mml:mi mathvariant="italic">zoffset</mml:mi> | |
196 | <mml:mo>+</mml:mo> | |
197 | <mml:mn>1</mml:mn> | |
198 | </mml:mrow> | |
199 | </mml:mfenced> | |
200 | <mml:mo>></mml:mo> | |
201 | <mml:mfenced open="(" close=")"> | |
202 | <mml:mrow> | |
203 | <mml:mi mathvariant="italic">d</mml:mi> | |
204 | <mml:mo>-</mml:mo> | |
205 | <mml:mi mathvariant="italic">b</mml:mi> | |
206 | </mml:mrow> | |
207 | </mml:mfenced> | |
208 | </mml:mrow> | |
209 | </mml:math>, | |
210 | where | |
211 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">w</mml:mi></mml:math> | |
212 | is the <code class="constant">GL_TEXTURE_WIDTH</code>, | |
213 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">h</mml:mi></mml:math> | |
214 | is the <code class="constant">GL_TEXTURE_HEIGHT</code>, | |
215 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">d</mml:mi></mml:math> | |
216 | is the <code class="constant">GL_TEXTURE_DEPTH</code>, | |
217 | and | |
218 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">b</mml:mi></mml:math> | |
219 | is the <code class="constant">GL_TEXTURE_BORDER</code> | |
220 | of the texture image being modified. | |
221 | Note that | |
222 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">w</mml:mi></mml:math>, | |
223 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">h</mml:mi></mml:math>, | |
224 | and | |
225 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">d</mml:mi></mml:math> | |
226 | include twice the border width. | |
227 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="associatedgets"></a><h2>Associated Gets</h2><p> | |
228 | <a href="glGetTexImage.xml"><span class="citerefentry"><span class="refentrytitle">glGetTexImage</span></span></a> | |
229 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p> | |
230 | <a href="glCopyTexImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexImage1D</span></span></a>, | |
231 | <a href="glCopyTexImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexImage2D</span></span></a>, | |
232 | <a href="glCopyTexSubImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexSubImage1D</span></span></a>, | |
233 | <a href="glCopyTexSubImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexSubImage2D</span></span></a>, | |
234 | <a href="glPixelStore.xml"><span class="citerefentry"><span class="refentrytitle">glPixelStore</span></span></a>, | |
235 | <a href="glReadBuffer.xml"><span class="citerefentry"><span class="refentrytitle">glReadBuffer</span></span></a>, | |
236 | <a href="glTexImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage1D</span></span></a>, | |
237 | <a href="glTexImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage2D</span></span></a>, | |
238 | <a href="glTexImage3D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage3D</span></span></a>, | |
239 | <a href="glTexParameter.xml"><span class="citerefentry"><span class="refentrytitle">glTexParameter</span></span></a>, | |
240 | <a href="glTexSubImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glTexSubImage1D</span></span></a>, | |
241 | <a href="glTexSubImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glTexSubImage2D</span></span></a>, | |
242 | <a 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 href="http://oss.sgi.com/projects/FreeB/" target="_top">http://oss.sgi.com/projects/FreeB/</a>. | |
248 | </p></div></div></body></html> |