636 lines
32 KiB
XML
636 lines
32 KiB
XML
<!DOCTYPE refentry [ <!ENTITY % mathent SYSTEM "math.ent"> %mathent; ]>
|
|
|
|
<!-- Converted by db4-upgrade version 1.1 -->
|
|
|
|
<refentry xmlns="http://docbook.org/ns/docbook" version="5.0" xml:id="glReadPixels">
|
|
<info>
|
|
<copyright>
|
|
<year>1991-2006</year>
|
|
<holder>Silicon Graphics, Inc.</holder>
|
|
</copyright>
|
|
<copyright>
|
|
<year>2010-2014</year>
|
|
<holder>Khronos Group</holder>
|
|
</copyright>
|
|
</info>
|
|
<refmeta>
|
|
<refentrytitle>glReadPixels</refentrytitle>
|
|
<manvolnum>3G</manvolnum>
|
|
</refmeta>
|
|
<refnamediv>
|
|
<refname>glReadPixels</refname>
|
|
<refpurpose>read a block of pixels from the frame buffer</refpurpose>
|
|
</refnamediv>
|
|
<refsynopsisdiv>
|
|
<title>C Specification</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>void <function>glReadPixels</function></funcdef>
|
|
<paramdef>GLint <parameter>x</parameter></paramdef>
|
|
<paramdef>GLint <parameter>y</parameter></paramdef>
|
|
<paramdef>GLsizei <parameter>width</parameter></paramdef>
|
|
<paramdef>GLsizei <parameter>height</parameter></paramdef>
|
|
<paramdef>GLenum <parameter>format</parameter></paramdef>
|
|
<paramdef>GLenum <parameter>type</parameter></paramdef>
|
|
<paramdef>GLvoid * <parameter>data</parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
</refsynopsisdiv>
|
|
<refsect1 xml:id="parameters"><title>Parameters</title>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>x</parameter></term>
|
|
<term><parameter>y</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Specify the window coordinates of the first pixel
|
|
that is read from the frame buffer.
|
|
This location is the lower left corner of a rectangular block of pixels.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>width</parameter></term>
|
|
<term><parameter>height</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Specify the dimensions of the pixel rectangle.
|
|
<parameter>width</parameter> and <parameter>height</parameter> of one correspond to a single pixel.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>format</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Specifies the format of the pixel data.
|
|
The following symbolic values are accepted:
|
|
<constant>GL_RGBA</constant>, and
|
|
<constant>GL_RGBA_INTEGER</constant>.
|
|
An implementation-chosen format will also be accepted.
|
|
This can be queried with <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> and
|
|
<constant>GL_IMPLEMENTATION_COLOR_READ_FORMAT</constant>.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>type</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Specifies the data type of the pixel data.
|
|
Must be one of
|
|
<constant>GL_UNSIGNED_BYTE</constant>,
|
|
<constant>GL_UNSIGNED_INT</constant>,
|
|
<constant>GL_INT</constant>, or
|
|
<constant>GL_FLOAT</constant>.
|
|
An implementation-chosen type will also be accepted.
|
|
This can be queried with <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> and
|
|
<constant>GL_IMPLEMENTATION_COLOR_READ_TYPE</constant>.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>data</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Returns the pixel data.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</refsect1>
|
|
<refsect1 xml:id="description"><title>Description</title>
|
|
<para>
|
|
<function>glReadPixels</function> returns pixel data from the frame buffer,
|
|
starting with the pixel whose lower left corner
|
|
is at location (<parameter>x</parameter>, <parameter>y</parameter>),
|
|
into client memory starting at location <parameter>data</parameter>.
|
|
Several parameters control the processing of the pixel data before
|
|
it is placed into client memory.
|
|
These parameters are set with <citerefentry><refentrytitle>glPixelStorei</refentrytitle></citerefentry>.
|
|
This reference page describes the effects on <function>glReadPixels</function> of most,
|
|
but not all of the parameters specified by these three commands.
|
|
</para>
|
|
<para>
|
|
If a non-zero named buffer object is bound to the <constant>GL_PIXEL_PACK_BUFFER</constant> target
|
|
(see <citerefentry><refentrytitle>glBindBuffer</refentrytitle></citerefentry>) while a block of pixels is
|
|
requested, <parameter>data</parameter> is treated as a byte offset into the buffer object's data store
|
|
rather than a pointer to client memory.
|
|
</para>
|
|
<para>
|
|
<function>glReadPixels</function> returns values from each pixel with lower left corner at
|
|
<inlineequation><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
|
|
<!-- eqn: (x + i, y + j): -->
|
|
<mml:mfenced open="(" close=")">
|
|
<mml:mrow>
|
|
<mml:mi mathvariant="italic">x</mml:mi>
|
|
<mml:mo>+</mml:mo>
|
|
<mml:mi mathvariant="italic">i</mml:mi>
|
|
</mml:mrow>
|
|
<mml:mrow>
|
|
<mml:mi mathvariant="italic">y</mml:mi>
|
|
<mml:mo>+</mml:mo>
|
|
<mml:mi mathvariant="italic">j</mml:mi>
|
|
</mml:mrow>
|
|
</mml:mfenced>
|
|
</mml:math></inlineequation>
|
|
for
|
|
<inlineequation><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
|
|
<!-- eqn: 0 <= i < width: -->
|
|
<mml:mrow>
|
|
<mml:mn>0</mml:mn>
|
|
<mml:mo><=</mml:mo>
|
|
<mml:mi mathvariant="italic">i</mml:mi>
|
|
<mml:mo><</mml:mo>
|
|
<mml:mi mathvariant="italic">width</mml:mi>
|
|
</mml:mrow>
|
|
</mml:math></inlineequation>
|
|
and
|
|
<inlineequation><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
|
|
<!-- eqn: 0 <= j < height: -->
|
|
<mml:mrow>
|
|
<mml:mn>0</mml:mn>
|
|
<mml:mo><=</mml:mo>
|
|
<mml:mi mathvariant="italic">j</mml:mi>
|
|
<mml:mo><</mml:mo>
|
|
<mml:mi mathvariant="italic">height</mml:mi>
|
|
</mml:mrow>
|
|
</mml:math></inlineequation>.
|
|
This pixel is said to be the
|
|
<inlineequation><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">i</mml:mi></mml:math></inlineequation>th
|
|
pixel in the
|
|
<inlineequation><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">j</mml:mi></mml:math></inlineequation>th
|
|
row.
|
|
Pixels are returned in row order from the lowest to the highest row,
|
|
left to right in each row.
|
|
</para>
|
|
<para>
|
|
<parameter>format</parameter> specifies the format for the returned pixel values;
|
|
accepted values are
|
|
<constant>GL_RED</constant>,
|
|
<constant>GL_RED_INTEGER</constant>,
|
|
<constant>GL_RG</constant>,
|
|
<constant>GL_RG_INTEGER</constant>,
|
|
<constant>GL_RGB</constant>,
|
|
<constant>GL_RGB_INTEGER</constant>,
|
|
<constant>GL_RGBA</constant>,
|
|
<constant>GL_RGBA_INTEGER</constant>,
|
|
<constant>GL_LUMINANCE_ALPHA</constant>,
|
|
<constant>GL_LUMINANCE</constant>, and
|
|
<constant>GL_ALPHA</constant>
|
|
</para>
|
|
<para>
|
|
Finally, the indices or components
|
|
are converted to the proper format,
|
|
as specified by <parameter>type</parameter>.
|
|
If <parameter>type</parameter> is <constant>GL_FLOAT</constant>, then each integer index is converted to
|
|
single-precision floating-point format.
|
|
</para>
|
|
<para>
|
|
If <parameter>format</parameter> is
|
|
<constant>GL_RED</constant>,
|
|
<constant>GL_RG</constant>,
|
|
<constant>GL_RGB</constant>, or
|
|
<constant>GL_RGBA</constant>, and <parameter>type</parameter> is not <constant>GL_FLOAT</constant>,
|
|
each component is multiplied by the multiplier shown in the following table.
|
|
If type is <constant>GL_FLOAT</constant>, then each component is passed as is
|
|
(or converted to the client's single-precision floating-point format if
|
|
it is different from the one used by the GL).
|
|
</para>
|
|
<para>
|
|
</para>
|
|
<informaltable>
|
|
<tgroup cols="4" align="left">
|
|
<colspec/>
|
|
<colspec align="center"/>
|
|
<colspec align="center"/>
|
|
<thead>
|
|
<row>
|
|
<entry>
|
|
<parameter>type</parameter>
|
|
</entry>
|
|
<entry>
|
|
<emphasis role="bold"> Index Mask </emphasis>
|
|
</entry>
|
|
<entry>
|
|
<emphasis role="bold"> Component Conversion </emphasis>
|
|
</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>
|
|
<constant>GL_UNSIGNED_BYTE</constant>
|
|
</entry>
|
|
<entry>
|
|
<inlineequation><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
|
|
<!-- eqn: 2 sup 8 - 1: -->
|
|
<mml:mrow>
|
|
<mml:msup><mml:mn>2</mml:mn>
|
|
<mml:mn>8</mml:mn>
|
|
</mml:msup>
|
|
<mml:mo>-</mml:mo>
|
|
<mml:mn>1</mml:mn>
|
|
</mml:mrow>
|
|
</mml:math></inlineequation>
|
|
</entry>
|
|
<entry>
|
|
<inlineequation><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
|
|
<!-- eqn: (2 sup 8 - 1) c: -->
|
|
<mml:mrow>
|
|
<mml:mfenced open="(" close=")">
|
|
<mml:mrow>
|
|
<mml:msup><mml:mn>2</mml:mn>
|
|
<mml:mn>8</mml:mn>
|
|
</mml:msup>
|
|
<mml:mo>-</mml:mo>
|
|
<mml:mn>1</mml:mn>
|
|
</mml:mrow>
|
|
</mml:mfenced>
|
|
<mml:mo>⁢</mml:mo>
|
|
<mml:mi mathvariant="italic">c</mml:mi>
|
|
</mml:mrow>
|
|
</mml:math></inlineequation>
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>
|
|
<constant>GL_BYTE</constant>
|
|
</entry>
|
|
<entry>
|
|
<inlineequation><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
|
|
<!-- eqn: 2 sup 7 - 1: -->
|
|
<mml:mrow>
|
|
<mml:msup><mml:mn>2</mml:mn>
|
|
<mml:mn>7</mml:mn>
|
|
</mml:msup>
|
|
<mml:mo>-</mml:mo>
|
|
<mml:mn>1</mml:mn>
|
|
</mml:mrow>
|
|
</mml:math></inlineequation>
|
|
</entry>
|
|
<entry>
|
|
<inlineequation><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
|
|
<!-- eqn: {(2 sup 8 - 1) c - 1} / 2: -->
|
|
<mml:mfrac>
|
|
<mml:mfenced open="" close="">
|
|
<mml:mrow>
|
|
<mml:mfenced open="(" close=")">
|
|
<mml:mrow>
|
|
<mml:msup><mml:mn>2</mml:mn>
|
|
<mml:mn>8</mml:mn>
|
|
</mml:msup>
|
|
<mml:mo>-</mml:mo>
|
|
<mml:mn>1</mml:mn>
|
|
</mml:mrow>
|
|
</mml:mfenced>
|
|
<mml:mo>⁢</mml:mo>
|
|
<mml:mi mathvariant="italic">c</mml:mi>
|
|
<mml:mo>-</mml:mo>
|
|
<mml:mn>1</mml:mn>
|
|
</mml:mrow>
|
|
</mml:mfenced>
|
|
<mml:mn>2</mml:mn>
|
|
</mml:mfrac>
|
|
</mml:math></inlineequation>
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>
|
|
<constant>GL_HALF_FLOAT</constant>
|
|
</entry>
|
|
<entry>
|
|
none
|
|
</entry>
|
|
<entry>
|
|
<inlineequation><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">c</mml:mi></mml:math></inlineequation>
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>
|
|
<constant>GL_FLOAT</constant>
|
|
</entry>
|
|
<entry>
|
|
none
|
|
</entry>
|
|
<entry>
|
|
<inlineequation><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">c</mml:mi></mml:math></inlineequation>
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>
|
|
<constant>GL_UNSIGNED_SHORT_5_6_5</constant>
|
|
</entry>
|
|
<entry>
|
|
<inlineequation><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
|
|
<!-- eqn: 2 sup N - 1: -->
|
|
<mml:mrow>
|
|
<mml:msup><mml:mn>2</mml:mn>
|
|
<mml:mn>N</mml:mn>
|
|
</mml:msup>
|
|
<mml:mo>-</mml:mo>
|
|
<mml:mn>1</mml:mn>
|
|
</mml:mrow>
|
|
</mml:math></inlineequation>
|
|
</entry>
|
|
<entry>
|
|
<inlineequation><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
|
|
<!-- eqn: (2 sup N - 1) c: -->
|
|
<mml:mrow>
|
|
<mml:mfenced open="(" close=")">
|
|
<mml:mrow>
|
|
<mml:msup><mml:mn>2</mml:mn>
|
|
<mml:mn>N</mml:mn>
|
|
</mml:msup>
|
|
<mml:mo>-</mml:mo>
|
|
<mml:mn>1</mml:mn>
|
|
</mml:mrow>
|
|
</mml:mfenced>
|
|
<mml:mo>⁢</mml:mo>
|
|
<mml:mi mathvariant="italic">c</mml:mi>
|
|
</mml:mrow>
|
|
</mml:math></inlineequation>
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>
|
|
<constant>GL_UNSIGNED_SHORT_4_4_4_4</constant>
|
|
</entry>
|
|
<entry>
|
|
<inlineequation><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
|
|
<!-- eqn: 2 sup N - 1: -->
|
|
<mml:mrow>
|
|
<mml:msup><mml:mn>2</mml:mn>
|
|
<mml:mn>N</mml:mn>
|
|
</mml:msup>
|
|
<mml:mo>-</mml:mo>
|
|
<mml:mn>1</mml:mn>
|
|
</mml:mrow>
|
|
</mml:math></inlineequation>
|
|
</entry>
|
|
<entry>
|
|
<inlineequation><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
|
|
<!-- eqn: (2 sup N - 1) c: -->
|
|
<mml:mrow>
|
|
<mml:mfenced open="(" close=")">
|
|
<mml:mrow>
|
|
<mml:msup><mml:mn>2</mml:mn>
|
|
<mml:mn>N</mml:mn>
|
|
</mml:msup>
|
|
<mml:mo>-</mml:mo>
|
|
<mml:mn>1</mml:mn>
|
|
</mml:mrow>
|
|
</mml:mfenced>
|
|
<mml:mo>⁢</mml:mo>
|
|
<mml:mi mathvariant="italic">c</mml:mi>
|
|
</mml:mrow>
|
|
</mml:math></inlineequation>
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>
|
|
<constant>GL_UNSIGNED_SHORT_5_5_5_1</constant>
|
|
</entry>
|
|
<entry>
|
|
<inlineequation><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
|
|
<!-- eqn: 2 sup N - 1: -->
|
|
<mml:mrow>
|
|
<mml:msup><mml:mn>2</mml:mn>
|
|
<mml:mn>N</mml:mn>
|
|
</mml:msup>
|
|
<mml:mo>-</mml:mo>
|
|
<mml:mn>1</mml:mn>
|
|
</mml:mrow>
|
|
</mml:math></inlineequation>
|
|
</entry>
|
|
<entry>
|
|
<inlineequation><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
|
|
<!-- eqn: (2 sup N - 1) c: -->
|
|
<mml:mrow>
|
|
<mml:mfenced open="(" close=")">
|
|
<mml:mrow>
|
|
<mml:msup><mml:mn>2</mml:mn>
|
|
<mml:mn>N</mml:mn>
|
|
</mml:msup>
|
|
<mml:mo>-</mml:mo>
|
|
<mml:mn>1</mml:mn>
|
|
</mml:mrow>
|
|
</mml:mfenced>
|
|
<mml:mo>⁢</mml:mo>
|
|
<mml:mi mathvariant="italic">c</mml:mi>
|
|
</mml:mrow>
|
|
</mml:math></inlineequation>
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>
|
|
<constant>GL_UNSIGNED_INT_2_10_10_10_REV</constant>
|
|
</entry>
|
|
<entry>
|
|
<inlineequation><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
|
|
<!-- eqn: 2 sup N - 1: -->
|
|
<mml:mrow>
|
|
<mml:msup><mml:mn>2</mml:mn>
|
|
<mml:mn>N</mml:mn>
|
|
</mml:msup>
|
|
<mml:mo>-</mml:mo>
|
|
<mml:mn>1</mml:mn>
|
|
</mml:mrow>
|
|
</mml:math></inlineequation>
|
|
</entry>
|
|
<entry>
|
|
<inlineequation><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
|
|
<!-- eqn: (2 sup N - 1) c: -->
|
|
<mml:mrow>
|
|
<mml:mfenced open="(" close=")">
|
|
<mml:mrow>
|
|
<mml:msup><mml:mn>2</mml:mn>
|
|
<mml:mn>N</mml:mn>
|
|
</mml:msup>
|
|
<mml:mo>-</mml:mo>
|
|
<mml:mn>1</mml:mn>
|
|
</mml:mrow>
|
|
</mml:mfenced>
|
|
<mml:mo>⁢</mml:mo>
|
|
<mml:mi mathvariant="italic">c</mml:mi>
|
|
</mml:mrow>
|
|
</mml:math></inlineequation>
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>
|
|
<constant>GL_UNSIGNED_INT_10F_11F_11F_REV</constant>
|
|
</entry>
|
|
<entry>
|
|
--
|
|
</entry>
|
|
<entry>
|
|
Special
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>
|
|
<constant>GL_UNSIGNED_INT_5_9_9_9_REV</constant>
|
|
</entry>
|
|
<entry>
|
|
--
|
|
</entry>
|
|
<entry>
|
|
Special
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
<para>
|
|
Return values are placed in memory as follows.
|
|
If <parameter>format</parameter> is
|
|
<constant>GL_RED</constant>, or
|
|
<constant>GL_RED_INTEGER</constant>,
|
|
a single value is returned and the data for the
|
|
<inlineequation><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">i</mml:mi></mml:math></inlineequation>th
|
|
pixel in the
|
|
<inlineequation><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">j</mml:mi></mml:math></inlineequation>th
|
|
row
|
|
is placed in location
|
|
<inlineequation><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
|
|
<!-- eqn: (j) width + i: -->
|
|
<mml:mrow>
|
|
<mml:mfenced open="(" close=")">
|
|
<mml:mi mathvariant="italic">j</mml:mi>
|
|
</mml:mfenced>
|
|
<mml:mo>⁢</mml:mo>
|
|
<mml:mi mathvariant="italic">width</mml:mi>
|
|
<mml:mo>+</mml:mo>
|
|
<mml:mi mathvariant="italic">i</mml:mi>
|
|
</mml:mrow>
|
|
</mml:math></inlineequation>.
|
|
<constant>GL_RG</constant> and <constant>GL_RG_INTEGER</constant> return two values,
|
|
<constant>GL_RGB</constant> and <constant>GL_RGB_INTEGER</constant> return three values,
|
|
<constant>GL_RGBA</constant> and <constant>GL_RGBA_INTEGER</constant> return four values for each pixel,
|
|
with all values corresponding to a single pixel occupying contiguous space
|
|
in <parameter>data</parameter>.
|
|
See <citerefentry><refentrytitle>glPixelStorei</refentrytitle></citerefentry> for a description of parameters which affect
|
|
the packing of data into memory.
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 xml:id="notes"><title>Notes</title>
|
|
<para>
|
|
Values for pixels that lie outside the window
|
|
connected to the current GL context are undefined.
|
|
</para>
|
|
<para>
|
|
If an error is generated,
|
|
no change is made to the contents of <parameter>data</parameter>.
|
|
</para>
|
|
<para>
|
|
Only two <parameter>format</parameter>/<parameter>type</parameter> parameter pairs are
|
|
accepted. For normalized fixed point rendering surfaces, <constant>GL_RGBA</constant>/<constant>GL_UNSIGNED_BYTE</constant> is
|
|
accepted. For signed integer rendering surfaces, <constant>GL_RGBA_INTEGER</constant>/<constant>GL_INT</constant> is accepted.
|
|
For unsigned integer rendering surfaces, <constant>GL_RGBA_INTEGER</constant>/<constant>GL_UNSIGNED_INT</constant> is accepted.
|
|
The other acceptable pair can be discovered by querying
|
|
<constant>GL_IMPLEMENTATION_COLOR_READ_FORMAT</constant> and
|
|
<constant>GL_IMPLEMENTATION_COLOR_READ_TYPE</constant>. The implementation chosen format may also vary depending on the
|
|
format of the currently bound rendering surface.
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 xml:id="errors"><title>Errors</title>
|
|
<para>
|
|
<constant>GL_INVALID_ENUM</constant> is generated if <parameter>format</parameter> or <parameter>type</parameter> is not an
|
|
accepted value.
|
|
</para>
|
|
<para>
|
|
<constant>GL_INVALID_VALUE</constant> is generated if either <parameter>width</parameter> or <parameter>height</parameter> is negative.
|
|
</para>
|
|
<para>
|
|
<constant>GL_INVALID_OPERATION</constant> is generated if a non-zero buffer object name is bound to the
|
|
<constant>GL_PIXEL_PACK_BUFFER</constant> target and the buffer object's data store is currently mapped.
|
|
</para>
|
|
<para>
|
|
<constant>GL_INVALID_OPERATION</constant> is generated if a non-zero buffer object name is bound to the
|
|
<constant>GL_PIXEL_PACK_BUFFER</constant> target and the data would be packed to the buffer
|
|
object such that the memory writes required would exceed the data store size.
|
|
</para>
|
|
<para>
|
|
<constant>GL_INVALID_OPERATION</constant> is generated if <constant>GL_READ_BUFFER</constant> is <constant>GL_NONE</constant> or
|
|
if <constant>GL_READ_FRAMEBUFFER_BINDING</constant> is non-zero and the read buffer selects an attachment that has no image attached.
|
|
</para>
|
|
<para>
|
|
<constant>GL_INVALID_OPERATION</constant> is generated if <constant>GL_READ_FRAMEBUFFER_BINDING</constant>
|
|
is non-zero, the read framebuffer is complete, and the value of <constant>GL_SAMPLE_BUFFERS</constant>
|
|
for the read framebuffer is greater than zero.
|
|
</para>
|
|
<para>
|
|
<constant>GL_INVALID_OPERATION</constant> is generated if the readbuffer of the currently bound framebuffer is
|
|
a fixed point normalized surface and <parameter>format</parameter>
|
|
and <parameter>type</parameter> are neither <constant>GL_RGBA</constant> and
|
|
<constant>GL_UNSIGNED_BYTE</constant>, respectively, nor the format/type pair
|
|
returned by querying <constant>GL_IMPLEMENTATION_COLOR_READ_FORMAT</constant>
|
|
and <constant>GL_IMPLEMENTATION_COLOR_READ_TYPE</constant>.
|
|
</para>
|
|
<para>
|
|
<constant>GL_INVALID_OPERATION</constant> is generated if the readbuffer of the currently bound framebuffer is
|
|
a floating point surface and <parameter>format</parameter>
|
|
and <parameter>type</parameter> are neither <constant>GL_RGBA</constant> and
|
|
<constant>GL_FLOAT</constant>, respectively, nor the format/type pair
|
|
returned by querying <constant>GL_IMPLEMENTATION_COLOR_READ_FORMAT</constant>
|
|
and <constant>GL_IMPLEMENTATION_COLOR_READ_TYPE</constant>.
|
|
</para>
|
|
<para>
|
|
<constant>GL_INVALID_OPERATION</constant> is generated if the readbuffer of the currently bound framebuffer is
|
|
a signed integer surface and <parameter>format</parameter>
|
|
and <parameter>type</parameter> are neither <constant>GL_RGBA_INTEGER</constant> and
|
|
<constant>GL_INT</constant>, respectively, nor the format/type pair
|
|
returned by querying <constant>GL_IMPLEMENTATION_COLOR_READ_FORMAT</constant>
|
|
and <constant>GL_IMPLEMENTATION_COLOR_READ_TYPE</constant>.
|
|
</para>
|
|
<para>
|
|
<constant>GL_INVALID_OPERATION</constant> is generated if the readbuffer of the currently bound framebuffer is
|
|
an unsigned integer surface and <parameter>format</parameter>
|
|
and <parameter>type</parameter> are neither <constant>GL_RGBA_INTEGER</constant> and
|
|
<constant>GL_UNSIGNED_INT</constant>, respectively, nor the format/type pair
|
|
returned by querying <constant>GL_IMPLEMENTATION_COLOR_READ_FORMAT</constant>
|
|
and <constant>GL_IMPLEMENTATION_COLOR_READ_TYPE</constant>.
|
|
</para>
|
|
<para>
|
|
<constant>GL_INVALID_FRAMEBUFFER_OPERATION</constant> is generated if
|
|
the currently bound framebuffer is not framebuffer complete (i.e. the
|
|
return value from <citerefentry><refentrytitle>glCheckFramebufferStatus</refentrytitle></citerefentry>
|
|
is not <constant>GL_FRAMEBUFFER_COMPLETE</constant>).
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 xml:id="associatedgets"><title>Associated Gets</title>
|
|
<para>
|
|
<citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_PIXEL_PACK_BUFFER_BINDING</constant>
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 xml:id="versions">
|
|
<title>API Version Support</title>
|
|
<informaltable>
|
|
<tgroup cols="4" align="left">
|
|
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="apifunchead.xml" xpointer="xpointer(/*/*)"/>
|
|
<tbody>
|
|
<row>
|
|
<entry>glReadPixels</entry>
|
|
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="apiversion.xml" xpointer="xpointer(/*/*[@role='es20']/*)"/>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</refsect1>
|
|
<refsect1 xml:id="seealso"><title>See Also</title>
|
|
<para>
|
|
<citerefentry><refentrytitle>glPixelStorei</refentrytitle></citerefentry>,
|
|
<citerefentry><refentrytitle>glReadBuffer</refentrytitle></citerefentry>
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 xml:id="Copyright"><title>Copyright</title>
|
|
<para>
|
|
Copyright <trademark class="copyright"/> 1991-2006 Silicon Graphics, Inc.
|
|
Copyright <trademark class="copyright"/> 2010-2014 Khronos Group.
|
|
This document is licensed under the SGI Free Software B License.
|
|
For details, see
|
|
<link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/</link>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|