Commit | Line | Data |
---|---|---|
7faf1d71 AW |
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>glCopyPixels</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /></head><body><div class="refentry" lang="en" xml:lang="en"><a id="glCopyPixels"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>glCopyPixels — copy pixels in the frame buffer</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">glCopyPixels</b>(</code></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>GLenum </td><td><var class="pdparam">type</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>x</code></em>, </span><span class="term"><em class="parameter"><code>y</code></em></span></dt><dd><p> | |
4 | Specify the window coordinates of the lower left corner | |
5 | of the rectangular region of pixels to be copied. | |
6 | </p></dd><dt><span class="term"><em class="parameter"><code>width</code></em>, </span><span class="term"><em class="parameter"><code>height</code></em></span></dt><dd><p> | |
7 | Specify the dimensions of the rectangular region of pixels to be copied. | |
8 | Both must be nonnegative. | |
9 | </p></dd><dt><span class="term"><em class="parameter"><code>type</code></em></span></dt><dd><p> | |
10 | Specifies whether color values, | |
11 | depth values, | |
12 | or stencil values are to be copied. | |
13 | Symbolic constants | |
14 | <code class="constant">GL_COLOR</code>, | |
15 | <code class="constant">GL_DEPTH</code>, | |
16 | and <code class="constant">GL_STENCIL</code> are accepted. | |
17 | </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="description"></a><h2>Description</h2><p> | |
18 | <code class="function">glCopyPixels</code> copies a screen-aligned rectangle of pixels | |
19 | from the specified frame buffer location to a region relative to the | |
20 | current raster position. | |
21 | Its operation is well defined only if the entire pixel source region | |
22 | is within the exposed portion of the window. | |
23 | Results of copies from outside the window, | |
24 | or from regions of the window that are not exposed, | |
25 | are hardware dependent and undefined. | |
26 | </p><p> | |
27 | <em class="parameter"><code>x</code></em> and <em class="parameter"><code>y</code></em> specify the window coordinates of | |
28 | the lower left corner of the rectangular region to be copied. | |
29 | <em class="parameter"><code>width</code></em> and <em class="parameter"><code>height</code></em> specify the dimensions of the | |
30 | rectangular region to be copied. | |
31 | Both <em class="parameter"><code>width</code></em> and <em class="parameter"><code>height</code></em> must not be negative. | |
32 | </p><p> | |
33 | Several parameters control the processing of the pixel data | |
34 | while it is being copied. | |
35 | These parameters are set with three commands: | |
36 | <a class="citerefentry" href="glPixelTransfer.xml"><span class="citerefentry"><span class="refentrytitle">glPixelTransfer</span></span></a>, | |
37 | <a class="citerefentry" href="glPixelMap.xml"><span class="citerefentry"><span class="refentrytitle">glPixelMap</span></span></a>, and | |
38 | <a class="citerefentry" href="glPixelZoom.xml"><span class="citerefentry"><span class="refentrytitle">glPixelZoom</span></span></a>. | |
39 | This reference page describes the effects on <code class="function">glCopyPixels</code> of most, | |
40 | but not all, of the parameters specified by these three commands. | |
41 | </p><p> | |
42 | <code class="function">glCopyPixels</code> copies values from each pixel with the lower left-hand corner at | |
43 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
44 | ||
45 | <mml:mfenced open="(" close=")"> | |
46 | <mml:mrow> | |
47 | <mml:mi mathvariant="italic">x</mml:mi> | |
48 | <mml:mo>+</mml:mo> | |
49 | <mml:mi mathvariant="italic">i</mml:mi> | |
50 | </mml:mrow> | |
51 | <mml:mrow> | |
52 | <mml:mi mathvariant="italic">y</mml:mi> | |
53 | <mml:mo>+</mml:mo> | |
54 | <mml:mi mathvariant="italic">j</mml:mi> | |
55 | </mml:mrow> | |
56 | </mml:mfenced> | |
57 | </mml:math> | |
58 | for | |
59 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
60 | ||
61 | <mml:mrow> | |
62 | <mml:mn>0</mml:mn> | |
63 | <mml:mo><=</mml:mo> | |
64 | <mml:mi mathvariant="italic">i</mml:mi> | |
65 | <mml:mo><</mml:mo> | |
66 | <mml:mi mathvariant="italic">width</mml:mi> | |
67 | </mml:mrow> | |
68 | </mml:math> | |
69 | and | |
70 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
71 | ||
72 | <mml:mrow> | |
73 | <mml:mn>0</mml:mn> | |
74 | <mml:mo><=</mml:mo> | |
75 | <mml:mi mathvariant="italic">j</mml:mi> | |
76 | <mml:mo><</mml:mo> | |
77 | <mml:mi mathvariant="italic">height</mml:mi> | |
78 | </mml:mrow> | |
79 | </mml:math>. | |
80 | This pixel is said to be the | |
81 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">i</mml:mi></mml:math>th | |
82 | pixel in the | |
83 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">j</mml:mi></mml:math>th | |
84 | row. | |
85 | Pixels are copied in row order from the lowest to the highest row, | |
86 | left to right in each row. | |
87 | </p><p> | |
88 | <em class="parameter"><code>type</code></em> specifies whether color, depth, or stencil data is to be copied. | |
89 | The details of the transfer for each data type are as follows: | |
90 | </p><div class="variablelist"><dl><dt><span class="term"><code class="constant">GL_COLOR</code></span></dt><dd><p> | |
91 | Indices or RGBA colors are read from the buffer currently specified as the | |
92 | read source buffer (see <a class="citerefentry" href="glReadBuffer.xml"><span class="citerefentry"><span class="refentrytitle">glReadBuffer</span></span></a>). | |
93 | If the GL is in color index mode, | |
94 | each index that is read from this buffer is converted | |
95 | to a fixed-point format with an unspecified | |
96 | number of bits to the right of the binary point. | |
97 | Each index is then shifted left by <code class="constant">GL_INDEX_SHIFT</code> bits, | |
98 | and added to <code class="constant">GL_INDEX_OFFSET</code>. | |
99 | If <code class="constant">GL_INDEX_SHIFT</code> is negative, | |
100 | the shift is to the right. | |
101 | In either case, zero bits fill otherwise unspecified bit locations in the | |
102 | result. | |
103 | If <code class="constant">GL_MAP_COLOR</code> is true, | |
104 | the index is replaced with the value that it references in lookup table | |
105 | <code class="constant">GL_PIXEL_MAP_I_TO_I</code>. | |
106 | Whether the lookup replacement of the index is done or not, | |
107 | the integer part of the index is then ANDed with | |
108 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
109 | ||
110 | <mml:mrow> | |
111 | <mml:msup><mml:mn>2</mml:mn> | |
112 | <mml:mi mathvariant="italic">b</mml:mi> | |
113 | </mml:msup> | |
114 | <mml:mo>-</mml:mo> | |
115 | <mml:mn>1</mml:mn> | |
116 | </mml:mrow> | |
117 | </mml:math>, | |
118 | where | |
119 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">b</mml:mi></mml:math> | |
120 | is the number of bits in a color index buffer. | |
121 | </p><p> | |
122 | If the GL is in RGBA mode, | |
123 | the red, green, blue, and alpha components of each pixel that is read | |
124 | are converted to an internal floating-point format with unspecified | |
125 | precision. | |
126 | The conversion maps the largest representable component value to 1.0, | |
127 | and component value 0 to 0.0. | |
128 | The resulting floating-point color values are then multiplied | |
129 | by <code class="constant">GL_c_SCALE</code> and added to <code class="constant">GL_c_BIAS</code>, | |
130 | where <span class="emphasis"><em>c</em></span> is RED, GREEN, BLUE, and ALPHA | |
131 | for the respective color components. | |
132 | The results are clamped to the range [0,1]. | |
133 | If <code class="constant">GL_MAP_COLOR</code> is true, | |
134 | each color component is scaled by the size of lookup table | |
135 | <code class="constant">GL_PIXEL_MAP_c_TO_c</code>, | |
136 | then replaced by the value that it references in that table. | |
137 | <span class="emphasis"><em>c</em></span> is R, G, B, or A. | |
138 | </p><p> | |
139 | If the <code class="code">ARB_imaging</code> extension is supported, the color values may | |
140 | be | |
141 | additionally processed by color-table lookups, color-matrix | |
142 | transformations, and convolution filters. | |
143 | </p><p> | |
144 | The GL then converts the resulting indices or RGBA colors to fragments | |
145 | by attaching the current raster position <span class="emphasis"><em>z</em></span> coordinate and | |
146 | texture coordinates to each pixel, | |
147 | then assigning window coordinates | |
148 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
149 | ||
150 | <mml:mfenced open="(" close=")"> | |
151 | <mml:mrow> | |
152 | <mml:msub><mml:mi mathvariant="italic">x</mml:mi> | |
153 | <mml:mi mathvariant="italic">r</mml:mi> | |
154 | </mml:msub> | |
155 | <mml:mo>+</mml:mo> | |
156 | <mml:mi mathvariant="italic">i</mml:mi> | |
157 | </mml:mrow> | |
158 | <mml:mrow> | |
159 | <mml:msub><mml:mi mathvariant="italic">y</mml:mi> | |
160 | <mml:mi mathvariant="italic">r</mml:mi> | |
161 | </mml:msub> | |
162 | <mml:mo>+</mml:mo> | |
163 | <mml:mi mathvariant="italic">j</mml:mi> | |
164 | </mml:mrow> | |
165 | </mml:mfenced> | |
166 | </mml:math>, | |
167 | where | |
168 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
169 | ||
170 | <mml:mfenced open="(" close=")"> | |
171 | <mml:msub><mml:mi mathvariant="italic">x</mml:mi> | |
172 | <mml:mi mathvariant="italic">r</mml:mi> | |
173 | </mml:msub> | |
174 | <mml:msub><mml:mi mathvariant="italic">y</mml:mi> | |
175 | <mml:mi mathvariant="italic">r</mml:mi> | |
176 | </mml:msub> | |
177 | </mml:mfenced> | |
178 | </mml:math> | |
179 | is the current raster position, | |
180 | and the pixel was the | |
181 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">i</mml:mi></mml:math>th | |
182 | pixel in the | |
183 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">j</mml:mi></mml:math>th | |
184 | row. | |
185 | These pixel fragments are then treated just like the fragments generated by | |
186 | rasterizing points, lines, or polygons. | |
187 | Texture mapping, | |
188 | fog, | |
189 | and all the fragment operations are applied before the fragments are written | |
190 | to the frame buffer. | |
191 | </p></dd><dt><span class="term"><code class="constant">GL_DEPTH</code></span></dt><dd><p> | |
192 | Depth values are read from the depth buffer and | |
193 | converted directly to an internal floating-point format | |
194 | with unspecified precision. | |
195 | The resulting floating-point depth value is then multiplied | |
196 | by <code class="constant">GL_DEPTH_SCALE</code> and added to <code class="constant">GL_DEPTH_BIAS</code>. | |
197 | The result is clamped to the range [0,1]. | |
198 | </p><p> | |
199 | The GL then converts the resulting depth components to fragments | |
200 | by attaching the current raster position color or color index and | |
201 | texture coordinates to each pixel, | |
202 | then assigning window coordinates | |
203 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
204 | ||
205 | <mml:mfenced open="(" close=")"> | |
206 | <mml:mrow> | |
207 | <mml:msub><mml:mi mathvariant="italic">x</mml:mi> | |
208 | <mml:mi mathvariant="italic">r</mml:mi> | |
209 | </mml:msub> | |
210 | <mml:mo>+</mml:mo> | |
211 | <mml:mi mathvariant="italic">i</mml:mi> | |
212 | </mml:mrow> | |
213 | <mml:mrow> | |
214 | <mml:msub><mml:mi mathvariant="italic">y</mml:mi> | |
215 | <mml:mi mathvariant="italic">r</mml:mi> | |
216 | </mml:msub> | |
217 | <mml:mo>+</mml:mo> | |
218 | <mml:mi mathvariant="italic">j</mml:mi> | |
219 | </mml:mrow> | |
220 | </mml:mfenced> | |
221 | </mml:math>, | |
222 | where | |
223 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
224 | ||
225 | <mml:mfenced open="(" close=")"> | |
226 | <mml:msub><mml:mi mathvariant="italic">x</mml:mi> | |
227 | <mml:mi mathvariant="italic">r</mml:mi> | |
228 | </mml:msub> | |
229 | <mml:msub><mml:mi mathvariant="italic">y</mml:mi> | |
230 | <mml:mi mathvariant="italic">r</mml:mi> | |
231 | </mml:msub> | |
232 | </mml:mfenced> | |
233 | </mml:math> | |
234 | is the current raster position, | |
235 | and the pixel was the | |
236 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">i</mml:mi></mml:math>th | |
237 | pixel in the | |
238 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">j</mml:mi></mml:math>th | |
239 | row. | |
240 | These pixel fragments are then treated just like the fragments generated by | |
241 | rasterizing points, lines, or polygons. | |
242 | Texture mapping, | |
243 | fog, | |
244 | and all the fragment operations are applied before the fragments are written | |
245 | to the frame buffer. | |
246 | </p></dd><dt><span class="term"><code class="constant">GL_STENCIL</code></span></dt><dd><p> | |
247 | Stencil indices are read from the stencil buffer and | |
248 | converted to an internal fixed-point format | |
249 | with an unspecified number of bits to the right of the binary point. | |
250 | Each fixed-point index is then shifted left by <code class="constant">GL_INDEX_SHIFT</code> bits, | |
251 | and added to <code class="constant">GL_INDEX_OFFSET</code>. | |
252 | If <code class="constant">GL_INDEX_SHIFT</code> is negative, | |
253 | the shift is to the right. | |
254 | In either case, zero bits fill otherwise unspecified bit locations in the | |
255 | result. | |
256 | If <code class="constant">GL_MAP_STENCIL</code> is true, | |
257 | the index is replaced with the value that it references in lookup table | |
258 | <code class="constant">GL_PIXEL_MAP_S_TO_S</code>. | |
259 | Whether the lookup replacement of the index is done or not, | |
260 | the integer part of the index is then ANDed with | |
261 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
262 | ||
263 | <mml:mrow> | |
264 | <mml:msup><mml:mn>2</mml:mn> | |
265 | <mml:mi mathvariant="italic">b</mml:mi> | |
266 | </mml:msup> | |
267 | <mml:mo>-</mml:mo> | |
268 | <mml:mn>1</mml:mn> | |
269 | </mml:mrow> | |
270 | </mml:math>, | |
271 | where | |
272 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">b</mml:mi></mml:math> | |
273 | is the number of bits in the stencil buffer. | |
274 | The resulting stencil indices are then written to the stencil buffer | |
275 | such that the index read from the | |
276 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">i</mml:mi></mml:math>th | |
277 | location of the | |
278 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">j</mml:mi></mml:math>th | |
279 | row | |
280 | is written to location | |
281 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
282 | ||
283 | <mml:mfenced open="(" close=")"> | |
284 | <mml:mrow> | |
285 | <mml:msub><mml:mi mathvariant="italic">x</mml:mi> | |
286 | <mml:mi mathvariant="italic">r</mml:mi> | |
287 | </mml:msub> | |
288 | <mml:mo>+</mml:mo> | |
289 | <mml:mi mathvariant="italic">i</mml:mi> | |
290 | </mml:mrow> | |
291 | <mml:mrow> | |
292 | <mml:msub><mml:mi mathvariant="italic">y</mml:mi> | |
293 | <mml:mi mathvariant="italic">r</mml:mi> | |
294 | </mml:msub> | |
295 | <mml:mo>+</mml:mo> | |
296 | <mml:mi mathvariant="italic">j</mml:mi> | |
297 | </mml:mrow> | |
298 | </mml:mfenced> | |
299 | </mml:math>, | |
300 | where | |
301 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
302 | ||
303 | <mml:mfenced open="(" close=")"> | |
304 | <mml:msub><mml:mi mathvariant="italic">x</mml:mi> | |
305 | <mml:mi mathvariant="italic">r</mml:mi> | |
306 | </mml:msub> | |
307 | <mml:msub><mml:mi mathvariant="italic">y</mml:mi> | |
308 | <mml:mi mathvariant="italic">r</mml:mi> | |
309 | </mml:msub> | |
310 | </mml:mfenced> | |
311 | </mml:math> | |
312 | is the current raster position. | |
313 | Only the pixel ownership test, | |
314 | the scissor test, | |
315 | and the stencil writemask affect these write operations. | |
316 | </p></dd></dl></div><p> | |
317 | The rasterization described thus far assumes pixel zoom factors of 1.0. | |
318 | If | |
319 | <a class="citerefentry" href="glPixelZoom.xml"><span class="citerefentry"><span class="refentrytitle">glPixelZoom</span></span></a> is used to change the | |
320 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">x</mml:mi></mml:math> | |
321 | and | |
322 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">y</mml:mi></mml:math> | |
323 | pixel zoom factors, | |
324 | pixels are converted to fragments as follows. | |
325 | If | |
326 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
327 | ||
328 | <mml:mfenced open="(" close=")"> | |
329 | <mml:msub><mml:mi mathvariant="italic">x</mml:mi> | |
330 | <mml:mi mathvariant="italic">r</mml:mi> | |
331 | </mml:msub> | |
332 | <mml:msub><mml:mi mathvariant="italic">y</mml:mi> | |
333 | <mml:mi mathvariant="italic">r</mml:mi> | |
334 | </mml:msub> | |
335 | </mml:mfenced> | |
336 | </mml:math> | |
337 | is the current raster position, | |
338 | and a given pixel is in the | |
339 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">i</mml:mi></mml:math>th | |
340 | location in the | |
341 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">j</mml:mi></mml:math>th | |
342 | row of the source | |
343 | pixel rectangle, | |
344 | then fragments are generated for pixels whose centers are in the rectangle | |
345 | with corners at | |
346 | </p><p> | |
347 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
348 | ||
349 | <mml:mfenced open="(" close=")"> | |
350 | <mml:mrow> | |
351 | <mml:msub><mml:mi mathvariant="italic">x</mml:mi> | |
352 | <mml:mi mathvariant="italic">r</mml:mi> | |
353 | </mml:msub> | |
354 | <mml:mo>+</mml:mo> | |
355 | <mml:mfenced open="" close=""> | |
356 | <mml:msub><mml:mi mathvariant="italic">zoom</mml:mi> | |
357 | <mml:mi mathvariant="italic">x</mml:mi> | |
358 | </mml:msub> | |
359 | </mml:mfenced> | |
360 | <mml:mo></mml:mo> | |
361 | <mml:mi mathvariant="italic">i</mml:mi> | |
362 | </mml:mrow> | |
363 | <mml:mrow> | |
364 | <mml:msub><mml:mi mathvariant="italic">y</mml:mi> | |
365 | <mml:mi mathvariant="italic">r</mml:mi> | |
366 | </mml:msub> | |
367 | <mml:mo>+</mml:mo> | |
368 | <mml:mfenced open="" close=""> | |
369 | <mml:msub><mml:mi mathvariant="italic">zoom</mml:mi> | |
370 | <mml:mi mathvariant="italic">y</mml:mi> | |
371 | </mml:msub> | |
372 | </mml:mfenced> | |
373 | <mml:mo></mml:mo> | |
374 | <mml:mi mathvariant="italic">j</mml:mi> | |
375 | </mml:mrow> | |
376 | </mml:mfenced> | |
377 | </mml:math> | |
378 | </p><p> | |
379 | and | |
380 | </p><p> | |
381 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
382 | ||
383 | <mml:mfenced open="(" close=")"> | |
384 | <mml:mrow> | |
385 | <mml:msub><mml:mi mathvariant="italic">x</mml:mi> | |
386 | <mml:mi mathvariant="italic">r</mml:mi> | |
387 | </mml:msub> | |
388 | <mml:mo>+</mml:mo> | |
389 | <mml:mrow> | |
390 | <mml:mfenced open="" close=""> | |
391 | <mml:msub><mml:mi mathvariant="italic">zoom</mml:mi> | |
392 | <mml:mi mathvariant="italic">x</mml:mi> | |
393 | </mml:msub> | |
394 | </mml:mfenced> | |
395 | <mml:mo></mml:mo> | |
396 | <mml:mfenced open="(" close=")"> | |
397 | <mml:mrow> | |
398 | <mml:mi mathvariant="italic">i</mml:mi> | |
399 | <mml:mo>+</mml:mo> | |
400 | <mml:mn>1</mml:mn> | |
401 | </mml:mrow> | |
402 | </mml:mfenced> | |
403 | </mml:mrow> | |
404 | </mml:mrow> | |
405 | <mml:mrow> | |
406 | <mml:msub><mml:mi mathvariant="italic">y</mml:mi> | |
407 | <mml:mi mathvariant="italic">r</mml:mi> | |
408 | </mml:msub> | |
409 | <mml:mo>+</mml:mo> | |
410 | <mml:mrow> | |
411 | <mml:mfenced open="" close=""> | |
412 | <mml:msub><mml:mi mathvariant="italic">zoom</mml:mi> | |
413 | <mml:mi mathvariant="italic">y</mml:mi> | |
414 | </mml:msub> | |
415 | </mml:mfenced> | |
416 | <mml:mo></mml:mo> | |
417 | <mml:mfenced open="(" close=")"> | |
418 | <mml:mrow> | |
419 | <mml:mi mathvariant="italic">j</mml:mi> | |
420 | <mml:mo>+</mml:mo> | |
421 | <mml:mn>1</mml:mn> | |
422 | </mml:mrow> | |
423 | </mml:mfenced> | |
424 | </mml:mrow> | |
425 | </mml:mrow> | |
426 | </mml:mfenced> | |
427 | </mml:math> | |
428 | </p><p> | |
429 | where | |
430 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
431 | ||
432 | <mml:msub><mml:mi mathvariant="italic">zoom</mml:mi> | |
433 | <mml:mi mathvariant="italic">x</mml:mi> | |
434 | </mml:msub> | |
435 | </mml:math> | |
436 | is the value of <code class="constant">GL_ZOOM_X</code> and | |
437 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
438 | ||
439 | <mml:msub><mml:mi mathvariant="italic">zoom</mml:mi> | |
440 | <mml:mi mathvariant="italic">y</mml:mi> | |
441 | </mml:msub> | |
442 | </mml:math> | |
443 | is the value of <code class="constant">GL_ZOOM_Y</code>. | |
444 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="examples"></a><h2>Examples</h2><p> | |
445 | To copy the color pixel in the lower left corner of the window to the current raster position, | |
446 | use | |
447 | </p><p> | |
448 | </p><pre class="programlisting"> | |
449 | glCopyPixels(0, 0, 1, 1, <code class="constant">GL_COLOR</code>); | |
450 | </pre><p> | |
451 | </p><p> | |
452 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="notes"></a><h2>Notes</h2><p> | |
453 | Modes specified by <a class="citerefentry" href="glPixelStore.xml"><span class="citerefentry"><span class="refentrytitle">glPixelStore</span></span></a> have no effect on the operation | |
454 | of <code class="function">glCopyPixels</code>. | |
455 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="errors"></a><h2>Errors</h2><p> | |
456 | <code class="constant">GL_INVALID_ENUM</code> is generated if <em class="parameter"><code>type</code></em> is not an accepted value. | |
457 | </p><p> | |
458 | <code class="constant">GL_INVALID_VALUE</code> is generated if either <em class="parameter"><code>width</code></em> or <em class="parameter"><code>height</code></em> is negative. | |
459 | </p><p> | |
460 | <code class="constant">GL_INVALID_OPERATION</code> is generated if <em class="parameter"><code>type</code></em> is <code class="constant">GL_DEPTH</code> | |
461 | and there is no depth buffer. | |
462 | </p><p> | |
463 | <code class="constant">GL_INVALID_OPERATION</code> is generated if <em class="parameter"><code>type</code></em> is <code class="constant">GL_STENCIL</code> | |
464 | and there is no stencil buffer. | |
465 | </p><p> | |
466 | <code class="constant">GL_INVALID_OPERATION</code> is generated if <code class="function">glCopyPixels</code> | |
467 | is executed between the execution of <a class="citerefentry" href="glBegin.xml"><span class="citerefentry"><span class="refentrytitle">glBegin</span></span></a> | |
468 | and the corresponding execution of <a class="citerefentry" href="glEnd.xml"><span class="citerefentry"><span class="refentrytitle">glEnd</span></span></a>. | |
469 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="associatedgets"></a><h2>Associated Gets</h2><p> | |
470 | <a class="citerefentry" href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_CURRENT_RASTER_POSITION</code> | |
471 | </p><p> | |
472 | <a class="citerefentry" href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_CURRENT_RASTER_POSITION_VALID</code> | |
473 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p> | |
474 | <a class="citerefentry" href="glColorTable.xml"><span class="citerefentry"><span class="refentrytitle">glColorTable</span></span></a>, | |
475 | <a class="citerefentry" href="glConvolutionFilter1D.xml"><span class="citerefentry"><span class="refentrytitle">glConvolutionFilter1D</span></span></a>, | |
476 | <a class="citerefentry" href="glConvolutionFilter2D.xml"><span class="citerefentry"><span class="refentrytitle">glConvolutionFilter2D</span></span></a>, | |
477 | <a class="citerefentry" href="glDepthFunc.xml"><span class="citerefentry"><span class="refentrytitle">glDepthFunc</span></span></a>, | |
478 | <a class="citerefentry" href="glDrawBuffer.xml"><span class="citerefentry"><span class="refentrytitle">glDrawBuffer</span></span></a>, | |
479 | <a class="citerefentry" href="glDrawPixels.xml"><span class="citerefentry"><span class="refentrytitle">glDrawPixels</span></span></a>, | |
480 | <a class="citerefentry" href="glMatrixMode.xml"><span class="citerefentry"><span class="refentrytitle">glMatrixMode</span></span></a>, | |
481 | <a class="citerefentry" href="glPixelMap.xml"><span class="citerefentry"><span class="refentrytitle">glPixelMap</span></span></a>, | |
482 | <a class="citerefentry" href="glPixelTransfer.xml"><span class="citerefentry"><span class="refentrytitle">glPixelTransfer</span></span></a>, | |
483 | <a class="citerefentry" href="glPixelZoom.xml"><span class="citerefentry"><span class="refentrytitle">glPixelZoom</span></span></a>, | |
484 | <a class="citerefentry" href="glRasterPos.xml"><span class="citerefentry"><span class="refentrytitle">glRasterPos</span></span></a>, | |
485 | <a class="citerefentry" href="glReadBuffer.xml"><span class="citerefentry"><span class="refentrytitle">glReadBuffer</span></span></a>, | |
486 | <a class="citerefentry" href="glReadPixels.xml"><span class="citerefentry"><span class="refentrytitle">glReadPixels</span></span></a>, | |
487 | <a class="citerefentry" href="glSeparableFilter2D.xml"><span class="citerefentry"><span class="refentrytitle">glSeparableFilter2D</span></span></a>, | |
488 | <a class="citerefentry" href="glStencilFunc.xml"><span class="citerefentry"><span class="refentrytitle">glStencilFunc</span></span></a>, | |
489 | <a class="citerefentry" href="glWindowPos.xml"><span class="citerefentry"><span class="refentrytitle">glWindowPos</span></span></a> | |
490 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="Copyright"></a><h2>Copyright</h2><p> | |
491 | Copyright <span class="trademark"></span>© 1991-2006 | |
492 | Silicon Graphics, Inc. This document is licensed under the SGI | |
493 | Free Software B License. For details, see | |
494 | <a class="ulink" href="http://oss.sgi.com/projects/FreeB/" target="_top">http://oss.sgi.com/projects/FreeB/</a>. | |
495 | </p></div></div></body></html> |