1GLLOGICOP(3G) OpenGL Manual GLLOGICOP(3G)
2
3
4
6 glLogicOp - specify a logical pixel operation for rendering
7
9 void glLogicOp(GLenum opcode);
10
12 opcode
13 Specifies a symbolic constant that selects a logical operation. The
14 following symbols are accepted: GL_CLEAR, GL_SET, GL_COPY,
15 GL_COPY_INVERTED, GL_NOOP, GL_INVERT, GL_AND, GL_NAND, GL_OR,
16 GL_NOR, GL_XOR, GL_EQUIV, GL_AND_REVERSE, GL_AND_INVERTED,
17 GL_OR_REVERSE, and GL_OR_INVERTED. The initial value is GL_COPY.
18
20 glLogicOp specifies a logical operation that, when enabled, is applied
21 between the incoming RGBA color and the RGBA color at the corresponding
22 location in the frame buffer. To enable or disable the logical
23 operation, call glEnable() and glDisable() using the symbolic constant
24 GL_COLOR_LOGIC_OP. The initial value is disabled.
25
26 ┌───────────────────────────────┬───────────────────────────────────┐
27 │ │ │
28 │ Opcode │ Resulting │
29 │ │ Operation │
30 │ │ │
31 ├───────────────────────────────┼───────────────────────────────────┤
32 │GL_CLEAR │ 0 │
33 ├───────────────────────────────┼───────────────────────────────────┤
34 │GL_SET │ 1 │
35 ├───────────────────────────────┼───────────────────────────────────┤
36 │GL_COPY │ s │
37 ├───────────────────────────────┼───────────────────────────────────┤
38 │GL_COPY_INVERTED │ ~s │
39 ├───────────────────────────────┼───────────────────────────────────┤
40 │GL_NOOP │ d │
41 ├───────────────────────────────┼───────────────────────────────────┤
42 │GL_INVERT │ ~d │
43 ├───────────────────────────────┼───────────────────────────────────┤
44 │GL_AND │ s & d │
45 ├───────────────────────────────┼───────────────────────────────────┤
46 │GL_NAND │ ~(s & d) │
47 ├───────────────────────────────┼───────────────────────────────────┤
48 │GL_OR │ s | d │
49 ├───────────────────────────────┼───────────────────────────────────┤
50 │GL_NOR │ ~(s | d) │
51 ├───────────────────────────────┼───────────────────────────────────┤
52 │GL_XOR │ s ^ d │
53 ├───────────────────────────────┼───────────────────────────────────┤
54 │GL_EQUIV │ ~(s ^ d) │
55 ├───────────────────────────────┼───────────────────────────────────┤
56 │GL_AND_REVERSE │ s & ~d │
57 ├───────────────────────────────┼───────────────────────────────────┤
58 │GL_AND_INVERTED │ ~s & d │
59 ├───────────────────────────────┼───────────────────────────────────┤
60 │GL_OR_REVERSE │ s | ~d │
61 ├───────────────────────────────┼───────────────────────────────────┤
62 │GL_OR_INVERTED │ ~s | d │
63 └───────────────────────────────┴───────────────────────────────────┘
64
65 opcode is a symbolic constant chosen from the list above. In the
66 explanation of the logical operations, s represents the incoming color
67 and d represents the color in the frame buffer. Standard C-language
68 operators are used. As these bitwise operators suggest, the logical
69 operation is applied independently to each bit pair of the source and
70 destination colors.
71
73 When more than one RGBA color buffer is enabled for drawing, logical
74 operations are performed separately for each enabled buffer, using for
75 the destination value the contents of that buffer (see glDrawBuffer()).
76
77 Logic operations have no effect on floating point draw buffers.
78 However, if GL_COLOR_LOGIC_OP is enabled, blending is still disabled in
79 this case.
80
82 GL_INVALID_ENUM is generated if opcode is not an accepted value.
83
85 glGet() with argument GL_LOGIC_OP_MODE.
86
87 glIsEnabled() with argument GL_COLOR_LOGIC_OP.
88
90 glBlendFunc(), glDrawBuffer(), glEnable(), glStencilOp()
91
93 Copyright © 1991-2006 Silicon Graphics, Inc. This document is licensed
94 under the SGI Free Software B License. For details, see
95 http://oss.sgi.com/projects/FreeB/.
96
98 opengl.org
99
100
101
102opengl.org 06/10/2014 GLLOGICOP(3G)