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>glCopyTexImage2D
</title><meta name=
"generator" content=
"DocBook XSL Stylesheets V1.73.2" /></head><body><div class=
"refentry" lang=
"en" xml:
lang=
"en"><a id=
"glCopyTexImage2D"></a><div class=
"titlepage"></div><div class=
"refnamediv"><h2>Name
</h2><p>glCopyTexImage2D — copy pixels into a
2D texture image
</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">glCopyTexImage2D
</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>GLenum
</td><td><var class=
"pdparam">internalformat
</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>,
</td></tr><tr><td> </td><td>GLint
</td><td><var class=
"pdparam">border
</var><code>)
</code>;
</td></tr></table></div></div><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>
4 Specifies the target texture.
5 Must be
<code class=
"constant">GL_TEXTURE_2D
</code>,
6 <code class=
"constant">GL_TEXTURE_CUBE_MAP_POSITIVE_X
</code>,
7 <code class=
"constant">GL_TEXTURE_CUBE_MAP_NEGATIVE_X
</code>,
8 <code class=
"constant">GL_TEXTURE_CUBE_MAP_POSITIVE_Y
</code>,
9 <code class=
"constant">GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
</code>,
10 <code class=
"constant">GL_TEXTURE_CUBE_MAP_POSITIVE_Z
</code>, or
11 <code class=
"constant">GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
</code>.
12 </p></dd><dt><span class=
"term"><em class=
"parameter"><code>level
</code></em></span></dt><dd><p>
13 Specifies the level-of-detail number.
14 Level
0 is the base image level.
15 Level
<span class=
"emphasis"><em>n
</em></span> is the
<span class=
"emphasis"><em>n
</em></span>th mipmap reduction image.
16 </p></dd><dt><span class=
"term"><em class=
"parameter"><code>internalformat
</code></em></span></dt><dd><p>
17 Specifies the internal format of the texture.
18 Must be one of the following symbolic constants:
19 <code class=
"constant">GL_ALPHA
</code>,
20 <code class=
"constant">GL_ALPHA4
</code>,
21 <code class=
"constant">GL_ALPHA8
</code>,
22 <code class=
"constant">GL_ALPHA12
</code>,
23 <code class=
"constant">GL_ALPHA16
</code>,
24 <code class=
"constant">GL_COMPRESSED_ALPHA
</code>,
25 <code class=
"constant">GL_COMPRESSED_LUMINANCE
</code>,
26 <code class=
"constant">GL_COMPRESSED_LUMINANCE_ALPHA
</code>,
27 <code class=
"constant">GL_COMPRESSED_INTENSITY
</code>,
28 <code class=
"constant">GL_COMPRESSED_RGB
</code>,
29 <code class=
"constant">GL_COMPRESSED_RGBA
</code>,
30 <code class=
"constant">GL_DEPTH_COMPONENT
</code>,
31 <code class=
"constant">GL_DEPTH_COMPONENT16
</code>,
32 <code class=
"constant">GL_DEPTH_COMPONENT24
</code>,
33 <code class=
"constant">GL_DEPTH_COMPONENT32
</code>,
34 <code class=
"constant">GL_LUMINANCE
</code>,
35 <code class=
"constant">GL_LUMINANCE4
</code>,
36 <code class=
"constant">GL_LUMINANCE8
</code>,
37 <code class=
"constant">GL_LUMINANCE12
</code>,
38 <code class=
"constant">GL_LUMINANCE16
</code>,
39 <code class=
"constant">GL_LUMINANCE_ALPHA
</code>,
40 <code class=
"constant">GL_LUMINANCE4_ALPHA4
</code>,
41 <code class=
"constant">GL_LUMINANCE6_ALPHA2
</code>,
42 <code class=
"constant">GL_LUMINANCE8_ALPHA8
</code>,
43 <code class=
"constant">GL_LUMINANCE12_ALPHA4
</code>,
44 <code class=
"constant">GL_LUMINANCE12_ALPHA12
</code>,
45 <code class=
"constant">GL_LUMINANCE16_ALPHA16
</code>,
46 <code class=
"constant">GL_INTENSITY
</code>,
47 <code class=
"constant">GL_INTENSITY4
</code>,
48 <code class=
"constant">GL_INTENSITY8
</code>,
49 <code class=
"constant">GL_INTENSITY12
</code>,
50 <code class=
"constant">GL_INTENSITY16
</code>,
51 <code class=
"constant">GL_RGB
</code>,
52 <code class=
"constant">GL_R3_G3_B2
</code>,
53 <code class=
"constant">GL_RGB4
</code>,
54 <code class=
"constant">GL_RGB5
</code>,
55 <code class=
"constant">GL_RGB8
</code>,
56 <code class=
"constant">GL_RGB10
</code>,
57 <code class=
"constant">GL_RGB12
</code>,
58 <code class=
"constant">GL_RGB16
</code>,
59 <code class=
"constant">GL_RGBA
</code>,
60 <code class=
"constant">GL_RGBA2
</code>,
61 <code class=
"constant">GL_RGBA4
</code>,
62 <code class=
"constant">GL_RGB5_A1
</code>,
63 <code class=
"constant">GL_RGBA8
</code>,
64 <code class=
"constant">GL_RGB10_A2
</code>,
65 <code class=
"constant">GL_RGBA12
</code>,
66 <code class=
"constant">GL_RGBA16
</code>,
67 <code class=
"constant">GL_SLUMINANCE
</code>,
68 <code class=
"constant">GL_SLUMINANCE8
</code>,
69 <code class=
"constant">GL_SLUMINANCE_ALPHA
</code>,
70 <code class=
"constant">GL_SLUMINANCE8_ALPHA8
</code>,
71 <code class=
"constant">GL_SRGB
</code>,
72 <code class=
"constant">GL_SRGB8
</code>,
73 <code class=
"constant">GL_SRGB_ALPHA
</code>, or
74 <code class=
"constant">GL_SRGB8_ALPHA8
</code>.
75 </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>
76 Specify the window coordinates of the lower left corner
77 of the rectangular region of pixels to be copied.
78 </p></dd><dt><span class=
"term"><em class=
"parameter"><code>width
</code></em></span></dt><dd><p>
79 Specifies the width of the texture image.
81 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
84 <mml:msup><mml:mn>2</mml:mn>
85 <mml:mi mathvariant=
"italic">n
</mml:mi>
91 <mml:mfenced open=
"(" close=
")">
92 <mml:mi mathvariant=
"italic">border
</mml:mi>
98 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll"><mml:mi mathvariant=
"italic">n
</mml:mi></mml:math>.
99 </p></dd><dt><span class=
"term"><em class=
"parameter"><code>height
</code></em></span></dt><dd><p>
100 Specifies the height of the texture image.
102 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
105 <mml:msup><mml:mn>2</mml:mn>
106 <mml:mi mathvariant=
"italic">m
</mml:mi>
112 <mml:mfenced open=
"(" close=
")">
113 <mml:mi mathvariant=
"italic">border
</mml:mi>
119 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll"><mml:mi mathvariant=
"italic">m
</mml:mi></mml:math>.
120 </p></dd><dt><span class=
"term"><em class=
"parameter"><code>border
</code></em></span></dt><dd><p>
121 Specifies the width of the border.
122 Must be either
0 or
1.
123 </p></dd></dl></div></div><div class=
"refsect1" lang=
"en" xml:
lang=
"en"><a id=
"description"></a><h2>Description
</h2><p>
124 <code class=
"function">glCopyTexImage2D
</code> defines a two-dimensional texture image, or cube-map texture image
125 with pixels from the current
126 <code class=
"constant">GL_READ_BUFFER
</code>.
128 The screen-aligned pixel rectangle with lower left corner at (
<em class=
"parameter"><code>x
</code></em>,
129 <em class=
"parameter"><code>y
</code></em>) and with a width of
130 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
133 <mml:mi mathvariant=
"italic">width
</mml:mi>
138 <mml:mfenced open=
"(" close=
")">
139 <mml:mi mathvariant=
"italic">border
</mml:mi>
145 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
148 <mml:mi mathvariant=
"italic">height
</mml:mi>
153 <mml:mfenced open=
"(" close=
")">
154 <mml:mi mathvariant=
"italic">border
</mml:mi>
159 defines the texture array
160 at the mipmap level specified by
<em class=
"parameter"><code>level
</code></em>.
161 <em class=
"parameter"><code>internalformat
</code></em> specifies the internal format of the texture array.
163 The pixels in the rectangle are processed exactly as if
164 <a class=
"citerefentry" href=
"glCopyPixels.xml"><span class=
"citerefentry"><span class=
"refentrytitle">glCopyPixels
</span></span></a> had been called, but the process stops just before
166 At this point all pixel component values are clamped to the range
167 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
169 <mml:mfenced open=
"[" close=
"]">
174 and then converted to the texture's internal format for storage in the texel
177 Pixel ordering is such that lower
178 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll"><mml:mi mathvariant=
"italic">x
</mml:mi></mml:math>
180 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll"><mml:mi mathvariant=
"italic">y
</mml:mi></mml:math>
181 screen coordinates correspond to
183 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll"><mml:mi mathvariant=
"italic">s
</mml:mi></mml:math>
185 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll"><mml:mi mathvariant=
"italic">t
</mml:mi></mml:math>
188 If any of the pixels within the specified rectangle of the current
189 <code class=
"constant">GL_READ_BUFFER
</code> are outside the window associated with the current
190 rendering context, then the values obtained for those pixels are undefined.
192 When
<em class=
"parameter"><code>internalformat
</code></em> is one of the sRGB types, the GL does not automatically convert the source pixels to the sRGB color space. In this case, the
<code class=
"function">glPixelMap
</code> function can be used to accomplish the conversion.
193 </p></div><div class=
"refsect1" lang=
"en" xml:
lang=
"en"><a id=
"notes"></a><h2>Notes
</h2><p>
194 <code class=
"function">glCopyTexImage2D
</code> is available only if the GL version is
1.1 or greater.
196 Texturing has no effect in color index mode.
198 1,
2,
3, and
4 are not accepted values for
<em class=
"parameter"><code>internalformat
</code></em>.
200 An image with height or width of
0 indicates a NULL texture.
202 When the
<code class=
"code">ARB_imaging
</code> extension is supported, the RGBA components read from the framebuffer may be processed by the imaging pipeline. See
<a class=
"citerefentry" href=
"glTexImage1D.xml"><span class=
"citerefentry"><span class=
"refentrytitle">glTexImage1D
</span></span></a> for specific details.
204 <code class=
"constant">GL_TEXTURE_CUBE_MAP_POSITIVE_X
</code>,
205 <code class=
"constant">GL_TEXTURE_CUBE_MAP_NEGATIVE_X
</code>,
206 <code class=
"constant">GL_TEXTURE_CUBE_MAP_POSITIVE_Y
</code>,
207 <code class=
"constant">GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
</code>,
208 <code class=
"constant">GL_TEXTURE_CUBE_MAP_POSITIVE_Z
</code>,
209 <code class=
"constant">GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
</code>, or
210 <code class=
"constant">GL_PROXY_TEXTURE_CUBE_MAP
</code> are available only if the GL version is
1.3
213 <code class=
"constant">GL_DEPTH_COMPONENT
</code>,
<code class=
"constant">GL_DEPTH_COMPONENT16
</code>,
<code class=
"constant">GL_DEPTH_COMPONENT24
</code>,
214 and
<code class=
"constant">GL_DEPTH_COMPONENT32
</code> are available only if the GL version is
1.4
218 <code class=
"constant">GL_SRGB
</code>,
219 <code class=
"constant">GL_SRGB8
</code>,
220 <code class=
"constant">GL_SRGB_ALPHA
</code>,
221 <code class=
"constant">GL_SRGB8_ALPHA8
</code>,
222 <code class=
"constant">GL_SLUMINANCE
</code>,
223 <code class=
"constant">GL_SLUMINANCE8
</code>,
224 <code class=
"constant">GL_SLUMINANCE_ALPHA
</code>, and
225 <code class=
"constant">GL_SLUMINANCE8_ALPHA8
</code>
226 internal formats are only available if the GL version is
2.1 or greater. See
<a class=
"citerefentry" href=
"glTexImage2D.xml"><span class=
"citerefentry"><span class=
"refentrytitle">glTexImage2D
</span></span></a> for specific details about sRGB conversion.
227 </p></div><div class=
"refsect1" lang=
"en" xml:
lang=
"en"><a id=
"errors"></a><h2>Errors
</h2><p>
228 <code class=
"constant">GL_INVALID_ENUM
</code> is generated if
<em class=
"parameter"><code>target
</code></em> is not
<code class=
"constant">GL_TEXTURE_2D
</code>,
229 <code class=
"constant">GL_TEXTURE_CUBE_MAP_POSITIVE_X
</code>,
230 <code class=
"constant">GL_TEXTURE_CUBE_MAP_NEGATIVE_X
</code>,
231 <code class=
"constant">GL_TEXTURE_CUBE_MAP_POSITIVE_Y
</code>,
232 <code class=
"constant">GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
</code>,
233 <code class=
"constant">GL_TEXTURE_CUBE_MAP_POSITIVE_Z
</code>, or
234 <code class=
"constant">GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
</code>.
236 <code class=
"constant">GL_INVALID_VALUE
</code> is generated if
<em class=
"parameter"><code>level
</code></em> is less than
0.
238 <code class=
"constant">GL_INVALID_VALUE
</code> may be generated if
<em class=
"parameter"><code>level
</code></em> is greater
240 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
243 <mml:msub><mml:mi mathvariant=
"italic">log
</mml:mi>
247 <mml:mi mathvariant=
"italic">max
</mml:mi>
251 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll"><mml:mi mathvariant=
"italic">max
</mml:mi></mml:math>
252 is the returned value of
<code class=
"constant">GL_MAX_TEXTURE_SIZE
</code>.
254 <code class=
"constant">GL_INVALID_VALUE
</code> is generated if
<em class=
"parameter"><code>width
</code></em> is less than
0
256 2 +
<code class=
"constant">GL_MAX_TEXTURE_SIZE
</code>.
258 <code class=
"constant">GL_INVALID_VALUE
</code> is generated if non-power-of-two textures are not supported and the
<em class=
"parameter"><code>width
</code></em> or
<em class=
"parameter"><code>depth
</code></em> cannot be represented as
259 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
262 <mml:msup><mml:mn>2</mml:mn>
263 <mml:mi mathvariant=
"italic">k
</mml:mi>
269 <mml:mfenced open=
"(" close=
")">
270 <mml:mi mathvariant=
"italic">border
</mml:mi>
276 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll"><mml:mi mathvariant=
"italic">k
</mml:mi></mml:math>.
278 <code class=
"constant">GL_INVALID_VALUE
</code> is generated if
<em class=
"parameter"><code>border
</code></em> is not
0 or
1.
280 <code class=
"constant">GL_INVALID_VALUE
</code> is generated if
<em class=
"parameter"><code>internalformat
</code></em> is not an
283 <code class=
"constant">GL_INVALID_OPERATION
</code> is generated if
<code class=
"function">glCopyTexImage2D
</code> is executed
284 between the execution of
<a class=
"citerefentry" href=
"glBegin.xml"><span class=
"citerefentry"><span class=
"refentrytitle">glBegin
</span></span></a> and the corresponding
285 execution of
<a class=
"citerefentry" href=
"glEnd.xml"><span class=
"citerefentry"><span class=
"refentrytitle">glEnd
</span></span></a>.
287 <code class=
"constant">GL_INVALID_OPERATION
</code> is generated if
<em class=
"parameter"><code>internalformat
</code></em> is
288 <code class=
"constant">GL_DEPTH_COMPONENT
</code>,
<code class=
"constant">GL_DEPTH_COMPONENT16
</code>,
289 <code class=
"constant">GL_DEPTH_COMPONENT24
</code>, or
<code class=
"constant">GL_DEPTH_COMPONENT32
</code> and there is no depth
291 </p></div><div class=
"refsect1" lang=
"en" xml:
lang=
"en"><a id=
"associatedgets"></a><h2>Associated Gets
</h2><p>
292 <a class=
"citerefentry" href=
"glGetTexImage.xml"><span class=
"citerefentry"><span class=
"refentrytitle">glGetTexImage
</span></span></a>
294 <a class=
"citerefentry" href=
"glIsEnabled.xml"><span class=
"citerefentry"><span class=
"refentrytitle">glIsEnabled
</span></span></a> with argument
<code class=
"constant">GL_TEXTURE_2D
</code> or
<code class=
"constant">GL_TEXTURE_CUBE_MAP
</code>
295 </p></div><div class=
"refsect1" lang=
"en" xml:
lang=
"en"><a id=
"seealso"></a><h2>See Also
</h2><p>
296 <a class=
"citerefentry" href=
"glCopyPixels.xml"><span class=
"citerefentry"><span class=
"refentrytitle">glCopyPixels
</span></span></a>,
297 <a class=
"citerefentry" href=
"glCopyTexImage1D.xml"><span class=
"citerefentry"><span class=
"refentrytitle">glCopyTexImage1D
</span></span></a>,
298 <a class=
"citerefentry" href=
"glCopyTexSubImage1D.xml"><span class=
"citerefentry"><span class=
"refentrytitle">glCopyTexSubImage1D
</span></span></a>,
299 <a class=
"citerefentry" href=
"glCopyTexSubImage2D.xml"><span class=
"citerefentry"><span class=
"refentrytitle">glCopyTexSubImage2D
</span></span></a>,
300 <a class=
"citerefentry" href=
"glPixelStore.xml"><span class=
"citerefentry"><span class=
"refentrytitle">glPixelStore
</span></span></a>,
301 <a class=
"citerefentry" href=
"glPixelTransfer.xml"><span class=
"citerefentry"><span class=
"refentrytitle">glPixelTransfer
</span></span></a>,
302 <a class=
"citerefentry" href=
"glTexEnv.xml"><span class=
"citerefentry"><span class=
"refentrytitle">glTexEnv
</span></span></a>,
303 <a class=
"citerefentry" href=
"glTexGen.xml"><span class=
"citerefentry"><span class=
"refentrytitle">glTexGen
</span></span></a>,
304 <a class=
"citerefentry" href=
"glTexImage1D.xml"><span class=
"citerefentry"><span class=
"refentrytitle">glTexImage1D
</span></span></a>,
305 <a class=
"citerefentry" href=
"glTexImage2D.xml"><span class=
"citerefentry"><span class=
"refentrytitle">glTexImage2D
</span></span></a>,
306 <a class=
"citerefentry" href=
"glTexSubImage1D.xml"><span class=
"citerefentry"><span class=
"refentrytitle">glTexSubImage1D
</span></span></a>,
307 <a class=
"citerefentry" href=
"glTexSubImage2D.xml"><span class=
"citerefentry"><span class=
"refentrytitle">glTexSubImage2D
</span></span></a>,
308 <a class=
"citerefentry" href=
"glTexParameter.xml"><span class=
"citerefentry"><span class=
"refentrytitle">glTexParameter
</span></span></a>
309 </p></div><div class=
"refsect1" lang=
"en" xml:
lang=
"en"><a id=
"Copyright"></a><h2>Copyright
</h2><p>
310 Copyright
<span class=
"trademark"></span>©
1991-
2006
311 Silicon Graphics, Inc. This document is licensed under the SGI
312 Free Software B License. For details, see
313 <a class=
"ulink" href=
"http://oss.sgi.com/projects/FreeB/" target=
"_top">http://oss.sgi.com/projects/FreeB/
</a>.
314 </p></div></div></body></html>