update upstream sources
[clinton/guile-figl.git] / upstream-doc / man4 / glCopyTexImage2D.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="glCopyTexImage2D">
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>glCopyTexImage2D</refentrytitle>
13 <manvolnum>3G</manvolnum>
14 </refmeta>
15 <refnamediv>
16 <refname>glCopyTexImage2D</refname>
17 <refpurpose>copy pixels into a 2D texture image</refpurpose>
18 </refnamediv>
19 <refsynopsisdiv><title>C Specification</title>
20 <funcsynopsis>
21 <funcprototype>
22 <funcdef>void <function>glCopyTexImage2D</function></funcdef>
23 <paramdef>GLenum <parameter>target</parameter></paramdef>
24 <paramdef>GLint <parameter>level</parameter></paramdef>
25 <paramdef>GLenum <parameter>internalformat</parameter></paramdef>
26 <paramdef>GLint <parameter>x</parameter></paramdef>
27 <paramdef>GLint <parameter>y</parameter></paramdef>
28 <paramdef>GLsizei <parameter>width</parameter></paramdef>
29 <paramdef>GLsizei <parameter>height</parameter></paramdef>
30 <paramdef>GLint <parameter>border</parameter></paramdef>
31 </funcprototype>
32 </funcsynopsis>
33 </refsynopsisdiv>
34 <!-- eqn: ignoring delim $$ -->
35 <refsect1 id="parameters"><title>Parameters</title>
36 <variablelist>
37 <varlistentry>
38 <term><parameter>target</parameter></term>
39 <listitem>
40 <para>
41 Specifies the target texture.
42 Must be <constant>GL_TEXTURE_2D</constant>,
43 <constant>GL_TEXTURE_CUBE_MAP_POSITIVE_X</constant>,
44 <constant>GL_TEXTURE_CUBE_MAP_NEGATIVE_X</constant>,
45 <constant>GL_TEXTURE_CUBE_MAP_POSITIVE_Y</constant>,
46 <constant>GL_TEXTURE_CUBE_MAP_NEGATIVE_Y</constant>,
47 <constant>GL_TEXTURE_CUBE_MAP_POSITIVE_Z</constant>, or
48 <constant>GL_TEXTURE_CUBE_MAP_NEGATIVE_Z</constant>.
49 </para>
50 </listitem>
51 </varlistentry>
52 <varlistentry>
53 <term><parameter>level</parameter></term>
54 <listitem>
55 <para>
56 Specifies the level-of-detail number.
57 Level 0 is the base image level.
58 Level <emphasis>n</emphasis> is the <emphasis>n</emphasis>th mipmap reduction image.
59 </para>
60 </listitem>
61 </varlistentry>
62 <varlistentry>
63 <term><parameter>internalformat</parameter></term>
64 <listitem>
65 <para>
66 Specifies the internal format of the texture.
67 Must be one of the following symbolic constants:
68 <constant>GL_COMPRESSED_RED</constant>,
69 <constant>GL_COMPRESSED_RG</constant>,
70 <constant>GL_COMPRESSED_RGB</constant>,
71 <constant>GL_COMPRESSED_RGBA</constant>.
72 <constant>GL_COMPRESSED_SRGB</constant>,
73 <constant>GL_COMPRESSED_SRGB_ALPHA</constant>.
74 <constant>GL_DEPTH_COMPONENT</constant>,
75 <constant>GL_DEPTH_COMPONENT16</constant>,
76 <constant>GL_DEPTH_COMPONENT24</constant>,
77 <constant>GL_DEPTH_COMPONENT32</constant>,
78 <constant>GL_RED</constant>,
79 <constant>GL_RG</constant>,
80 <constant>GL_RGB</constant>,
81 <constant>GL_R3_G3_B2</constant>,
82 <constant>GL_RGB4</constant>,
83 <constant>GL_RGB5</constant>,
84 <constant>GL_RGB8</constant>,
85 <constant>GL_RGB10</constant>,
86 <constant>GL_RGB12</constant>,
87 <constant>GL_RGB16</constant>,
88 <constant>GL_RGBA</constant>,
89 <constant>GL_RGBA2</constant>,
90 <constant>GL_RGBA4</constant>,
91 <constant>GL_RGB5_A1</constant>,
92 <constant>GL_RGBA8</constant>,
93 <constant>GL_RGB10_A2</constant>,
94 <constant>GL_RGBA12</constant>,
95 <constant>GL_RGBA16</constant>,
96 <constant>GL_SRGB</constant>,
97 <constant>GL_SRGB8</constant>,
98 <constant>GL_SRGB_ALPHA</constant>, or
99 <constant>GL_SRGB8_ALPHA8</constant>.
100 </para>
101 </listitem>
102 </varlistentry>
103 <varlistentry>
104 <term><parameter>x</parameter></term>
105 <term><parameter>y</parameter></term>
106 <listitem>
107 <para>
108 Specify the window coordinates of the lower left corner
109 of the rectangular region of pixels to be copied.
110 </para>
111 </listitem>
112 </varlistentry>
113 <varlistentry>
114 <term><parameter>width</parameter></term>
115 <listitem>
116 <para>
117 Specifies the width of the texture image.
7faf1d71
AW
118 </para>
119 </listitem>
120 </varlistentry>
121 <varlistentry>
122 <term><parameter>height</parameter></term>
123 <listitem>
124 <para>
125 Specifies the height of the texture image.
7faf1d71
AW
126 </para>
127 </listitem>
128 </varlistentry>
129 <varlistentry>
130 <term><parameter>border</parameter></term>
131 <listitem>
132 <para>
c7b31271 133 Must be 0.
7faf1d71
AW
134 </para>
135 </listitem>
136 </varlistentry>
137 </variablelist>
138 </refsect1>
139 <refsect1 id="description"><title>Description</title>
140 <para>
141 <function>glCopyTexImage2D</function> defines a two-dimensional texture image, or cube-map texture image
142 with pixels from the current
143 <constant>GL_READ_BUFFER</constant>.
144 </para>
145 <para>
146 The screen-aligned pixel rectangle with lower left corner at (<parameter>x</parameter>,
147 <parameter>y</parameter>) and with a width of
148 <inlineequation><mml:math>
c7b31271 149 <mml:mi mathvariant="italic">width</mml:mi>
7faf1d71
AW
150 </mml:math></inlineequation>
151 and a height of
152 <inlineequation><mml:math>
c7b31271 153 <mml:mi mathvariant="italic">height</mml:mi>
7faf1d71
AW
154 </mml:math></inlineequation>
155 defines the texture array
156 at the mipmap level specified by <parameter>level</parameter>.
157 <parameter>internalformat</parameter> specifies the internal format of the texture array.
158 </para>
159 <para>
160 The pixels in the rectangle are processed exactly as if
161 <citerefentry><refentrytitle>glReadPixels</refentrytitle></citerefentry> had been called, but the process stops just before
162 final conversion.
163 At this point all pixel component values are clamped to the range
164 <inlineequation><mml:math>
165 <!-- eqn: [0,1]: -->
166 <mml:mfenced open="[" close="]">
167 <mml:mn>0</mml:mn>
168 <mml:mn>1</mml:mn>
169 </mml:mfenced>
170 </mml:math></inlineequation>
171 and then converted to the texture's internal format for storage in the texel
172 array.
173 </para>
174 <para>
175 Pixel ordering is such that lower
176 <inlineequation><mml:math><mml:mi mathvariant="italic">x</mml:mi></mml:math></inlineequation>
177 and
178 <inlineequation><mml:math><mml:mi mathvariant="italic">y</mml:mi></mml:math></inlineequation>
179 screen coordinates correspond to
180 lower
181 <inlineequation><mml:math><mml:mi mathvariant="italic">s</mml:mi></mml:math></inlineequation>
182 and
183 <inlineequation><mml:math><mml:mi mathvariant="italic">t</mml:mi></mml:math></inlineequation>
184 texture coordinates.
185 </para>
186 <para>
187 If any of the pixels within the specified rectangle of the current
188 <constant>GL_READ_BUFFER</constant> are outside the window associated with the current
189 rendering context, then the values obtained for those pixels are undefined.
190 </para>
191 <para>
192 When <parameter>internalformat</parameter> is one of the sRGB types, the GL does not automatically convert the source pixels to the sRGB color space. In this case, the <function>glPixelMap</function> function can be used to accomplish the conversion.
193 </para>
194 </refsect1>
195 <refsect1 id="notes"><title>Notes</title>
196 <para>
197 1, 2, 3, and 4 are not accepted values for <parameter>internalformat</parameter>.
198 </para>
199 <para>
200 An image with height or width of 0 indicates a NULL texture.
201 </para>
202 </refsect1>
203 <refsect1 id="errors"><title>Errors</title>
204 <para>
205 <constant>GL_INVALID_ENUM</constant> is generated if <parameter>target</parameter> is not <constant>GL_TEXTURE_2D</constant>,
206 <constant>GL_TEXTURE_CUBE_MAP_POSITIVE_X</constant>,
207 <constant>GL_TEXTURE_CUBE_MAP_NEGATIVE_X</constant>,
208 <constant>GL_TEXTURE_CUBE_MAP_POSITIVE_Y</constant>,
209 <constant>GL_TEXTURE_CUBE_MAP_NEGATIVE_Y</constant>,
210 <constant>GL_TEXTURE_CUBE_MAP_POSITIVE_Z</constant>, or
211 <constant>GL_TEXTURE_CUBE_MAP_NEGATIVE_Z</constant>.
212 </para>
213 <para>
214 <constant>GL_INVALID_VALUE</constant> is generated if <parameter>level</parameter> is less than 0.
215 </para>
216 <para>
217 <constant>GL_INVALID_VALUE</constant> may be generated if <parameter>level</parameter> is greater
218 than
219 <inlineequation><mml:math>
220 <!-- eqn: log sub 2 max: -->
221 <mml:mrow>
222 <mml:msub><mml:mi mathvariant="italic">log</mml:mi>
223 <mml:mn>2</mml:mn>
224 </mml:msub>
225 <mml:mo>&it;</mml:mo>
226 <mml:mi mathvariant="italic">max</mml:mi>
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 <parameter>width</parameter> is less than 0
235 or greater than
236 <constant>GL_MAX_TEXTURE_SIZE</constant>.
237 </para>
238 <para>
c7b31271 239 <constant>GL_INVALID_VALUE</constant> is generated if <parameter>border</parameter> is not 0.
7faf1d71
AW
240 </para>
241 <para>
242 <constant>GL_INVALID_VALUE</constant> is generated if <parameter>internalformat</parameter> is not an
243 accepted format.
244 </para>
245 <para>
246 <constant>GL_INVALID_OPERATION</constant> is generated if <parameter>internalformat</parameter> is
247 <constant>GL_DEPTH_COMPONENT</constant>, <constant>GL_DEPTH_COMPONENT16</constant>,
248 <constant>GL_DEPTH_COMPONENT24</constant>, or <constant>GL_DEPTH_COMPONENT32</constant> and there is no depth
249 buffer.
250 </para>
251 </refsect1>
252 <refsect1 id="associatedgets"><title>Associated Gets</title>
253 <para>
254 <citerefentry><refentrytitle>glGetTexImage</refentrytitle></citerefentry>
255 </para>
256 </refsect1>
257 <refsect1 id="seealso"><title>See Also</title>
258 <para>
259 <citerefentry><refentrytitle>glCopyTexImage1D</refentrytitle></citerefentry>,
260 <citerefentry><refentrytitle>glCopyTexSubImage1D</refentrytitle></citerefentry>,
261 <citerefentry><refentrytitle>glCopyTexSubImage2D</refentrytitle></citerefentry>,
262 <citerefentry><refentrytitle>glPixelStore</refentrytitle></citerefentry>,
263 <citerefentry><refentrytitle>glTexImage1D</refentrytitle></citerefentry>,
264 <citerefentry><refentrytitle>glTexImage2D</refentrytitle></citerefentry>,
265 <citerefentry><refentrytitle>glTexSubImage1D</refentrytitle></citerefentry>,
266 <citerefentry><refentrytitle>glTexSubImage2D</refentrytitle></citerefentry>,
267 <citerefentry><refentrytitle>glTexParameter</refentrytitle></citerefentry>
268 </para>
269 </refsect1>
270 <refsect1 id="Copyright"><title>Copyright</title>
271 <para>
272 Copyright <trademark class="copyright"></trademark> 1991-2006
c7b31271
DH
273 Silicon Graphics, Inc.
274 Copyright <trademark class="copyright"></trademark> 2012-2013 Khronos Group.
275 This document is licensed under the SGI
7faf1d71
AW
276 Free Software B License. For details, see
277 <ulink url="http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/</ulink>.
278 </para>
279 </refsect1>
280</refentry>