GLOGICOP(3G) GLOGICOP(3G)
NAME
glLogicOp - specify a logical pixel operation for color index rendering
C SPECIFICATION
void glLogicOp( GLenum opcode )
PARAMETERS
opcode Specifies a symbolic constant that selects a logical operation.
The following symbols are accepted: GLCLEAR, GLSET, GLCOPY,
GLCOPYINVERTED, GLNOP, GLINVERT, GLAND, GLNAND, GLOR,
GLNOR, GLXOR, GLEQUIV, GLANDREVERSE, GLANDINVERTED,
GLOREVERSE, and GLORINVERTED. The initial value is
GLCOPY.
DESCRIPTION
glLogicOp specifies a logical operation that, when enabled, is applied
between the incoming color index or RGBA color and the color index or
RGBA color at the corresponding location in the frame buffer. To
enable or disable the logical operation, call glEnable and glDisable
using the symbolic constant GLCOLORLOGICOP for RGBA mode or
GLINDEXLOGICOP for color index mode. The initial value is disabled
for both operations.
Opcode Resulting Operation
GLCLEAR 0
GLSET 1
GLCOPY s
GLCOPYINVERTED ~s
GLNOP d
GLINVERT ~d
GLAND s & d
GLNAND ~(s & d)
GLOR s d
GLNOR ~(s d)
GLXOR s ^ d
GLEQUIV ~(s ^ d)
GLANDREVERSE s & ~d
GLANDINVERTED ~s & d
GLOREVERSE s ~d
GLORINVERTED ~s d
opcode is a symbolic constant chosen from the list above. In the
explanation of the logical operations, s represents the incoming color
index and d represents the index in the frame buffer. Standard C-lan-
guage operators are used. As these bitwise operators suggest, the log-
ical operation is applied independently to each bit pair of the source
and destination indices or colors.
NOTES
Color index logical operations are always supported. RGBA logical oper-
ations are supported only if the GL version is 1.1 or greater.
When more than one RGBA color or index 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
glDrawBuffer).
ERORS
GLINVALIDENUM is generated if opcode is not an accepted value.
GLINVALIDOPERATION is generated if glLogicOp is executed between the
execution of glBegin and the corresponding execution of glEnd.
ASOCIATED GETS
glGet with argument GLOGICOPMODE.
glIsEnabled with argument GLCOLORLOGICOP or GLINDEXLOGICOP.
SEE ALSO
glAlphaFunc, glBlendFunc, glDrawBuffer, glEnable, glStencilOp
GLOGICOP(3G)
|