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
3.3 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 </p></dd><dt><span class=
"term"><code class=
"constant">GL_DEPTH_COMPONENT
</code></span></dt><dd><p>
121 Depth values are read from the depth buffer.
122 Each component is converted to floating point such that the minimum depth
123 value maps to
0 and the maximum value maps to
1.
124 Each component is clamped to the range
125 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
127 <mml:mfenced open=
"[" close=
"]">
132 </p></dd><dt><span class=
"term"><code class=
"constant">GL_DEPTH_STENCIL
</code></span></dt><dd><p>
133 Values are taken from both the depth and stencil buffers. The
<em class=
"parameter"><code>type
</code></em> parameter
134 must be
<code class=
"constant">GL_UNSIGNED_INT_24_8
</code> or
<code class=
"constant">GL_FLOAT_32_UNSIGNED_INT_24_8_REV
</code>.
135 </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>
136 Finally, the indices or components
137 are converted to the proper format,
138 as specified by
<em class=
"parameter"><code>type
</code></em>.
139 If
<em class=
"parameter"><code>format
</code></em> is
<code class=
"constant">GL_STENCIL_INDEX
</code>
140 and
<em class=
"parameter"><code>type
</code></em> is not
<code class=
"constant">GL_FLOAT
</code>,
141 each index is masked with the mask value given in the following table.
142 If
<em class=
"parameter"><code>type
</code></em> is
<code class=
"constant">GL_FLOAT
</code>, then each integer index is converted to
143 single-precision floating-point format.
145 If
<em class=
"parameter"><code>format
</code></em> is
146 <code class=
"constant">GL_RED
</code>,
147 <code class=
"constant">GL_GREEN
</code>,
148 <code class=
"constant">GL_BLUE
</code>,
149 <code class=
"constant">GL_RGB
</code>,
150 <code class=
"constant">GL_BGR
</code>,
151 <code class=
"constant">GL_RGBA
</code>, or
152 <code class=
"constant">GL_BGRA
</code> and
<em class=
"parameter"><code>type
</code></em> is not
<code class=
"constant">GL_FLOAT
</code>,
153 each component is multiplied by the multiplier shown in the following table.
154 If type is
<code class=
"constant">GL_FLOAT
</code>, then each component is passed as is
155 (or converted to the client's single-precision floating-point format if
156 it is different from the one used by the GL).
158 </p><div class=
"informaltable"><table border=
"1"><colgroup><col align=
"left" /><col align=
"center" /><col align=
"center" /></colgroup><thead><tr><th align=
"left">
159 <em class=
"parameter"><code>type
</code></em>
160 </th><th align=
"center"><span class=
"bold"><strong>
162 </strong></span></th><th align=
"center"><span class=
"bold"><strong>
164 </strong></span></th></tr></thead><tbody><tr><td align=
"left">
165 <code class=
"constant">GL_UNSIGNED_BYTE
</code>
166 </td><td align=
"center">
167 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
170 <mml:msup><mml:mn>2</mml:mn>
177 </td><td align=
"center">
178 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
181 <mml:mfenced open=
"(" close=
")">
183 <mml:msup><mml:mn>2</mml:mn>
191 <mml:mi mathvariant=
"italic">c
</mml:mi>
194 </td></tr><tr><td align=
"left">
195 <code class=
"constant">GL_BYTE
</code>
196 </td><td align=
"center">
197 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
200 <mml:msup><mml:mn>2</mml:mn>
207 </td><td align=
"center">
208 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
211 <mml:mfenced open=
"" close=
"">
213 <mml:mfenced open=
"(" close=
")">
215 <mml:msup><mml:mn>2</mml:mn>
223 <mml:mi mathvariant=
"italic">c
</mml:mi>
231 </td></tr><tr><td align=
"left">
232 <code class=
"constant">GL_UNSIGNED_SHORT
</code>
233 </td><td align=
"center">
234 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
237 <mml:msup><mml:mn>2</mml:mn>
244 </td><td align=
"center">
245 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
248 <mml:mfenced open=
"(" close=
")">
250 <mml:msup><mml:mn>2</mml:mn>
258 <mml:mi mathvariant=
"italic">c
</mml:mi>
261 </td></tr><tr><td align=
"left">
262 <code class=
"constant">GL_SHORT
</code>
263 </td><td align=
"center">
264 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
267 <mml:msup><mml:mn>2</mml:mn>
274 </td><td align=
"center">
275 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
278 <mml:mfenced open=
"" close=
"">
280 <mml:mfenced open=
"(" close=
")">
282 <mml:msup><mml:mn>2</mml:mn>
290 <mml:mi mathvariant=
"italic">c
</mml:mi>
298 </td></tr><tr><td align=
"left">
299 <code class=
"constant">GL_UNSIGNED_INT
</code>
300 </td><td align=
"center">
301 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
304 <mml:msup><mml:mn>2</mml:mn>
311 </td><td align=
"center">
312 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
315 <mml:mfenced open=
"(" close=
")">
317 <mml:msup><mml:mn>2</mml:mn>
325 <mml:mi mathvariant=
"italic">c
</mml:mi>
328 </td></tr><tr><td align=
"left">
329 <code class=
"constant">GL_INT
</code>
330 </td><td align=
"center">
331 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
334 <mml:msup><mml:mn>2</mml:mn>
341 </td><td align=
"center">
342 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
345 <mml:mfenced open=
"" close=
"">
347 <mml:mfenced open=
"(" close=
")">
349 <mml:msup><mml:mn>2</mml:mn>
357 <mml:mi mathvariant=
"italic">c
</mml:mi>
365 </td></tr><tr><td align=
"left">
366 <code class=
"constant">GL_HALF_FLOAT
</code>
367 </td><td align=
"center">
369 </td><td align=
"center">
370 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll"><mml:mi mathvariant=
"italic">c
</mml:mi></mml:math>
371 </td></tr><tr><td align=
"left">
372 <code class=
"constant">GL_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_UNSIGNED_BYTE_3_3_2
</code>
379 </td><td align=
"center">
380 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
383 <mml:msup><mml:mn>2</mml:mn>
390 </td><td align=
"center">
391 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
394 <mml:mfenced open=
"(" close=
")">
396 <mml:msup><mml:mn>2</mml:mn>
404 <mml:mi mathvariant=
"italic">c
</mml:mi>
407 </td></tr><tr><td align=
"left">
408 <code class=
"constant">GL_UNSIGNED_BYTE_2_3_3_REV
</code>
409 </td><td align=
"center">
410 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
413 <mml:msup><mml:mn>2</mml:mn>
420 </td><td align=
"center">
421 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
424 <mml:mfenced open=
"(" close=
")">
426 <mml:msup><mml:mn>2</mml:mn>
434 <mml:mi mathvariant=
"italic">c
</mml:mi>
437 </td></tr><tr><td align=
"left">
438 <code class=
"constant">GL_UNSIGNED_SHORT_5_6_5
</code>
439 </td><td align=
"center">
440 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
443 <mml:msup><mml:mn>2</mml:mn>
450 </td><td align=
"center">
451 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
454 <mml:mfenced open=
"(" close=
")">
456 <mml:msup><mml:mn>2</mml:mn>
464 <mml:mi mathvariant=
"italic">c
</mml:mi>
467 </td></tr><tr><td align=
"left">
468 <code class=
"constant">GL_UNSIGNED_SHORT_5_6_5_REV
</code>
469 </td><td align=
"center">
470 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
473 <mml:msup><mml:mn>2</mml:mn>
480 </td><td align=
"center">
481 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
484 <mml:mfenced open=
"(" close=
")">
486 <mml:msup><mml:mn>2</mml:mn>
494 <mml:mi mathvariant=
"italic">c
</mml:mi>
497 </td></tr><tr><td align=
"left">
498 <code class=
"constant">GL_UNSIGNED_SHORT_4_4_4_4
</code>
499 </td><td align=
"center">
500 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
503 <mml:msup><mml:mn>2</mml:mn>
510 </td><td align=
"center">
511 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
514 <mml:mfenced open=
"(" close=
")">
516 <mml:msup><mml:mn>2</mml:mn>
524 <mml:mi mathvariant=
"italic">c
</mml:mi>
527 </td></tr><tr><td align=
"left">
528 <code class=
"constant">GL_UNSIGNED_SHORT_4_4_4_4_REV
</code>
529 </td><td align=
"center">
530 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
533 <mml:msup><mml:mn>2</mml:mn>
540 </td><td align=
"center">
541 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
544 <mml:mfenced open=
"(" close=
")">
546 <mml:msup><mml:mn>2</mml:mn>
554 <mml:mi mathvariant=
"italic">c
</mml:mi>
557 </td></tr><tr><td align=
"left">
558 <code class=
"constant">GL_UNSIGNED_SHORT_5_5_5_1
</code>
559 </td><td align=
"center">
560 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
563 <mml:msup><mml:mn>2</mml:mn>
570 </td><td align=
"center">
571 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
574 <mml:mfenced open=
"(" close=
")">
576 <mml:msup><mml:mn>2</mml:mn>
584 <mml:mi mathvariant=
"italic">c
</mml:mi>
587 </td></tr><tr><td align=
"left">
588 <code class=
"constant">GL_UNSIGNED_SHORT_1_5_5_5_REV
</code>
589 </td><td align=
"center">
590 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
593 <mml:msup><mml:mn>2</mml:mn>
600 </td><td align=
"center">
601 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
604 <mml:mfenced open=
"(" close=
")">
606 <mml:msup><mml:mn>2</mml:mn>
614 <mml:mi mathvariant=
"italic">c
</mml:mi>
617 </td></tr><tr><td align=
"left">
618 <code class=
"constant">GL_UNSIGNED_INT_8_8_8_8
</code>
619 </td><td align=
"center">
620 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
623 <mml:msup><mml:mn>2</mml:mn>
630 </td><td align=
"center">
631 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
634 <mml:mfenced open=
"(" close=
")">
636 <mml:msup><mml:mn>2</mml:mn>
644 <mml:mi mathvariant=
"italic">c
</mml:mi>
647 </td></tr><tr><td align=
"left">
648 <code class=
"constant">GL_UNSIGNED_INT_8_8_8_8_REV
</code>
649 </td><td align=
"center">
650 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
653 <mml:msup><mml:mn>2</mml:mn>
660 </td><td align=
"center">
661 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
664 <mml:mfenced open=
"(" close=
")">
666 <mml:msup><mml:mn>2</mml:mn>
674 <mml:mi mathvariant=
"italic">c
</mml:mi>
677 </td></tr><tr><td align=
"left">
678 <code class=
"constant">GL_UNSIGNED_INT_10_10_10_2
</code>
679 </td><td align=
"center">
680 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
683 <mml:msup><mml:mn>2</mml:mn>
690 </td><td align=
"center">
691 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
694 <mml:mfenced open=
"(" close=
")">
696 <mml:msup><mml:mn>2</mml:mn>
704 <mml:mi mathvariant=
"italic">c
</mml:mi>
707 </td></tr><tr><td align=
"left">
708 <code class=
"constant">GL_UNSIGNED_INT_2_10_10_10_REV
</code>
709 </td><td align=
"center">
710 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
713 <mml:msup><mml:mn>2</mml:mn>
720 </td><td align=
"center">
721 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
724 <mml:mfenced open=
"(" close=
")">
726 <mml:msup><mml:mn>2</mml:mn>
734 <mml:mi mathvariant=
"italic">c
</mml:mi>
737 </td></tr><tr><td align=
"left">
738 <code class=
"constant">GL_UNSIGNED_INT_24_8
</code>
739 </td><td align=
"center">
740 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
743 <mml:msup><mml:mn>2</mml:mn>
750 </td><td align=
"center">
751 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
754 <mml:mfenced open=
"(" close=
")">
756 <mml:msup><mml:mn>2</mml:mn>
764 <mml:mi mathvariant=
"italic">c
</mml:mi>
767 </td></tr><tr><td align=
"left">
768 <code class=
"constant">GL_UNSIGNED_INT_10F_11F_11F_REV
</code>
769 </td><td align=
"center">
771 </td><td align=
"left">
773 </td></tr><tr><td align=
"left">
774 <code class=
"constant">GL_UNSIGNED_INT_5_9_9_9_REV
</code>
775 </td><td align=
"center">
777 </td><td align=
"left">
779 </td></tr><tr><td align=
"left">
780 <code class=
"constant">GL_FLOAT_32_UNSIGNED_INT_24_8_REV
</code>
781 </td><td align=
"center">
783 </td><td align=
"center">
784 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll"><mml:mi mathvariant=
"italic">c
</mml:mi></mml:math> (Depth Only)
785 </td></tr></tbody></table></div><p>
786 Return values are placed in memory as follows.
787 If
<em class=
"parameter"><code>format
</code></em> is
788 <code class=
"constant">GL_STENCIL_INDEX
</code>,
789 <code class=
"constant">GL_DEPTH_COMPONENT
</code>,
790 <code class=
"constant">GL_RED
</code>,
791 <code class=
"constant">GL_GREEN
</code>, or
792 <code class=
"constant">GL_BLUE
</code>,
793 a single value is returned and the data for the
794 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll"><mml:mi mathvariant=
"italic">i
</mml:mi></mml:math>th
796 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll"><mml:mi mathvariant=
"italic">j
</mml:mi></mml:math>th
798 is placed in location
799 <mml:math xmlns:
mml=
"http://www.w3.org/1998/Math/MathML" overflow=
"scroll">
802 <mml:mfenced open=
"(" close=
")">
803 <mml:mi mathvariant=
"italic">j
</mml:mi>
806 <mml:mi mathvariant=
"italic">width
</mml:mi>
808 <mml:mi mathvariant=
"italic">i
</mml:mi>
811 <code class=
"constant">GL_RGB
</code> and
<code class=
"constant">GL_BGR
</code> return three values,
812 <code class=
"constant">GL_RGBA
</code> and
<code class=
"constant">GL_BGRA
</code> return four values for each pixel,
813 with all values corresponding to a single pixel occupying contiguous space
814 in
<em class=
"parameter"><code>data
</code></em>.
815 Storage parameters set by
<a href=
"glPixelStore.xml"><span class=
"citerefentry"><span class=
"refentrytitle">glPixelStore
</span></span></a>,
816 such as
<code class=
"constant">GL_PACK_LSB_FIRST
</code> and
<code class=
"constant">GL_PACK_SWAP_BYTES
</code>,
817 affect the way that data is written into memory.
818 See
<a href=
"glPixelStore.xml"><span class=
"citerefentry"><span class=
"refentrytitle">glPixelStore
</span></span></a> for a description.
819 </p></div><div class=
"refsect1" lang=
"en" xml:
lang=
"en"><a id=
"notes"></a><h2>Notes
</h2><p>
820 Values for pixels that lie outside the window
821 connected to the current GL context are undefined.
823 If an error is generated,
824 no change is made to the contents of
<em class=
"parameter"><code>data
</code></em>.
825 </p></div><div class=
"refsect1" lang=
"en" xml:
lang=
"en"><a id=
"errors"></a><h2>Errors
</h2><p>
826 <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
829 <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.
831 <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>
832 and there is no stencil buffer.
834 <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>
835 and there is no depth buffer.
837 <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>
838 and there is no depth buffer or if there is no stencil buffer.
840 <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>
841 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>.
843 <code class=
"constant">GL_INVALID_OPERATION
</code> is generated if
<em class=
"parameter"><code>type
</code></em> is one of
844 <code class=
"constant">GL_UNSIGNED_BYTE_3_3_2
</code>,
845 <code class=
"constant">GL_UNSIGNED_BYTE_2_3_3_REV
</code>,
846 <code class=
"constant">GL_UNSIGNED_SHORT_5_6_5
</code>, or
847 <code class=
"constant">GL_UNSIGNED_SHORT_5_6_5_REV
</code>
848 and
<em class=
"parameter"><code>format
</code></em> is not
<code class=
"constant">GL_RGB
</code>.
850 <code class=
"constant">GL_INVALID_OPERATION
</code> is generated if
<em class=
"parameter"><code>type
</code></em> is one of
851 <code class=
"constant">GL_UNSIGNED_SHORT_4_4_4_4
</code>,
852 <code class=
"constant">GL_UNSIGNED_SHORT_4_4_4_4_REV
</code>,
853 <code class=
"constant">GL_UNSIGNED_SHORT_5_5_5_1
</code>,
854 <code class=
"constant">GL_UNSIGNED_SHORT_1_5_5_5_REV
</code>,
855 <code class=
"constant">GL_UNSIGNED_INT_8_8_8_8
</code>,
856 <code class=
"constant">GL_UNSIGNED_INT_8_8_8_8_REV
</code>,
857 <code class=
"constant">GL_UNSIGNED_INT_10_10_10_2
</code>, or
858 <code class=
"constant">GL_UNSIGNED_INT_2_10_10_10_REV
</code>
859 and
<em class=
"parameter"><code>format
</code></em> is neither
<code class=
"constant">GL_RGBA
</code> nor
<code class=
"constant">GL_BGRA
</code>.
861 <code class=
"constant">GL_INVALID_OPERATION
</code> is generated if a non-zero buffer object name is bound to the
862 <code class=
"constant">GL_PIXEL_PACK_BUFFER
</code> target and the buffer object's data store is currently mapped.
864 <code class=
"constant">GL_INVALID_OPERATION
</code> is generated if a non-zero buffer object name is bound to the
865 <code class=
"constant">GL_PIXEL_PACK_BUFFER
</code> target and the data would be packed to the buffer
866 object such that the memory writes required would exceed the data store size.
868 <code class=
"constant">GL_INVALID_OPERATION
</code> is generated if a non-zero buffer object name is bound to the
869 <code class=
"constant">GL_PIXEL_PACK_BUFFER
</code> target and
<em class=
"parameter"><code>data
</code></em> is not evenly divisible
870 into the number of bytes needed to store in memory a datum indicated by
<em class=
"parameter"><code>type
</code></em>.
872 <code class=
"constant">GL_INVALID_OPERATION
</code> is generated if
<code class=
"constant">GL_READ_FRAMEBUFFER_BINDING
</code>
873 is non-zero, the read framebuffer is complete, and the value of
<code class=
"constant">GL_SAMPLE_BUFFERS
</code>
874 for the read framebuffer is greater than zero.
875 </p></div><div class=
"refsect1" lang=
"en" xml:
lang=
"en"><a id=
"associatedgets"></a><h2>Associated Gets
</h2><p>
876 <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>
877 </p></div><div class=
"refsect1" lang=
"en" xml:
lang=
"en"><a id=
"seealso"></a><h2>See Also
</h2><p>
878 <a href=
"glPixelStore.xml"><span class=
"citerefentry"><span class=
"refentrytitle">glPixelStore
</span></span></a>,
879 <a href=
"glReadBuffer.xml"><span class=
"citerefentry"><span class=
"refentrytitle">glReadBuffer
</span></span></a>
880 </p></div><div class=
"refsect1" lang=
"en" xml:
lang=
"en"><a id=
"Copyright"></a><h2>Copyright
</h2><p>
881 Copyright
<span class=
"trademark"></span>©
1991-
2006
882 Silicon Graphics, Inc. This document is licensed under the SGI
883 Free Software B License. For details, see
884 <a href=
"http://oss.sgi.com/projects/FreeB/" target=
"_top">http://oss.sgi.com/projects/FreeB/
</a>.
885 </p></div></div></body></html>