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>glReadPixels - OpenGL
4 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=
"glReadPixels"></a><div class=
"titlepage"></div><div class=
"refnamediv"><h2>Name
</h2><p>glReadPixels — read a block of pixels from 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">glReadPixels
</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">format
</var>,
</td></tr><tr><td> </td><td>GLenum
</td><td><var class=
"pdparam">type
</var>,
</td></tr><tr><td> </td><td>GLvoid *
</td><td><var class=
"pdparam">data
</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>
5 Specify the window coordinates of the first pixel
6 that is read from the frame buffer.
7 This location is the lower left corner of a rectangular block of pixels.
8 </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>
9 Specify the dimensions of the pixel rectangle.
10 <em class=
"parameter"><code>width
</code></em> and
<em class=
"parameter"><code>height
</code></em> of one correspond to a single pixel.
11 </p></dd><dt><span class=
"term"><em class=
"parameter"><code>format
</code></em></span></dt><dd><p>
12 Specifies the format of the pixel data.
13 The following symbolic values are accepted:
14 <code class=
"constant">GL_STENCIL_INDEX
</code>,
15 <code class=
"constant">GL_DEPTH_COMPONENT
</code>,
16 <code class=
"constant">GL_DEPTH_STENCIL
</code>,
17 <code class=
"constant">GL_RED
</code>,
18 <code class=
"constant">GL_GREEN
</code>,
19 <code class=
"constant">GL_BLUE
</code>,
20 <code class=
"constant">GL_RGB
</code>,
21 <code class=
"constant">GL_BGR
</code>,
22 <code class=
"constant">GL_RGBA
</code>, and
23 <code class=
"constant">GL_BGRA
</code>.
24 </p></dd><dt><span class=
"term"><em class=
"parameter"><code>type
</code></em></span></dt><dd><p>
25 Specifies the data type of the pixel data.
27 <code class=
"constant">GL_UNSIGNED_BYTE
</code>,
28 <code class=
"constant">GL_BYTE
</code>,
29 <code class=
"constant">GL_UNSIGNED_SHORT
</code>,
30 <code class=
"constant">GL_SHORT
</code>,
31 <code class=
"constant">GL_UNSIGNED_INT
</code>,
32 <code class=
"constant">GL_INT
</code>,
33 <code class=
"constant">GL_HALF_FLOAT
</code>,
34 <code class=
"constant">GL_FLOAT
</code>,
35 <code class=
"constant">GL_UNSIGNED_BYTE_3_3_2
</code>,
36 <code class=
"constant">GL_UNSIGNED_BYTE_2_3_3_REV
</code>,
37 <code class=
"constant">GL_UNSIGNED_SHORT_5_6_5
</code>,
38 <code class=
"constant">GL_UNSIGNED_SHORT_5_6_5_REV
</code>,
39 <code class=
"constant">GL_UNSIGNED_SHORT_4_4_4_4
</code>,
40 <code class=
"constant">GL_UNSIGNED_SHORT_4_4_4_4_REV
</code>,
41 <code class=
"constant">GL_UNSIGNED_SHORT_5_5_5_1
</code>,
42 <code class=
"constant">GL_UNSIGNED_SHORT_1_5_5_5_REV
</code>,
43 <code class=
"constant">GL_UNSIGNED_INT_8_8_8_8
</code>,
44 <code class=
"constant">GL_UNSIGNED_INT_8_8_8_8_REV
</code>,
45 <code class=
"constant">GL_UNSIGNED_INT_10_10_10_2
</code>,
46 <code class=
"constant">GL_UNSIGNED_INT_2_10_10_10_REV
</code>,
47 <code class=
"constant">GL_UNSIGNED_INT_24_8
</code>,
48 <code class=
"constant">GL_UNSIGNED_INT_10F_11F_11F_REV
</code>,
49 <code class=
"constant">GL_UNSIGNED_INT_5_9_9_9_REV
</code>, or
50 <code class=
"constant">GL_FLOAT_32_UNSIGNED_INT_24_8_REV
</code>.
51 </p></dd><dt><span class=
"term"><em class=
"parameter"><code>data
</code></em></span></dt><dd><p>
52 Returns the pixel data.
53 </p></dd></dl></div></div><div class=
"refsect1" lang=
"en" xml:
lang=
"en"><a id=
"description"></a><h2>Description
</h2><p>
54 <code class=
"function">glReadPixels
</code> returns pixel data from the frame buffer,
55 starting with the pixel whose lower left corner
56 is at location (
<em class=
"parameter"><code>x
</code></em>,
<em class=
"parameter"><code>y
</code></em>),
57 into client memory starting at location
<em class=
"parameter"><code>data
</code></em>.
58 Several parameters control the processing of the pixel data before
59 it is placed into client memory.
60 These parameters are set with
<a href=
"glPixelStore.xml"><span class=
"citerefentry"><span class=
"refentrytitle">glPixelStore
</span></span></a>.
61 This reference page describes the effects on
<code class=
"function">glReadPixels
</code> of most,
62 but not all of the parameters specified by these three commands.
64 If a non-zero named buffer object is bound to the
<code class=
"constant">GL_PIXEL_PACK_BUFFER
</code> target
65 (see
<a href=
"glBindBuffer.xml"><span class=
"citerefentry"><span class=
"refentrytitle">glBindBuffer
</span></span></a>) while a block of pixels is
66 requested,
<em class=
"parameter"><code>data
</code></em> is treated as a byte offset into the buffer object's data store
67 rather than a pointer to client memory.
69 <code class=
"function">glReadPixels
</code> returns values from each pixel with lower left corner at
70 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
72 <mml:mfenced open=
"(" close=
")">
74 <mml:mi mathvariant=
"italic">x
</mml:mi>
76 <mml:mi mathvariant=
"italic">i
</mml:mi>
79 <mml:mi mathvariant=
"italic">y
</mml:mi>
81 <mml:mi mathvariant=
"italic">j
</mml:mi>
86 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
90 <mml:mo><=
</mml:mo>
91 <mml:mi mathvariant=
"italic">i
</mml:mi>
93 <mml:mi mathvariant=
"italic">width
</mml:mi>
97 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
101 <mml:mo><=
</mml:mo>
102 <mml:mi mathvariant=
"italic">j
</mml:mi>
103 <mml:mo><</mml:mo>
104 <mml:mi mathvariant=
"italic">height
</mml:mi>
107 This pixel is said to be the
108 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll"><mml:mi mathvariant=
"italic">i
</mml:mi></mml:math>th
110 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll"><mml:mi mathvariant=
"italic">j
</mml:mi></mml:math>th
112 Pixels are returned in row order from the lowest to the highest row,
113 left to right in each row.
115 <em class=
"parameter"><code>format
</code></em> specifies the format for the returned pixel values;
117 </p><div class=
"variablelist"><dl><dt><span class=
"term"><code class=
"constant">GL_STENCIL_INDEX
</code></span></dt><dd><p>
118 Stencil values are read from the stencil buffer.
119 Each index is converted to fixed point,
120 shifted left or right depending on the value and sign of
<code class=
"constant">GL_INDEX_SHIFT
</code>,
121 and added to
<code class=
"constant">GL_INDEX_OFFSET
</code>.
122 If
<code class=
"constant">GL_MAP_STENCIL
</code> is
<code class=
"constant">GL_TRUE
</code>,
123 indices are replaced by their mappings in the table
<code class=
"constant">GL_PIXEL_MAP_S_TO_S
</code>.
124 </p></dd><dt><span class=
"term"><code class=
"constant">GL_DEPTH_COMPONENT
</code></span></dt><dd><p>
125 Depth values are read from the depth buffer.
126 Each component is converted to floating point such that the minimum depth
127 value maps to
0 and the maximum value maps to
1.
128 Each component is then multiplied by
<code class=
"constant">GL_DEPTH_SCALE
</code>,
129 added to
<code class=
"constant">GL_DEPTH_BIAS
</code>,
130 and finally clamped to the range
131 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
133 <mml:mfenced open=
"[" close=
"]">
138 </p></dd><dt><span class=
"term"><code class=
"constant">GL_DEPTH_STENCIL
</code></span></dt><dd><p>
139 Values are taken from both the depth and stencil buffers. The
<em class=
"parameter"><code>type
</code></em> parameter
140 must be
<code class=
"constant">GL_UNSIGNED_INT_24_8
</code> or
<code class=
"constant">GL_FLOAT_32_UNSIGNED_INT_24_8_REV
</code>.
141 </p></dd><dt><span class=
"term"><code class=
"constant">GL_RED
</code></span></dt><dd></dd><dt><span class=
"term"><code class=
"constant">GL_GREEN
</code></span></dt><dd></dd><dt><span class=
"term"><code class=
"constant">GL_BLUE
</code></span></dt><dd></dd><dt><span class=
"term"><code class=
"constant">GL_RGB
</code></span></dt><dd></dd><dt><span class=
"term"><code class=
"constant">GL_BGR
</code></span></dt><dd></dd><dt><span class=
"term"><code class=
"constant">GL_RGBA
</code></span></dt><dd></dd><dt><span class=
"term"><code class=
"constant">GL_BGRA
</code></span></dt><dd></dd></dl></div><p>
142 Finally, the indices or components
143 are converted to the proper format,
144 as specified by
<em class=
"parameter"><code>type
</code></em>.
145 If
<em class=
"parameter"><code>format
</code></em> is
<code class=
"constant">GL_STENCIL_INDEX
</code>
146 and
<em class=
"parameter"><code>type
</code></em> is not
<code class=
"constant">GL_FLOAT
</code>,
147 each index is masked with the mask value given in the following table.
148 If
<em class=
"parameter"><code>type
</code></em> is
<code class=
"constant">GL_FLOAT
</code>, then each integer index is converted to
149 single-precision floating-point format.
151 If
<em class=
"parameter"><code>format
</code></em> is
152 <code class=
"constant">GL_RED
</code>,
153 <code class=
"constant">GL_GREEN
</code>,
154 <code class=
"constant">GL_BLUE
</code>,
155 <code class=
"constant">GL_RGB
</code>,
156 <code class=
"constant">GL_BGR
</code>,
157 <code class=
"constant">GL_RGBA
</code>, or
158 <code class=
"constant">GL_BGRA
</code> and
<em class=
"parameter"><code>type
</code></em> is not
<code class=
"constant">GL_FLOAT
</code>,
159 each component is multiplied by the multiplier shown in the following table.
160 If type is
<code class=
"constant">GL_FLOAT
</code>, then each component is passed as is
161 (or converted to the client's single-precision floating-point format if
162 it is different from the one used by the GL).
164 </p><div class=
"informaltable"><table border=
"1"><colgroup><col align=
"left" /><col align=
"center" /><col align=
"center" /></colgroup><thead><tr><th align=
"left">
165 <em class=
"parameter"><code>type
</code></em>
166 </th><th align=
"center"><span class=
"bold"><strong>
168 </strong></span></th><th align=
"center"><span class=
"bold"><strong>
170 </strong></span></th></tr></thead><tbody><tr><td align=
"left">
171 <code class=
"constant">GL_UNSIGNED_BYTE
</code>
172 </td><td align=
"center">
173 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
176 <mml:msup><mml:mn>2</mml:mn>
183 </td><td align=
"center">
184 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
187 <mml:mfenced open=
"(" close=
")">
189 <mml:msup><mml:mn>2</mml:mn>
197 <mml:mi mathvariant=
"italic">c
</mml:mi>
200 </td></tr><tr><td align=
"left">
201 <code class=
"constant">GL_BYTE
</code>
202 </td><td align=
"center">
203 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
206 <mml:msup><mml:mn>2</mml:mn>
213 </td><td align=
"center">
214 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
217 <mml:mfenced open=
"" close=
"">
219 <mml:mfenced open=
"(" close=
")">
221 <mml:msup><mml:mn>2</mml:mn>
229 <mml:mi mathvariant=
"italic">c
</mml:mi>
237 </td></tr><tr><td align=
"left">
238 <code class=
"constant">GL_UNSIGNED_SHORT
</code>
239 </td><td align=
"center">
240 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
243 <mml:msup><mml:mn>2</mml:mn>
250 </td><td align=
"center">
251 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
254 <mml:mfenced open=
"(" close=
")">
256 <mml:msup><mml:mn>2</mml:mn>
264 <mml:mi mathvariant=
"italic">c
</mml:mi>
267 </td></tr><tr><td align=
"left">
268 <code class=
"constant">GL_SHORT
</code>
269 </td><td align=
"center">
270 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
273 <mml:msup><mml:mn>2</mml:mn>
280 </td><td align=
"center">
281 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
284 <mml:mfenced open=
"" close=
"">
286 <mml:mfenced open=
"(" close=
")">
288 <mml:msup><mml:mn>2</mml:mn>
296 <mml:mi mathvariant=
"italic">c
</mml:mi>
304 </td></tr><tr><td align=
"left">
305 <code class=
"constant">GL_UNSIGNED_INT
</code>
306 </td><td align=
"center">
307 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
310 <mml:msup><mml:mn>2</mml:mn>
317 </td><td align=
"center">
318 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
321 <mml:mfenced open=
"(" close=
")">
323 <mml:msup><mml:mn>2</mml:mn>
331 <mml:mi mathvariant=
"italic">c
</mml:mi>
334 </td></tr><tr><td align=
"left">
335 <code class=
"constant">GL_INT
</code>
336 </td><td align=
"center">
337 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
340 <mml:msup><mml:mn>2</mml:mn>
347 </td><td align=
"center">
348 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
351 <mml:mfenced open=
"" close=
"">
353 <mml:mfenced open=
"(" close=
")">
355 <mml:msup><mml:mn>2</mml:mn>
363 <mml:mi mathvariant=
"italic">c
</mml:mi>
371 </td></tr><tr><td align=
"left">
372 <code class=
"constant">GL_HALF_FLOAT
</code>
373 </td><td align=
"center">
375 </td><td align=
"center">
376 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll"><mml:mi mathvariant=
"italic">c
</mml:mi></mml:math>
377 </td></tr><tr><td align=
"left">
378 <code class=
"constant">GL_FLOAT
</code>
379 </td><td align=
"center">
381 </td><td align=
"center">
382 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll"><mml:mi mathvariant=
"italic">c
</mml:mi></mml:math>
383 </td></tr><tr><td align=
"left">
384 <code class=
"constant">GL_UNSIGNED_BYTE_3_3_2
</code>
385 </td><td align=
"center">
386 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
389 <mml:msup><mml:mn>2</mml:mn>
396 </td><td align=
"center">
397 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
400 <mml:mfenced open=
"(" close=
")">
402 <mml:msup><mml:mn>2</mml:mn>
410 <mml:mi mathvariant=
"italic">c
</mml:mi>
413 </td></tr><tr><td align=
"left">
414 <code class=
"constant">GL_UNSIGNED_BYTE_2_3_3_REV
</code>
415 </td><td align=
"center">
416 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
419 <mml:msup><mml:mn>2</mml:mn>
426 </td><td align=
"center">
427 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
430 <mml:mfenced open=
"(" close=
")">
432 <mml:msup><mml:mn>2</mml:mn>
440 <mml:mi mathvariant=
"italic">c
</mml:mi>
443 </td></tr><tr><td align=
"left">
444 <code class=
"constant">GL_UNSIGNED_SHORT_5_6_5
</code>
445 </td><td align=
"center">
446 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
449 <mml:msup><mml:mn>2</mml:mn>
456 </td><td align=
"center">
457 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
460 <mml:mfenced open=
"(" close=
")">
462 <mml:msup><mml:mn>2</mml:mn>
470 <mml:mi mathvariant=
"italic">c
</mml:mi>
473 </td></tr><tr><td align=
"left">
474 <code class=
"constant">GL_UNSIGNED_SHORT_5_6_5_REV
</code>
475 </td><td align=
"center">
476 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
479 <mml:msup><mml:mn>2</mml:mn>
486 </td><td align=
"center">
487 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
490 <mml:mfenced open=
"(" close=
")">
492 <mml:msup><mml:mn>2</mml:mn>
500 <mml:mi mathvariant=
"italic">c
</mml:mi>
503 </td></tr><tr><td align=
"left">
504 <code class=
"constant">GL_UNSIGNED_SHORT_4_4_4_4
</code>
505 </td><td align=
"center">
506 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
509 <mml:msup><mml:mn>2</mml:mn>
516 </td><td align=
"center">
517 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
520 <mml:mfenced open=
"(" close=
")">
522 <mml:msup><mml:mn>2</mml:mn>
530 <mml:mi mathvariant=
"italic">c
</mml:mi>
533 </td></tr><tr><td align=
"left">
534 <code class=
"constant">GL_UNSIGNED_SHORT_4_4_4_4_REV
</code>
535 </td><td align=
"center">
536 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
539 <mml:msup><mml:mn>2</mml:mn>
546 </td><td align=
"center">
547 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
550 <mml:mfenced open=
"(" close=
")">
552 <mml:msup><mml:mn>2</mml:mn>
560 <mml:mi mathvariant=
"italic">c
</mml:mi>
563 </td></tr><tr><td align=
"left">
564 <code class=
"constant">GL_UNSIGNED_SHORT_5_5_5_1
</code>
565 </td><td align=
"center">
566 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
569 <mml:msup><mml:mn>2</mml:mn>
576 </td><td align=
"center">
577 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
580 <mml:mfenced open=
"(" close=
")">
582 <mml:msup><mml:mn>2</mml:mn>
590 <mml:mi mathvariant=
"italic">c
</mml:mi>
593 </td></tr><tr><td align=
"left">
594 <code class=
"constant">GL_UNSIGNED_SHORT_1_5_5_5_REV
</code>
595 </td><td align=
"center">
596 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
599 <mml:msup><mml:mn>2</mml:mn>
606 </td><td align=
"center">
607 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
610 <mml:mfenced open=
"(" close=
")">
612 <mml:msup><mml:mn>2</mml:mn>
620 <mml:mi mathvariant=
"italic">c
</mml:mi>
623 </td></tr><tr><td align=
"left">
624 <code class=
"constant">GL_UNSIGNED_INT_8_8_8_8
</code>
625 </td><td align=
"center">
626 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
629 <mml:msup><mml:mn>2</mml:mn>
636 </td><td align=
"center">
637 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
640 <mml:mfenced open=
"(" close=
")">
642 <mml:msup><mml:mn>2</mml:mn>
650 <mml:mi mathvariant=
"italic">c
</mml:mi>
653 </td></tr><tr><td align=
"left">
654 <code class=
"constant">GL_UNSIGNED_INT_8_8_8_8_REV
</code>
655 </td><td align=
"center">
656 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
659 <mml:msup><mml:mn>2</mml:mn>
666 </td><td align=
"center">
667 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
670 <mml:mfenced open=
"(" close=
")">
672 <mml:msup><mml:mn>2</mml:mn>
680 <mml:mi mathvariant=
"italic">c
</mml:mi>
683 </td></tr><tr><td align=
"left">
684 <code class=
"constant">GL_UNSIGNED_INT_10_10_10_2
</code>
685 </td><td align=
"center">
686 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
689 <mml:msup><mml:mn>2</mml:mn>
696 </td><td align=
"center">
697 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
700 <mml:mfenced open=
"(" close=
")">
702 <mml:msup><mml:mn>2</mml:mn>
710 <mml:mi mathvariant=
"italic">c
</mml:mi>
713 </td></tr><tr><td align=
"left">
714 <code class=
"constant">GL_UNSIGNED_INT_2_10_10_10_REV
</code>
715 </td><td align=
"center">
716 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
719 <mml:msup><mml:mn>2</mml:mn>
726 </td><td align=
"center">
727 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
730 <mml:mfenced open=
"(" close=
")">
732 <mml:msup><mml:mn>2</mml:mn>
740 <mml:mi mathvariant=
"italic">c
</mml:mi>
743 </td></tr><tr><td align=
"left">
744 <code class=
"constant">GL_UNSIGNED_INT_24_8
</code>
745 </td><td align=
"center">
746 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
749 <mml:msup><mml:mn>2</mml:mn>
756 </td><td align=
"center">
757 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
760 <mml:mfenced open=
"(" close=
")">
762 <mml:msup><mml:mn>2</mml:mn>
770 <mml:mi mathvariant=
"italic">c
</mml:mi>
773 </td></tr><tr><td align=
"left">
774 <code class=
"constant">GL_UNSIGNED_INT_10F_11F_11F_REV
</code>
775 </td><td align=
"center">
777 </td><td align=
"left">
779 </td></tr><tr><td align=
"left">
780 <code class=
"constant">GL_UNSIGNED_INT_5_9_9_9_REV
</code>
781 </td><td align=
"center">
783 </td><td align=
"left">
785 </td></tr><tr><td align=
"left">
786 <code class=
"constant">GL_FLOAT_32_UNSIGNED_INT_24_8_REV
</code>
787 </td><td align=
"center">
789 </td><td align=
"center">
790 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll"><mml:mi mathvariant=
"italic">c
</mml:mi></mml:math> (Depth Only)
791 </td></tr></tbody></table></div><p>
792 Return values are placed in memory as follows.
793 If
<em class=
"parameter"><code>format
</code></em> is
794 <code class=
"constant">GL_STENCIL_INDEX
</code>,
795 <code class=
"constant">GL_DEPTH_COMPONENT
</code>,
796 <code class=
"constant">GL_RED
</code>,
797 <code class=
"constant">GL_GREEN
</code>, or
798 <code class=
"constant">GL_BLUE
</code>,
799 a single value is returned and the data for the
800 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll"><mml:mi mathvariant=
"italic">i
</mml:mi></mml:math>th
802 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll"><mml:mi mathvariant=
"italic">j
</mml:mi></mml:math>th
804 is placed in location
805 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
808 <mml:mfenced open=
"(" close=
")">
809 <mml:mi mathvariant=
"italic">j
</mml:mi>
812 <mml:mi mathvariant=
"italic">width
</mml:mi>
814 <mml:mi mathvariant=
"italic">i
</mml:mi>
817 <code class=
"constant">GL_RGB
</code> and
<code class=
"constant">GL_BGR
</code> return three values,
818 <code class=
"constant">GL_RGBA
</code> and
<code class=
"constant">GL_BGRA
</code> return four values for each pixel,
819 with all values corresponding to a single pixel occupying contiguous space
820 in
<em class=
"parameter"><code>data
</code></em>.
821 Storage parameters set by
<a href=
"glPixelStore.xml"><span class=
"citerefentry"><span class=
"refentrytitle">glPixelStore
</span></span></a>,
822 such as
<code class=
"constant">GL_PACK_LSB_FIRST
</code> and
<code class=
"constant">GL_PACK_SWAP_BYTES
</code>,
823 affect the way that data is written into memory.
824 See
<a href=
"glPixelStore.xml"><span class=
"citerefentry"><span class=
"refentrytitle">glPixelStore
</span></span></a> for a description.
825 </p></div><div class=
"refsect1" lang=
"en" xml:
lang=
"en"><a id=
"notes"></a><h2>Notes
</h2><p>
826 Values for pixels that lie outside the window
827 connected to the current GL context are undefined.
829 If an error is generated,
830 no change is made to the contents of
<em class=
"parameter"><code>data
</code></em>.
831 </p></div><div class=
"refsect1" lang=
"en" xml:
lang=
"en"><a id=
"errors"></a><h2>Errors
</h2><p>
832 <code class=
"constant">GL_INVALID_ENUM
</code> is generated if
<em class=
"parameter"><code>format
</code></em> or
<em class=
"parameter"><code>type
</code></em> is not an
835 <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.
837 <code class=
"constant">GL_INVALID_OPERATION
</code> is generated if
<em class=
"parameter"><code>format
</code></em> is
<code class=
"constant">GL_STENCIL_INDEX
</code>
838 and there is no stencil buffer.
840 <code class=
"constant">GL_INVALID_OPERATION
</code> is generated if
<em class=
"parameter"><code>format
</code></em> is
<code class=
"constant">GL_DEPTH_COMPONENT
</code>
841 and there is no depth buffer.
843 <code class=
"constant">GL_INVALID_OPERATION
</code> is generated if
<em class=
"parameter"><code>format
</code></em> is
<code class=
"constant">GL_DEPTH_STENCIL
</code>
844 and there is no depth buffer or if there is no stencil buffer.
846 <code class=
"constant">GL_INVALID_ENUM
</code> is generated if
<em class=
"parameter"><code>format
</code></em> is
<code class=
"constant">GL_DEPTH_STENCIL
</code>
847 and
<em class=
"parameter"><code>type
</code></em> is not
<code class=
"constant">GL_UNSIGNED_INT_24_8
</code> or
<code class=
"constant">GL_FLOAT_32_UNSIGNED_INT_24_8_REV
</code>.
849 <code class=
"constant">GL_INVALID_OPERATION
</code> is generated if
<em class=
"parameter"><code>type
</code></em> is one of
850 <code class=
"constant">GL_UNSIGNED_BYTE_3_3_2
</code>,
851 <code class=
"constant">GL_UNSIGNED_BYTE_2_3_3_REV
</code>,
852 <code class=
"constant">GL_UNSIGNED_SHORT_5_6_5
</code>, or
853 <code class=
"constant">GL_UNSIGNED_SHORT_5_6_5_REV
</code>
854 and
<em class=
"parameter"><code>format
</code></em> is not
<code class=
"constant">GL_RGB
</code>.
856 <code class=
"constant">GL_INVALID_OPERATION
</code> is generated if
<em class=
"parameter"><code>type
</code></em> is one of
857 <code class=
"constant">GL_UNSIGNED_SHORT_4_4_4_4
</code>,
858 <code class=
"constant">GL_UNSIGNED_SHORT_4_4_4_4_REV
</code>,
859 <code class=
"constant">GL_UNSIGNED_SHORT_5_5_5_1
</code>,
860 <code class=
"constant">GL_UNSIGNED_SHORT_1_5_5_5_REV
</code>,
861 <code class=
"constant">GL_UNSIGNED_INT_8_8_8_8
</code>,
862 <code class=
"constant">GL_UNSIGNED_INT_8_8_8_8_REV
</code>,
863 <code class=
"constant">GL_UNSIGNED_INT_10_10_10_2
</code>, or
864 <code class=
"constant">GL_UNSIGNED_INT_2_10_10_10_REV
</code>
865 and
<em class=
"parameter"><code>format
</code></em> is neither
<code class=
"constant">GL_RGBA
</code> nor
<code class=
"constant">GL_BGRA
</code>.
867 <code class=
"constant">GL_INVALID_OPERATION
</code> is generated if a non-zero buffer object name is bound to the
868 <code class=
"constant">GL_PIXEL_PACK_BUFFER
</code> target and the buffer object's data store is currently mapped.
870 <code class=
"constant">GL_INVALID_OPERATION
</code> is generated if a non-zero buffer object name is bound to the
871 <code class=
"constant">GL_PIXEL_PACK_BUFFER
</code> target and the data would be packed to the buffer
872 object such that the memory writes required would exceed the data store size.
874 <code class=
"constant">GL_INVALID_OPERATION
</code> is generated if a non-zero buffer object name is bound to the
875 <code class=
"constant">GL_PIXEL_PACK_BUFFER
</code> target and
<em class=
"parameter"><code>data
</code></em> is not evenly divisible
876 into the number of bytes needed to store in memory a datum indicated by
<em class=
"parameter"><code>type
</code></em>.
878 <code class=
"constant">GL_INVALID_OPERATION
</code> is generated if
<code class=
"constant">GL_READ_FRAMEBUFFER_BINDING
</code>
879 is non-zero, the read framebuffer is complete, and the value of
<code class=
"constant">GL_SAMPLE_BUFFERS
</code>
880 for the read framebuffer is greater than zero.
881 </p></div><div class=
"refsect1" lang=
"en" xml:
lang=
"en"><a id=
"associatedgets"></a><h2>Associated Gets
</h2><p>
882 <a href=
"glGet.xml"><span class=
"citerefentry"><span class=
"refentrytitle">glGet
</span></span></a> with argument
<code class=
"constant">GL_INDEX_MODE
</code>
884 <a href=
"glGet.xml"><span class=
"citerefentry"><span class=
"refentrytitle">glGet
</span></span></a> with argument
<code class=
"constant">GL_PIXEL_PACK_BUFFER_BINDING
</code>
885 </p></div><div class=
"refsect1" lang=
"en" xml:
lang=
"en"><a id=
"seealso"></a><h2>See Also
</h2><p>
886 <a href=
"glPixelStore.xml"><span class=
"citerefentry"><span class=
"refentrytitle">glPixelStore
</span></span></a>,
887 <a href=
"glReadBuffer.xml"><span class=
"citerefentry"><span class=
"refentrytitle">glReadBuffer
</span></span></a>
888 </p></div><div class=
"refsect1" lang=
"en" xml:
lang=
"en"><a id=
"Copyright"></a><h2>Copyright
</h2><p>
889 Copyright
<span class=
"trademark"></span>©
1991-
2006
890 Silicon Graphics, Inc. This document is licensed under the SGI
891 Free Software B License. For details, see
892 <a href=
"http://oss.sgi.com/projects/FreeB/" target=
"_top">http://oss.sgi.com/projects/FreeB/
</a>.
893 </p></div></div></body></html>