This paper lists three-dimensional raster operation codes for use by BitBlt, Patblt and StretchBlt functions. The ternary raster opcode defines how to merge bits of the source bitmap and the destination bitmap.
Each raster opcode provides a Boolean operation, which is how to merge the pixels in the source bitmap, the selected brush, and the pixel in the destination bitmap. The following are the action objects used in these operations:
Manipulating objects |
Significance |
D |
Destination bitmap |
P |
Selected brushes (also known as mode) |
S |
SOURCE Bitmap |
The following are the Boolean operators used in these operations:
Operator |
Significance |
A |
and (Bitwise AND) |
N |
Not (bitwise counter) |
O |
or (bitwise OR) |
X |
XOR (bitwise exclusive OR) |
All Boolean operations use the reverse Polish notation. For example, the following action replaces the pixel in the destination bitmap with the combination of the source bitmap pixel and the brush: PSo
The following action makes the pixels in the source bitmap merged with the brush and then merge the pixels in the destination bitmap (there are many mutable spellings for the same feature, so a particular spelling method may not be listed. And the equivalent of a format may be listed: DPSoo
each raster opcode is a 132-bit integer, its high word (high-order Word) is a Boolean operation index, its low word (low-order word) is the opcode. The 16-bit operation index starts at 0, and the 8-bit value represents the result of a Boolean operation for the intended brush, source bitmap, and destination bitmap. For example, the operations of PSO and Dpsoo are indexed as follows:
P |
S |
D |
Pso |
Dpsoo |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
1 |
0 |
1 |
0 |
1 |
0 |
1 |
1 |
0 |
1 |
1 |
1 |
1 |
1 |
0 |
0 |
1 |
1 |
1 |
0 |
1 |
1 |
1 |
1 |
1 |
0 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
Operation Index: |
|
|
00FCh |
00FEh |