Specifies the logical, arithmetic, or comparison operation for pixel updates.
FORTRAN (libfgl.a)
void logicop(Int32 opcode)
SUBROUTINE LOGICO(opcode) INTEGER*4 opcode
The logicop subroutine specifies the bitwise logical, arithmetic, or comparison operation for pixel updates. The operation is applied between the incoming (source) and existing (destination) values to generate the final pixel value. In color map mode, all writemask-enabled index bits (up to 12) are changed. In RGB mode, all enabled component bits (up to 32) are changed.
The logicop subroutine defaults to the value of LO_SRC, meaning that the incoming (source) value replaces the existing (destination) value.
The arithmetic and comparison operations treat each channel (R, G, and B) separately. That is, the result of an arithmetic or comparison operation in one channel does not affect the others; each channel is treated as a separate 8-bit entity, rather than a part of a 24-bit quantity. For example, if the opcode parameter is set to the LO_MAX value, if the current pixel has an RGB intensity of (119, 34, 230), and the incoming pixel has an intensity of (180, 180, 180), the final pixel value is (180, 180, 230).
The pixel color comparisons do not affect the way the z-buffer works. Z-buffer comparisons and color comparisons can be done simultaneously. The color of a pixel is updated only if the z-buffer comparison passed first; the color is then updated if the color comparison test passes. This function is more general than that provided by the zsource subroutine with a ZSRC_COLOR setting because it does not disable z-comparisons the way that the zsource subroutine does.
The arithmetic operations in each channel saturate, rather than wrap around. Because each color channel is 8 bits deep, color values saturate at 255 and 0. For example, if the opcode parameter is set to the LO_SUM value, if the current pixel has an RGB intensity of (119, 34, 230), and the incoming pixel has an intensity of (180, 180, 180), then the final pixel value is (255, 214, 255).
It is not possible to do logical and blending operations simultaneously. When the opcode parameter is set to any value other than LO_SRC, the blendfunction subroutine values sfactor and dfactor are forced to their default values, BF_ONE and BF_ZERO, respectively. Likewise, calling the blendfunction subroutine with arguments other than BF_ONE and BF_ZERO forces the logical opcode to a value of LO_SRC.
Unlike the blendfunction subroutine, the logicop subroutine is valid in all drawing modes (NORMALDRAW, UNDERDRAW, OVERDRAW, PUPDRAW, CURSORDRAW) and in both color map and RGB modes. Like the blendfunction subroutine, it affects all drawing operations, including points, lines, polygons, and pixel area transfers. The logicop subroutine does not affect pixel block transfers (blits) into the z-buffer.
The logicop subroutine functions in systems without alpha bitplanes.
Note: Use the logicop subroutine when drawing antialiased lines to improve the appearance of intersecting lines.
This subroutine is part of GL in the AIXwindows Environment/6000 Version 1, Release 2 with AIXwindows/3D Feature.
The numeric assignment of the 22 operation names were chosen to be identical to those defined by the AIXwindows system.
The LO_MAX, LO_MIN, LO_SUM, LO_DMS, LO_SMD, and LO_AVG values are not supported on the 3-D Color Graphics Processor, the Supergraphics Processor Subsystem, or the POWER GXT1000 adapter.
/usr/include/gl/gl.h | Contains C language constant and variable type definitions for GL. |
/usr/include/gl/fgl.h | Contains FORTRAN constant and variable type definitions for GL. |
Specifying the alpha blending ratio with the blendfunction subroutine.
Specifying either depth or color as the source for z comparisons with the zsource subroutine.
Writemasks and Logical Operations and Working in Color Map and RGB Modes.