1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305
|
<!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="glBlitFramebuffer">
<info>
<copyright>
<year>2010-2014</year>
<holder>Khronos Group</holder>
</copyright>
</info>
<refmeta>
<refentrytitle>glBlitFramebuffer</refentrytitle>
<manvolnum>3G</manvolnum>
</refmeta>
<refnamediv>
<refname>glBlitFramebuffer</refname>
<refname>glBlitNamedFramebuffer</refname>
<refpurpose>copy a block of pixels from one framebuffer object to another</refpurpose>
</refnamediv>
<refsynopsisdiv><title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glBlitFramebuffer</function></funcdef>
<paramdef>GLint <parameter>srcX0</parameter></paramdef>
<paramdef>GLint <parameter>srcY0</parameter></paramdef>
<paramdef>GLint <parameter>srcX1</parameter></paramdef>
<paramdef>GLint <parameter>srcY1</parameter></paramdef>
<paramdef>GLint <parameter>dstX0</parameter></paramdef>
<paramdef>GLint <parameter>dstY0</parameter></paramdef>
<paramdef>GLint <parameter>dstX1</parameter></paramdef>
<paramdef>GLint <parameter>dstY1</parameter></paramdef>
<paramdef>GLbitfield <parameter>mask</parameter></paramdef>
<paramdef>GLenum <parameter>filter</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>void <function>glBlitNamedFramebuffer</function></funcdef>
<paramdef>GLuint <parameter>readFramebuffer</parameter></paramdef>
<paramdef>GLuint <parameter>drawFramebuffer</parameter></paramdef>
<paramdef>GLint <parameter>srcX0</parameter></paramdef>
<paramdef>GLint <parameter>srcY0</parameter></paramdef>
<paramdef>GLint <parameter>srcX1</parameter></paramdef>
<paramdef>GLint <parameter>srcY1</parameter></paramdef>
<paramdef>GLint <parameter>dstX0</parameter></paramdef>
<paramdef>GLint <parameter>dstY0</parameter></paramdef>
<paramdef>GLint <parameter>dstX1</parameter></paramdef>
<paramdef>GLint <parameter>dstY1</parameter></paramdef>
<paramdef>GLbitfield <parameter>mask</parameter></paramdef>
<paramdef>GLenum <parameter>filter</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 xml:id="parameters"><title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>readFramebuffer</parameter></term>
<listitem>
<para>
Specifies the name of the source framebuffer object
for <function>glBlitNamedFramebuffer</function>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>drawFramebuffer</parameter></term>
<listitem>
<para>
Specifies the name of the destination framebuffer object
for <function>glBlitNamedFramebuffer</function>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>srcX0</parameter></term>
<term><parameter>srcY0</parameter></term>
<term><parameter>srcX1</parameter></term>
<term><parameter>srcY1</parameter></term>
<listitem>
<para>
Specify the bounds of the source rectangle within the read buffer of the read framebuffer.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>dstX0</parameter></term>
<term><parameter>dstY0</parameter></term>
<term><parameter>dstX1</parameter></term>
<term><parameter>dstY1</parameter></term>
<listitem>
<para>
Specify the bounds of the destination rectangle within the write buffer of the write framebuffer.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>mask</parameter></term>
<listitem>
<para>
The bitwise OR of the flags indicating which buffers are to be copied. The allowed flags are
<constant>GL_COLOR_BUFFER_BIT</constant>, <constant>GL_DEPTH_BUFFER_BIT</constant> and <constant>GL_STENCIL_BUFFER_BIT</constant>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>filter</parameter></term>
<listitem>
<para>
Specifies the interpolation to be applied if the image is stretched. Must be <constant>GL_NEAREST</constant> or <constant>GL_LINEAR</constant>.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 xml:id="description"><title>Description</title>
<para>
<function>glBlitFramebuffer</function> and
<function>glBlitNamedFramebuffer</function> transfer a rectangle
of pixel values from one region of a read framebuffer to another
region of a draw framebuffer.
</para>
<para>
For <function>glBlitFramebuffer</function>, the read and draw
framebuffers are those bound to the
<constant>GL_READ_FRAMEBUFFER</constant> and
<constant>GL_DRAW_FRAMEBUFFER</constant> targets respectively.
</para>
<para>
For <function>glBlitNamedFramebuffer</function>,
<parameter>readFramebuffer</parameter> and
<parameter>drawFramebuffer</parameter> are the names of the read
read and draw framebuffer objects respectively. If
<parameter>readFramebuffer</parameter> or
<parameter>drawFramebuffer</parameter> is zero, then the default
read or draw framebuffer respectively is used.
</para>
<para>
<parameter>mask</parameter> is the bitwise OR of a number of
values indicating which buffers are to be copied. The values are
<constant>GL_COLOR_BUFFER_BIT</constant>,
<constant>GL_DEPTH_BUFFER_BIT</constant>, and
<constant>GL_STENCIL_BUFFER_BIT</constant>. The pixels
corresponding to these buffers are copied from the source
rectangle bounded by the locations
(<parameter>srcX0</parameter>, <parameter>srcY0</parameter>) and
(<parameter>srcX1</parameter>, <parameter>srcY1</parameter>) to
the destination rectangle bounded by the locations
(<parameter>dstX0</parameter>, <parameter>dstY0</parameter>) and
(<parameter>dstX1</parameter>, <parameter>dstY1</parameter>).
The lower bounds of the rectangle are inclusive, while the upper
bounds are exclusive.
</para>
<para>
The actual region taken from the read framebuffer is limited to
the intersection of the source buffers being transferred, which
may include the color buffer selected by the read buffer, the
depth buffer, and/or the stencil buffer depending on mask. The
actual region written to the draw framebuffer is limited to the
intersection of the destination buffers being written, which may
include multiple draw buffers, the depth buffer, and/or the
stencil buffer depending on mask. Whether or not the source or
destination regions are altered due to these limits, the scaling
and offset applied to pixels being transferred is performed as
though no such limits were present.
</para>
<para>
If the sizes of the source and destination rectangles are not
equal, <parameter>filter</parameter> specifies the interpolation
method that will be applied to resize the source image , and
must be <constant>GL_NEAREST</constant> or
<constant>GL_LINEAR</constant>. <constant>GL_LINEAR</constant>
is only a valid interpolation method for the color buffer. If
<parameter>filter</parameter> is not
<constant>GL_NEAREST</constant> and <parameter>mask</parameter>
includes <constant>GL_DEPTH_BUFFER_BIT</constant> or
<constant>GL_STENCIL_BUFFER_BIT</constant>, no data is
transferred and a <constant>GL_INVALID_OPERATION</constant>
error is generated.
</para>
<para>
If <parameter>filter</parameter> is
<constant>GL_LINEAR</constant> and the source rectangle would
require sampling outside the bounds of the source framebuffer,
values are read as if the <constant>GL_CLAMP_TO_EDGE</constant>
texture wrapping mode were applied.
</para>
<para>
When the color buffer is transferred, values are taken from the
read buffer of the specified read framebuffer and written to
each of the draw buffers of the specified draw framebuffer.
</para>
<para>
If the source and destination rectangles overlap or are the same, and the read and draw buffers are the same, the result of the operation
is undefined.
</para>
</refsect1>
<refsect1 xml:id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated by
<function>BlitNamedFramebuffer</function> if
<parameter>readFramebuffer</parameter> or
<parameter>drawFramebuffer</parameter> is not zero or the name
of an existing framebuffer object.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if
<parameter>mask</parameter> contains any of the
<constant>GL_DEPTH_BUFFER_BIT</constant> or
<constant>GL_STENCIL_BUFFER_BIT</constant> and
<parameter>filter</parameter> is not
<constant>GL_NEAREST</constant>.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if
<parameter>mask</parameter> contains
<constant>GL_COLOR_BUFFER_BIT</constant> and any of the
following conditions hold:
<itemizedlist>
<listitem>
<para>
The read buffer contains fixed-point or
floating-point values and any draw buffer contains
neither fixed-point nor floating-point values.
</para>
</listitem>
<listitem>
<para>
The read buffer contains unsigned integer values and
any draw buffer does not contain unsigned integer
values.
</para>
</listitem>
<listitem>
<para>
The read buffer contains signed integer values and
any draw buffer does not contain signed integer
values.
</para>
</listitem>
</itemizedlist>
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if
<parameter>mask</parameter> contains
<constant>GL_DEPTH_BUFFER_BIT</constant> or
<constant>GL_STENCIL_BUFFER_BIT</constant> and the source and
destination depth and stencil formats do not match.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if
<parameter>filter</parameter> is <constant>GL_LINEAR</constant>
and the read buffer contains integer data.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if the
effective value of <constant>GL_SAMPLES</constant> for the read
and draw framebuffers is not identical.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if the
value of <constant>GL_SAMPLE_BUFFERS</constant> for both read
and draw buffers is greater than zero and the dimensions of the
source and destination rectangles is not identical.
</para>
<para>
<constant>GL_INVALID_FRAMEBUFFER_OPERATION</constant> is
generated if the specified read and draw framebuffers are not
framebuffer complete.
</para>
</refsect1>
<refsect1 xml:id="versions"><title>Version Support</title>
<informaltable>
<tgroup cols="13" align="left">
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="apifunchead.xml" xpointer="xpointer(/*/*)"/>
<tbody>
<row>
<entry><function>glBlitFramebuffer</function></entry>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="apiversion.xml" xpointer="xpointer(/*/*[@role='30']/*)"/>
</row>
<row>
<entry><function>glBlitNamedFramebuffer</function></entry>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="apiversion.xml" xpointer="xpointer(/*/*[@role='45']/*)"/>
</row>
</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 xml:id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glReadPixels</refentrytitle></citerefentry>
<citerefentry><refentrytitle>glCheckFramebufferStatus</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glGenFramebuffers</refentrytitle></citerefentry>
<citerefentry><refentrytitle>glBindFramebuffer</refentrytitle></citerefentry>
<citerefentry><refentrytitle>glDeleteFramebuffers</refentrytitle></citerefentry>
</para>
</refsect1>
<refsect1 xml:id="Copyright"><title>Copyright</title>
<para>
Copyright <trademark class="copyright"/> 2010-2014 Khronos Group.
This material may be distributed subject to the terms and conditions set forth in
the Open Publication License, v 1.0, 8 June 1999.
<link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://opencontent.org/openpub/">http://opencontent.org/openpub/</link>.
</para>
</refsect1>
</refentry>
|