include more low-level bindings
[clinton/guile-figl.git] / upstream-man-pages / man2 / xhtml / glLogicOp.xml
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "xhtml1-transitional.dtd">
2 <!-- saved from url=(0013)about:internet -->
3 <?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" /><title>glLogicOp</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /></head><body><div class="refentry" lang="en" xml:lang="en"><a id="glLogicOp"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>glLogicOp — specify a logical pixel operation for color index rendering</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">glLogicOp</b>(</code></td><td>GLenum  </td><td><var class="pdparam">opcode</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>opcode</code></em></span></dt><dd><p>
4 Specifies a symbolic constant that selects a logical operation.
5 The following symbols are accepted:
6 <code class="constant">GL_CLEAR</code>,
7 <code class="constant">GL_SET</code>,
8 <code class="constant">GL_COPY</code>,
9 <code class="constant">GL_COPY_INVERTED</code>,
10 <code class="constant">GL_NOOP</code>,
11 <code class="constant">GL_INVERT</code>,
12 <code class="constant">GL_AND</code>,
13 <code class="constant">GL_NAND</code>,
14 <code class="constant">GL_OR</code>,
15 <code class="constant">GL_NOR</code>,
16 <code class="constant">GL_XOR</code>,
17 <code class="constant">GL_EQUIV</code>,
18 <code class="constant">GL_AND_REVERSE</code>,
19 <code class="constant">GL_AND_INVERTED</code>,
20 <code class="constant">GL_OR_REVERSE</code>, and
21 <code class="constant">GL_OR_INVERTED</code>. The initial value is <code class="constant">GL_COPY</code>.
22 </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="description"></a><h2>Description</h2><p>
23 <code class="function">glLogicOp</code> specifies a logical operation that,
24 when enabled,
25 is applied between the incoming color index or RGBA color
26 and the color index or RGBA color at the corresponding location in the
27 frame buffer.
28 To enable or disable the logical operation, call
29 <a class="citerefentry" href="glEnable.xml"><span class="citerefentry"><span class="refentrytitle">glEnable</span></span></a> and <a class="citerefentry" href="glDisable.xml"><span class="citerefentry"><span class="refentrytitle">glDisable</span></span></a>
30 using the symbolic constant <code class="constant">GL_COLOR_LOGIC_OP</code> for RGBA mode or
31 <code class="constant">GL_INDEX_LOGIC_OP</code> for color index mode. The initial value is
32 disabled for both operations.
33 </p><p>
34 </p><div class="informaltable"><table border="1"><colgroup><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left"><span class="bold"><strong>
35 Opcode
36 </strong></span></th><th align="left"><span class="bold"><strong>
37 Resulting Operation
38 </strong></span></th></tr></thead><tbody><tr><td align="left">
39 <code class="constant">GL_CLEAR</code>
40 </td><td align="center">
41 0
42 </td></tr><tr><td align="left">
43 <code class="constant">GL_SET</code>
44 </td><td align="center">
45 1
46 </td></tr><tr><td align="left">
47 <code class="constant">GL_COPY</code>
48 </td><td align="center">
49 s
50 </td></tr><tr><td align="left">
51 <code class="constant">GL_COPY_INVERTED</code>
52 </td><td align="center">
53 ~s
54 </td></tr><tr><td align="left">
55 <code class="constant">GL_NOOP</code>
56 </td><td align="center">
57 d
58 </td></tr><tr><td align="left">
59 <code class="constant">GL_INVERT</code>
60 </td><td align="center">
61 ~d
62 </td></tr><tr><td align="left">
63 <code class="constant">GL_AND</code>
64 </td><td align="center">
65 s &amp; d
66 </td></tr><tr><td align="left">
67 <code class="constant">GL_NAND</code>
68 </td><td align="center">
69 ~(s &amp; d)
70 </td></tr><tr><td align="left">
71 <code class="constant">GL_OR</code>
72 </td><td align="center">
73 s | d
74 </td></tr><tr><td align="left">
75 <code class="constant">GL_NOR</code>
76 </td><td align="center">
77 ~(s | d)
78 </td></tr><tr><td align="left">
79 <code class="constant">GL_XOR</code>
80 </td><td align="center">
81 s ^ d
82 </td></tr><tr><td align="left">
83 <code class="constant">GL_EQUIV</code>
84 </td><td align="center">
85 ~(s ^ d)
86 </td></tr><tr><td align="left">
87 <code class="constant">GL_AND_REVERSE</code>
88 </td><td align="center">
89 s &amp; ~d
90 </td></tr><tr><td align="left">
91 <code class="constant">GL_AND_INVERTED</code>
92 </td><td align="center">
93 ~s &amp; d
94 </td></tr><tr><td align="left">
95 <code class="constant">GL_OR_REVERSE</code>
96 </td><td align="center">
97 s | ~d
98 </td></tr><tr><td align="left">
99 <code class="constant">GL_OR_INVERTED</code>
100 </td><td align="center">
101 ~s | d
102 </td></tr></tbody></table></div><p>
103 <em class="parameter"><code>opcode</code></em> is a symbolic constant chosen from the list above.
104 In the explanation of the logical operations,
105 <span class="emphasis"><em>s</em></span> represents the incoming color index and
106 <span class="emphasis"><em>d</em></span> represents the index in the frame buffer.
107 Standard C-language operators are used.
108 As these bitwise operators suggest,
109 the logical operation is applied independently to each bit pair of the
110 source and destination indices or colors.
111 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="notes"></a><h2>Notes</h2><p>
112 Color index logical operations are always supported. RGBA logical
113 operations are supported only if the GL version is 1.1 or greater.
114 </p><p>
115 When more than one RGBA color or index buffer is enabled for drawing,
116 logical operations are performed separately for each enabled buffer,
117 using for the destination value the contents of that buffer
118 (see <a class="citerefentry" href="glDrawBuffer.xml"><span class="citerefentry"><span class="refentrytitle">glDrawBuffer</span></span></a>).
119 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="errors"></a><h2>Errors</h2><p>
120 <code class="constant">GL_INVALID_ENUM</code> is generated if <em class="parameter"><code>opcode</code></em> is not an accepted value.
121 </p><p>
122 <code class="constant">GL_INVALID_OPERATION</code> is generated if <code class="function">glLogicOp</code>
123 is executed between the execution of <a class="citerefentry" href="glBegin.xml"><span class="citerefentry"><span class="refentrytitle">glBegin</span></span></a>
124 and the corresponding execution of <a class="citerefentry" href="glEnd.xml"><span class="citerefentry"><span class="refentrytitle">glEnd</span></span></a>.
125 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="associatedgets"></a><h2>Associated Gets</h2><p>
126 <a class="citerefentry" href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_LOGIC_OP_MODE</code>.
127 </p><p>
128 <a class="citerefentry" href="glIsEnabled.xml"><span class="citerefentry"><span class="refentrytitle">glIsEnabled</span></span></a> with argument <code class="constant">GL_COLOR_LOGIC_OP</code> or <code class="constant">GL_INDEX_LOGIC_OP</code>.
129 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p>
130 <a class="citerefentry" href="glAlphaFunc.xml"><span class="citerefentry"><span class="refentrytitle">glAlphaFunc</span></span></a>,
131 <a class="citerefentry" href="glBlendFunc.xml"><span class="citerefentry"><span class="refentrytitle">glBlendFunc</span></span></a>,
132 <a class="citerefentry" href="glDrawBuffer.xml"><span class="citerefentry"><span class="refentrytitle">glDrawBuffer</span></span></a>,
133 <a class="citerefentry" href="glEnable.xml"><span class="citerefentry"><span class="refentrytitle">glEnable</span></span></a>,
134 <a class="citerefentry" href="glStencilOp.xml"><span class="citerefentry"><span class="refentrytitle">glStencilOp</span></span></a>
135 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="Copyright"></a><h2>Copyright</h2><p>
136 Copyright <span class="trademark"></span>© 1991-2006
137 Silicon Graphics, Inc. This document is licensed under the SGI
138 Free Software B License. For details, see
139 <a class="ulink" href="http://oss.sgi.com/projects/FreeB/" target="_top">http://oss.sgi.com/projects/FreeB/</a>.
140 </p></div></div></body></html>