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 </p></dd><dt><span class=
"term"><code class=
"constant">GL_DEPTH_COMPONENT
</code></span></dt><dd><p>
120 Depth values are read from the depth buffer.
121 Each component is converted to floating point such that the minimum depth
122 value maps to
0 and the maximum value maps to
1.
123 Each component is clamped to the range
124 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
126 <mml:mfenced open=
"[" close=
"]">
131 </p></dd><dt><span class=
"term"><code class=
"constant">GL_DEPTH_STENCIL
</code></span></dt><dd><p>
132 Values are taken from both the depth and stencil buffers. The
<em class=
"parameter"><code>type
</code></em> parameter
133 must be
<code class=
"constant">GL_UNSIGNED_INT_24_8
</code> or
<code class=
"constant">GL_FLOAT_32_UNSIGNED_INT_24_8_REV
</code>.
134 </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>
135 Finally, the indices or components
136 are converted to the proper format,
137 as specified by
<em class=
"parameter"><code>type
</code></em>.
138 If
<em class=
"parameter"><code>format
</code></em> is
<code class=
"constant">GL_STENCIL_INDEX
</code>
139 and
<em class=
"parameter"><code>type
</code></em> is not
<code class=
"constant">GL_FLOAT
</code>,
140 each index is masked with the mask value given in the following table.
141 If
<em class=
"parameter"><code>type
</code></em> is
<code class=
"constant">GL_FLOAT
</code>, then each integer index is converted to
142 single-precision floating-point format.
144 If
<em class=
"parameter"><code>format
</code></em> is
145 <code class=
"constant">GL_RED
</code>,
146 <code class=
"constant">GL_GREEN
</code>,
147 <code class=
"constant">GL_BLUE
</code>,
148 <code class=
"constant">GL_RGB
</code>,
149 <code class=
"constant">GL_BGR
</code>,
150 <code class=
"constant">GL_RGBA
</code>, or
151 <code class=
"constant">GL_BGRA
</code> and
<em class=
"parameter"><code>type
</code></em> is not
<code class=
"constant">GL_FLOAT
</code>,
152 each component is multiplied by the multiplier shown in the following table.
153 If type is
<code class=
"constant">GL_FLOAT
</code>, then each component is passed as is
154 (or converted to the client's single-precision floating-point format if
155 it is different from the one used by the GL).
157 </p><div class=
"informaltable"><table border=
"1"><colgroup><col align=
"left" /><col align=
"center" /><col align=
"center" /></colgroup><thead><tr><th align=
"left">
158 <em class=
"parameter"><code>type
</code></em>
159 </th><th align=
"center"><span class=
"bold"><strong>
161 </strong></span></th><th align=
"center"><span class=
"bold"><strong>
163 </strong></span></th></tr></thead><tbody><tr><td align=
"left">
164 <code class=
"constant">GL_UNSIGNED_BYTE
</code>
165 </td><td align=
"center">
166 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
169 <mml:msup><mml:mn>2</mml:mn>
176 </td><td align=
"center">
177 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
180 <mml:mfenced open=
"(" close=
")">
182 <mml:msup><mml:mn>2</mml:mn>
190 <mml:mi mathvariant=
"italic">c
</mml:mi>
193 </td></tr><tr><td align=
"left">
194 <code class=
"constant">GL_BYTE
</code>
195 </td><td align=
"center">
196 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
199 <mml:msup><mml:mn>2</mml:mn>
206 </td><td align=
"center">
207 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
210 <mml:mfenced open=
"" close=
"">
212 <mml:mfenced open=
"(" close=
")">
214 <mml:msup><mml:mn>2</mml:mn>
222 <mml:mi mathvariant=
"italic">c
</mml:mi>
230 </td></tr><tr><td align=
"left">
231 <code class=
"constant">GL_UNSIGNED_SHORT
</code>
232 </td><td align=
"center">
233 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
236 <mml:msup><mml:mn>2</mml:mn>
243 </td><td align=
"center">
244 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
247 <mml:mfenced open=
"(" close=
")">
249 <mml:msup><mml:mn>2</mml:mn>
257 <mml:mi mathvariant=
"italic">c
</mml:mi>
260 </td></tr><tr><td align=
"left">
261 <code class=
"constant">GL_SHORT
</code>
262 </td><td align=
"center">
263 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
266 <mml:msup><mml:mn>2</mml:mn>
273 </td><td align=
"center">
274 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
277 <mml:mfenced open=
"" close=
"">
279 <mml:mfenced open=
"(" close=
")">
281 <mml:msup><mml:mn>2</mml:mn>
289 <mml:mi mathvariant=
"italic">c
</mml:mi>
297 </td></tr><tr><td align=
"left">
298 <code class=
"constant">GL_UNSIGNED_INT
</code>
299 </td><td align=
"center">
300 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
303 <mml:msup><mml:mn>2</mml:mn>
310 </td><td align=
"center">
311 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
314 <mml:mfenced open=
"(" close=
")">
316 <mml:msup><mml:mn>2</mml:mn>
324 <mml:mi mathvariant=
"italic">c
</mml:mi>
327 </td></tr><tr><td align=
"left">
328 <code class=
"constant">GL_INT
</code>
329 </td><td align=
"center">
330 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
333 <mml:msup><mml:mn>2</mml:mn>
340 </td><td align=
"center">
341 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
344 <mml:mfenced open=
"" close=
"">
346 <mml:mfenced open=
"(" close=
")">
348 <mml:msup><mml:mn>2</mml:mn>
356 <mml:mi mathvariant=
"italic">c
</mml:mi>
364 </td></tr><tr><td align=
"left">
365 <code class=
"constant">GL_HALF_FLOAT
</code>
366 </td><td align=
"center">
368 </td><td align=
"center">
369 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll"><mml:mi mathvariant=
"italic">c
</mml:mi></mml:math>
370 </td></tr><tr><td align=
"left">
371 <code class=
"constant">GL_FLOAT
</code>
372 </td><td align=
"center">
374 </td><td align=
"center">
375 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll"><mml:mi mathvariant=
"italic">c
</mml:mi></mml:math>
376 </td></tr><tr><td align=
"left">
377 <code class=
"constant">GL_UNSIGNED_BYTE_3_3_2
</code>
378 </td><td align=
"center">
379 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
382 <mml:msup><mml:mn>2</mml:mn>
389 </td><td align=
"center">
390 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
393 <mml:mfenced open=
"(" close=
")">
395 <mml:msup><mml:mn>2</mml:mn>
403 <mml:mi mathvariant=
"italic">c
</mml:mi>
406 </td></tr><tr><td align=
"left">
407 <code class=
"constant">GL_UNSIGNED_BYTE_2_3_3_REV
</code>
408 </td><td align=
"center">
409 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
412 <mml:msup><mml:mn>2</mml:mn>
419 </td><td align=
"center">
420 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
423 <mml:mfenced open=
"(" close=
")">
425 <mml:msup><mml:mn>2</mml:mn>
433 <mml:mi mathvariant=
"italic">c
</mml:mi>
436 </td></tr><tr><td align=
"left">
437 <code class=
"constant">GL_UNSIGNED_SHORT_5_6_5
</code>
438 </td><td align=
"center">
439 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
442 <mml:msup><mml:mn>2</mml:mn>
449 </td><td align=
"center">
450 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
453 <mml:mfenced open=
"(" close=
")">
455 <mml:msup><mml:mn>2</mml:mn>
463 <mml:mi mathvariant=
"italic">c
</mml:mi>
466 </td></tr><tr><td align=
"left">
467 <code class=
"constant">GL_UNSIGNED_SHORT_5_6_5_REV
</code>
468 </td><td align=
"center">
469 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
472 <mml:msup><mml:mn>2</mml:mn>
479 </td><td align=
"center">
480 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
483 <mml:mfenced open=
"(" close=
")">
485 <mml:msup><mml:mn>2</mml:mn>
493 <mml:mi mathvariant=
"italic">c
</mml:mi>
496 </td></tr><tr><td align=
"left">
497 <code class=
"constant">GL_UNSIGNED_SHORT_4_4_4_4
</code>
498 </td><td align=
"center">
499 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
502 <mml:msup><mml:mn>2</mml:mn>
509 </td><td align=
"center">
510 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
513 <mml:mfenced open=
"(" close=
")">
515 <mml:msup><mml:mn>2</mml:mn>
523 <mml:mi mathvariant=
"italic">c
</mml:mi>
526 </td></tr><tr><td align=
"left">
527 <code class=
"constant">GL_UNSIGNED_SHORT_4_4_4_4_REV
</code>
528 </td><td align=
"center">
529 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
532 <mml:msup><mml:mn>2</mml:mn>
539 </td><td align=
"center">
540 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
543 <mml:mfenced open=
"(" close=
")">
545 <mml:msup><mml:mn>2</mml:mn>
553 <mml:mi mathvariant=
"italic">c
</mml:mi>
556 </td></tr><tr><td align=
"left">
557 <code class=
"constant">GL_UNSIGNED_SHORT_5_5_5_1
</code>
558 </td><td align=
"center">
559 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
562 <mml:msup><mml:mn>2</mml:mn>
569 </td><td align=
"center">
570 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
573 <mml:mfenced open=
"(" close=
")">
575 <mml:msup><mml:mn>2</mml:mn>
583 <mml:mi mathvariant=
"italic">c
</mml:mi>
586 </td></tr><tr><td align=
"left">
587 <code class=
"constant">GL_UNSIGNED_SHORT_1_5_5_5_REV
</code>
588 </td><td align=
"center">
589 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
592 <mml:msup><mml:mn>2</mml:mn>
599 </td><td align=
"center">
600 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
603 <mml:mfenced open=
"(" close=
")">
605 <mml:msup><mml:mn>2</mml:mn>
613 <mml:mi mathvariant=
"italic">c
</mml:mi>
616 </td></tr><tr><td align=
"left">
617 <code class=
"constant">GL_UNSIGNED_INT_8_8_8_8
</code>
618 </td><td align=
"center">
619 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
622 <mml:msup><mml:mn>2</mml:mn>
629 </td><td align=
"center">
630 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
633 <mml:mfenced open=
"(" close=
")">
635 <mml:msup><mml:mn>2</mml:mn>
643 <mml:mi mathvariant=
"italic">c
</mml:mi>
646 </td></tr><tr><td align=
"left">
647 <code class=
"constant">GL_UNSIGNED_INT_8_8_8_8_REV
</code>
648 </td><td align=
"center">
649 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
652 <mml:msup><mml:mn>2</mml:mn>
659 </td><td align=
"center">
660 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
663 <mml:mfenced open=
"(" close=
")">
665 <mml:msup><mml:mn>2</mml:mn>
673 <mml:mi mathvariant=
"italic">c
</mml:mi>
676 </td></tr><tr><td align=
"left">
677 <code class=
"constant">GL_UNSIGNED_INT_10_10_10_2
</code>
678 </td><td align=
"center">
679 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
682 <mml:msup><mml:mn>2</mml:mn>
689 </td><td align=
"center">
690 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
693 <mml:mfenced open=
"(" close=
")">
695 <mml:msup><mml:mn>2</mml:mn>
703 <mml:mi mathvariant=
"italic">c
</mml:mi>
706 </td></tr><tr><td align=
"left">
707 <code class=
"constant">GL_UNSIGNED_INT_2_10_10_10_REV
</code>
708 </td><td align=
"center">
709 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
712 <mml:msup><mml:mn>2</mml:mn>
719 </td><td align=
"center">
720 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
723 <mml:mfenced open=
"(" close=
")">
725 <mml:msup><mml:mn>2</mml:mn>
733 <mml:mi mathvariant=
"italic">c
</mml:mi>
736 </td></tr><tr><td align=
"left">
737 <code class=
"constant">GL_UNSIGNED_INT_24_8
</code>
738 </td><td align=
"center">
739 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
742 <mml:msup><mml:mn>2</mml:mn>
749 </td><td align=
"center">
750 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
753 <mml:mfenced open=
"(" close=
")">
755 <mml:msup><mml:mn>2</mml:mn>
763 <mml:mi mathvariant=
"italic">c
</mml:mi>
766 </td></tr><tr><td align=
"left">
767 <code class=
"constant">GL_UNSIGNED_INT_10F_11F_11F_REV
</code>
768 </td><td align=
"center">
770 </td><td align=
"left">
772 </td></tr><tr><td align=
"left">
773 <code class=
"constant">GL_UNSIGNED_INT_5_9_9_9_REV
</code>
774 </td><td align=
"center">
776 </td><td align=
"left">
778 </td></tr><tr><td align=
"left">
779 <code class=
"constant">GL_FLOAT_32_UNSIGNED_INT_24_8_REV
</code>
780 </td><td align=
"center">
782 </td><td align=
"center">
783 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll"><mml:mi mathvariant=
"italic">c
</mml:mi></mml:math> (Depth Only)
784 </td></tr></tbody></table></div><p>
785 Return values are placed in memory as follows.
786 If
<em class=
"parameter"><code>format
</code></em> is
787 <code class=
"constant">GL_STENCIL_INDEX
</code>,
788 <code class=
"constant">GL_DEPTH_COMPONENT
</code>,
789 <code class=
"constant">GL_RED
</code>,
790 <code class=
"constant">GL_GREEN
</code>, or
791 <code class=
"constant">GL_BLUE
</code>,
792 a single value is returned and the data for the
793 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll"><mml:mi mathvariant=
"italic">i
</mml:mi></mml:math>th
795 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll"><mml:mi mathvariant=
"italic">j
</mml:mi></mml:math>th
797 is placed in location
798 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
801 <mml:mfenced open=
"(" close=
")">
802 <mml:mi mathvariant=
"italic">j
</mml:mi>
805 <mml:mi mathvariant=
"italic">width
</mml:mi>
807 <mml:mi mathvariant=
"italic">i
</mml:mi>
810 <code class=
"constant">GL_RGB
</code> and
<code class=
"constant">GL_BGR
</code> return three values,
811 <code class=
"constant">GL_RGBA
</code> and
<code class=
"constant">GL_BGRA
</code> return four values for each pixel,
812 with all values corresponding to a single pixel occupying contiguous space
813 in
<em class=
"parameter"><code>data
</code></em>.
814 Storage parameters set by
<a href=
"glPixelStore.xml"><span class=
"citerefentry"><span class=
"refentrytitle">glPixelStore
</span></span></a>,
815 such as
<code class=
"constant">GL_PACK_LSB_FIRST
</code> and
<code class=
"constant">GL_PACK_SWAP_BYTES
</code>,
816 affect the way that data is written into memory.
817 See
<a href=
"glPixelStore.xml"><span class=
"citerefentry"><span class=
"refentrytitle">glPixelStore
</span></span></a> for a description.
818 </p></div><div class=
"refsect1" lang=
"en" xml:
lang=
"en"><a id=
"notes"></a><h2>Notes
</h2><p>
819 Values for pixels that lie outside the window
820 connected to the current GL context are undefined.
822 If an error is generated,
823 no change is made to the contents of
<em class=
"parameter"><code>data
</code></em>.
824 </p></div><div class=
"refsect1" lang=
"en" xml:
lang=
"en"><a id=
"errors"></a><h2>Errors
</h2><p>
825 <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
828 <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.
830 <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>
831 and there is no stencil buffer.
833 <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>
834 and there is no depth buffer.
836 <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>
837 and there is no depth buffer or if there is no stencil buffer.
839 <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>
840 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>.
842 <code class=
"constant">GL_INVALID_OPERATION
</code> is generated if
<em class=
"parameter"><code>type
</code></em> is one of
843 <code class=
"constant">GL_UNSIGNED_BYTE_3_3_2
</code>,
844 <code class=
"constant">GL_UNSIGNED_BYTE_2_3_3_REV
</code>,
845 <code class=
"constant">GL_UNSIGNED_SHORT_5_6_5
</code>, or
846 <code class=
"constant">GL_UNSIGNED_SHORT_5_6_5_REV
</code>
847 and
<em class=
"parameter"><code>format
</code></em> is not
<code class=
"constant">GL_RGB
</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_SHORT_4_4_4_4
</code>,
851 <code class=
"constant">GL_UNSIGNED_SHORT_4_4_4_4_REV
</code>,
852 <code class=
"constant">GL_UNSIGNED_SHORT_5_5_5_1
</code>,
853 <code class=
"constant">GL_UNSIGNED_SHORT_1_5_5_5_REV
</code>,
854 <code class=
"constant">GL_UNSIGNED_INT_8_8_8_8
</code>,
855 <code class=
"constant">GL_UNSIGNED_INT_8_8_8_8_REV
</code>,
856 <code class=
"constant">GL_UNSIGNED_INT_10_10_10_2
</code>, or
857 <code class=
"constant">GL_UNSIGNED_INT_2_10_10_10_REV
</code>
858 and
<em class=
"parameter"><code>format
</code></em> is neither
<code class=
"constant">GL_RGBA
</code> nor
<code class=
"constant">GL_BGRA
</code>.
860 <code class=
"constant">GL_INVALID_OPERATION
</code> is generated if a non-zero buffer object name is bound to the
861 <code class=
"constant">GL_PIXEL_PACK_BUFFER
</code> target and the buffer object's data store is currently mapped.
863 <code class=
"constant">GL_INVALID_OPERATION
</code> is generated if a non-zero buffer object name is bound to the
864 <code class=
"constant">GL_PIXEL_PACK_BUFFER
</code> target and the data would be packed to the buffer
865 object such that the memory writes required would exceed the data store size.
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
<em class=
"parameter"><code>data
</code></em> is not evenly divisible
869 into the number of bytes needed to store in memory a datum indicated by
<em class=
"parameter"><code>type
</code></em>.
871 <code class=
"constant">GL_INVALID_OPERATION
</code> is generated if
<code class=
"constant">GL_READ_FRAMEBUFFER_BINDING
</code>
872 is non-zero, the read framebuffer is complete, and the value of
<code class=
"constant">GL_SAMPLE_BUFFERS
</code>
873 for the read framebuffer is greater than zero.
874 </p></div><div class=
"refsect1" lang=
"en" xml:
lang=
"en"><a id=
"associatedgets"></a><h2>Associated Gets
</h2><p>
875 <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>
876 </p></div><div class=
"refsect1" lang=
"en" xml:
lang=
"en"><a id=
"seealso"></a><h2>See Also
</h2><p>
877 <a href=
"glPixelStore.xml"><span class=
"citerefentry"><span class=
"refentrytitle">glPixelStore
</span></span></a>,
878 <a href=
"glReadBuffer.xml"><span class=
"citerefentry"><span class=
"refentrytitle">glReadBuffer
</span></span></a>
879 </p></div><div class=
"refsect1" lang=
"en" xml:
lang=
"en"><a id=
"Copyright"></a><h2>Copyright
</h2><p>
880 Copyright
<span class=
"trademark"></span>©
1991-
2006
881 Silicon Graphics, Inc. This document is licensed under the SGI
882 Free Software B License. For details, see
883 <a href=
"http://oss.sgi.com/projects/FreeB/" target=
"_top">http://oss.sgi.com/projects/FreeB/
</a>.
884 </p></div></div></body></html>