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
|
<!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="glLogicOp">
<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>glLogicOp</refentrytitle>
<manvolnum>3G</manvolnum>
</refmeta>
<refnamediv>
<refname>glLogicOp</refname>
<refpurpose>specify a logical pixel operation for rendering</refpurpose>
</refnamediv>
<refsynopsisdiv><title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glLogicOp</function></funcdef>
<paramdef>GLenum <parameter>opcode</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 xml:id="parameters"><title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>opcode</parameter></term>
<listitem>
<para>
Specifies a symbolic constant that selects a logical operation.
The following symbols are accepted:
<constant>GL_CLEAR</constant>,
<constant>GL_SET</constant>,
<constant>GL_COPY</constant>,
<constant>GL_COPY_INVERTED</constant>,
<constant>GL_NOOP</constant>,
<constant>GL_INVERT</constant>,
<constant>GL_AND</constant>,
<constant>GL_NAND</constant>,
<constant>GL_OR</constant>,
<constant>GL_NOR</constant>,
<constant>GL_XOR</constant>,
<constant>GL_EQUIV</constant>,
<constant>GL_AND_REVERSE</constant>,
<constant>GL_AND_INVERTED</constant>,
<constant>GL_OR_REVERSE</constant>, and
<constant>GL_OR_INVERTED</constant>. The initial value is <constant>GL_COPY</constant>.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 xml:id="description"><title>Description</title>
<para>
<function>glLogicOp</function> specifies a logical operation that,
when enabled,
is applied between the incoming RGBA color
and the RGBA color at the corresponding location in the
frame buffer.
To enable or disable the logical operation, call
<citerefentry><refentrytitle>glEnable</refentrytitle></citerefentry> and <citerefentry><refentrytitle>glDisable</refentrytitle></citerefentry>
using the symbolic constant <constant>GL_COLOR_LOGIC_OP</constant>. The initial value is
disabled.
</para>
<para>
</para>
<informaltable>
<tgroup cols="2">
<colspec align="left"/>
<colspec align="center"/>
<thead>
<row>
<entry>
<emphasis role="bold"> Opcode </emphasis>
</entry>
<entry>
<emphasis role="bold"> Resulting Operation </emphasis>
</entry>
</row>
</thead>
<tbody>
<row>
<entry>
<constant>GL_CLEAR</constant>
</entry>
<entry>
0
</entry>
</row>
<row>
<entry>
<constant>GL_SET</constant>
</entry>
<entry>
1
</entry>
</row>
<row>
<entry>
<constant>GL_COPY</constant>
</entry>
<entry>
s
</entry>
</row>
<row>
<entry>
<constant>GL_COPY_INVERTED</constant>
</entry>
<entry>
~s
</entry>
</row>
<row>
<entry>
<constant>GL_NOOP</constant>
</entry>
<entry>
d
</entry>
</row>
<row>
<entry>
<constant>GL_INVERT</constant>
</entry>
<entry>
~d
</entry>
</row>
<row>
<entry>
<constant>GL_AND</constant>
</entry>
<entry>
s & d
</entry>
</row>
<row>
<entry>
<constant>GL_NAND</constant>
</entry>
<entry>
~(s & d)
</entry>
</row>
<row>
<entry>
<constant>GL_OR</constant>
</entry>
<entry>
s | d
</entry>
</row>
<row>
<entry>
<constant>GL_NOR</constant>
</entry>
<entry>
~(s | d)
</entry>
</row>
<row>
<entry>
<constant>GL_XOR</constant>
</entry>
<entry>
s ^ d
</entry>
</row>
<row>
<entry>
<constant>GL_EQUIV</constant>
</entry>
<entry>
~(s ^ d)
</entry>
</row>
<row>
<entry>
<constant>GL_AND_REVERSE</constant>
</entry>
<entry>
s & ~d
</entry>
</row>
<row>
<entry>
<constant>GL_AND_INVERTED</constant>
</entry>
<entry>
~s & d
</entry>
</row>
<row>
<entry>
<constant>GL_OR_REVERSE</constant>
</entry>
<entry>
s | ~d
</entry>
</row>
<row>
<entry>
<constant>GL_OR_INVERTED</constant>
</entry>
<entry>
~s | d
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
<para>
<parameter>opcode</parameter> is a symbolic constant chosen from the list above.
In the explanation of the logical operations,
<emphasis>s</emphasis> represents the incoming color and
<emphasis>d</emphasis> represents the color in the frame buffer.
Standard C-language operators are used.
As these bitwise operators suggest,
the logical operation is applied independently to each bit pair of the
source and destination colors.
</para>
</refsect1>
<refsect1 xml:id="notes"><title>Notes</title>
<para>
When more than one RGBA color buffer is enabled for drawing,
logical operations are performed separately for each enabled buffer,
using for the destination value the contents of that buffer
(see <citerefentry><refentrytitle>glDrawBuffer</refentrytitle></citerefentry>).
</para>
<para>
Logic operations have no effect on floating point draw buffers. However, if
<constant>GL_COLOR_LOGIC_OP</constant> is enabled, blending is still disabled
in this case.
</para>
</refsect1>
<refsect1 xml:id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_ENUM</constant> is generated if <parameter>opcode</parameter> is not an accepted value.
</para>
</refsect1>
<refsect1 xml:id="associatedgets"><title>Associated Gets</title>
<para>
<citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_LOGIC_OP_MODE</constant>.
</para>
<para>
<citerefentry><refentrytitle>glIsEnabled</refentrytitle></citerefentry> with argument <constant>GL_COLOR_LOGIC_OP</constant>.
</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>glLogicOp</function></entry>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="apiversion.xml" xpointer="xpointer(/*/*[@role='20']/*)"/>
</row>
</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 xml:id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glBlendFunc</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDrawBuffer</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glEnable</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glStencilOp</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>
|