5
.ds Dt 24 September 1999
9
.ds Xs 60568 5 logicop.gl
13
\- specify a logical pixel operation for color index rendering
22
.TP \w'\f2opcode\fP\ \ 'u
24
Specifies a symbolic constant that selects a logical operation.
25
The following symbols are accepted:
29
\%\f3GL_COPY_INVERTED\fP,
38
\%\f3GL_AND_REVERSE\fP,
39
\%\f3GL_AND_INVERTED\fP,
40
\%\f3GL_OR_REVERSE\fP, and
41
\%\f3GL_OR_INVERTED\fP. The initial value is \%\f3GL_COPY\fP.
43
\%\f3glLogicOp\fP specifies a logical operation that,
45
is applied between the incoming color index or RGBA color
46
and the color index or RGBA color at the corresponding location in the
48
To enable or disable the logical operation, call
49
\%\f3glEnable\fP and \%\f3glDisable\fP
50
using the symbolic constant \%\f3GL_COLOR_LOGIC_OP\fP for RGBA mode or
51
\%\f3GL_INDEX_LOGIC_OP\fP for color index mode. The initial value is
52
disabled for both operations.
60
Opcode Resulting Operation
65
\%\f3GL_COPY_INVERTED\fP ~s
69
\%\f3GL_NAND\fP ~(s & d)
71
\%\f3GL_NOR\fP ~(s | d)
73
\%\f3GL_EQUIV\fP ~(s ^ d)
74
\%\f3GL_AND_REVERSE\fP s & ~d
75
\%\f3GL_AND_INVERTED\fP ~s & d
76
\%\f3GL_OR_REVERSE\fP s | ~d
77
\%\f3GL_OR_INVERTED\fP ~s | d
81
\f2opcode\fP is a symbolic constant chosen from the list above.
82
In the explanation of the logical operations,
83
\f2s\fP represents the incoming color index and
84
\f2d\fP represents the index in the frame buffer.
85
Standard C-language operators are used.
86
As these bitwise operators suggest,
87
the logical operation is applied independently to each bit pair of the
88
source and destination indices or colors.
90
Color index logical operations are always supported. RGBA logical
91
operations are supported only if the GL version is 1.1 or greater.
93
When more than one RGBA color or index buffer is enabled for drawing,
94
logical operations are performed separately for each enabled buffer,
95
using for the destination value the contents of that buffer
96
(see \%\f3glDrawBuffer\fP).
98
\%\f3GL_INVALID_ENUM\fP is generated if \f2opcode\fP is not an accepted value.
100
\%\f3GL_INVALID_OPERATION\fP is generated if \%\f3glLogicOp\fP
101
is executed between the execution of \%\f3glBegin\fP
102
and the corresponding execution of \%\f3glEnd\fP.
104
\%\f3glGet\fP with argument \%\f3GL_LOGIC_OP_MODE\fP.
106
\%\f3glIsEnabled\fP with argument \%\f3GL_COLOR_LOGIC_OP\fP or \%\f3GL_INDEX_LOGIC_OP\fP.
108
\%\f3glAlphaFunc(3G)\fP,
109
\%\f3glBlendFunc(3G)\fP,
110
\%\f3glDrawBuffer(3G)\fP,
111
\%\f3glEnable(3G)\fP,
112
\%\f3glStencilOp(3G)\fP