1GLLOGICOP(3G) [FIXME: 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
24
25 glDisable using the symbolic constant GL_COLOR_LOGIC_OP. The initial
26 value is disabled.
27
28 ┌─────────────────┬──────────────────────┐
29 │ Opcode │ Resulting Operation │
30 ├─────────────────┼──────────────────────┤
31 │GL_CLEAR │ 0 │
32 ├─────────────────┼──────────────────────┤
33 │GL_SET │ 1 │
34 ├─────────────────┼──────────────────────┤
35 │GL_COPY │ s │
36 ├─────────────────┼──────────────────────┤
37 │GL_COPY_INVERTED │ ~s │
38 ├─────────────────┼──────────────────────┤
39 │GL_NOOP │ d │
40 ├─────────────────┼──────────────────────┤
41 │GL_INVERT │ ~d │
42 ├─────────────────┼──────────────────────┤
43 │GL_AND │ s & d │
44 ├─────────────────┼──────────────────────┤
45 │GL_NAND │ ~(s & d) │
46 ├─────────────────┼──────────────────────┤
47 │GL_OR │ s | d │
48 ├─────────────────┼──────────────────────┤
49 │GL_NOR │ ~(s | d) │
50 ├─────────────────┼──────────────────────┤
51 │GL_XOR │ s ^ d │
52 ├─────────────────┼──────────────────────┤
53 │GL_EQUIV │ ~(s ^ d) │
54 ├─────────────────┼──────────────────────┤
55 │GL_AND_REVERSE │ s & ~d │
56 ├─────────────────┼──────────────────────┤
57 │GL_AND_INVERTED │ ~s & d │
58 ├─────────────────┼──────────────────────┤
59 │GL_OR_REVERSE │ s | ~d │
60 ├─────────────────┼──────────────────────┤
61 │GL_OR_INVERTED │ ~s | d │
62 └─────────────────┴──────────────────────┘
63
64 opcode is a symbolic constant chosen from the list above. In the
65 explanation of the logical operations, s represents the incoming color
66 and d represents the color in the frame buffer. Standard C-language
67 operators are used. As these bitwise operators suggest, the logical
68 operation is applied independently to each bit pair of the source and
69 destination colors.
70
72 When more than one RGBA color buffer is enabled for drawing, logical
73 operations are performed separately for each enabled buffer, using for
74 the destination value the contents of that buffer (see glDrawBuffer()).
75
76 Logic operations have no effect on floating point draw buffers.
77 However, if GL_COLOR_LOGIC_OP is enabled, blending is still disabled in
78 this case.
79
81 GL_INVALID_ENUM is generated if opcode is not an accepted value.
82
84 glGet() with argument GL_LOGIC_OP_MODE.
85
86 glIsEnabled() with argument GL_COLOR_LOGIC_OP.
87
89 ┌──────────┬───────────────────────────────────────────────────────────────────────┐
90 │ │ OpenGL Version │
91 ├──────────┼─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┤
92 │Function │ 2.0 │ 2.1 │ 3.0 │ 3.1 │ 3.2 │ 3.3 │ 4.0 │ 4.1 │ 4.2 │ 4.3 │ 4.4 │ 4.5 │
93 │/ │ │ │ │ │ │ │ │ │ │ │ │ │
94 │Feature │ │ │ │ │ │ │ │ │ │ │ │ │
95 │Name │ │ │ │ │ │ │ │ │ │ │ │ │
96 ├──────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
97 │glLogicOp │ ✔ │ ✔ │ ✔ │ ✔ │ ✔ │ ✔ │ ✔ │ ✔ │ ✔ │ ✔ │ ✔ │ ✔ │
98 └──────────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘
99
101 glBlendFunc(), glDrawBuffer(), glEnable(), glStencilOp()
102
104 Copyright © 1991-2006 Silicon Graphics, Inc. Copyright © 2010-2014
105 Khronos Group. This document is licensed under the SGI Free Software B
106 License. For details, see http://oss.sgi.com/projects/FreeB/.
107
109 Copyright © 1991-2006 Silicon Graphics, Inc.
110 Copyright © 2010-2014 Khronos Group
111
112
113
114[FIXME: source] 07/13/2018 GLLOGICOP(3G)