Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

raster operation codes

4 views
Skip to first unread message

Meier Rudolf

unread,
Nov 27, 2004, 4:49:01 AM11/27/04
to
Hi

A ternary raster operation code is a 32-bit integer whose high-order word is
a Boolean operaion index and whose low-order word is the operation code. ...
that's what MSDN says... now, assume that I have only the Boolean operation
index... how can I get the operation code? Is there some system behind? Or
do I have to use a table? (by the way... is this windows-specific?)

MR


Maxim S. Shatskih

unread,
Nov 27, 2004, 4:14:21 PM11/27/04
to
First the binary ROPs. They are 4bit values.

There are 4 possible combinations of Src and Dst bits - S=1:D=1, S=0:D=1,
S=1:D=0, S=0:D=0. Each bit position in the binary ROP means - whether the
result bit will be 1 for such a combination of Src and Dst bits, or will be 0.
So, 4 bits in binary ROP, which is 16 values.

Samples:

a) BLACK. Result bits are always 0, regardless of Src and Dst. So, 0000 -
ROP code 0x0.
b) WHITE. Result bits are always 1, regardless of Src and Dst. So, 1111 -
ROP code 0xf.
c) NOP. Result bits are 1 if Dst is 1 and 0 if Dst is 0, Src is irrelevant.
So, 1010 - ROP code 0xa.
d) COPY. Result bits are 1 if Src is 1 and 0 if Src is 0, Dst is
irrelevant. So, 1100 - ROP code 0xc.
e) AND. Result bit is 1 only if both Src and Dst are 1, and 0 otherwise.
So, 1000 - ROP code 0x8.
f) OR. Result bit is 0 only if both Src and Dst are 0, and 1 otherwise. So,
1110 - ROP code 0xe.
g) XOR. Result bit is 0 if Src and Dst are the same, and 1 otherwise. So,
0110 - ROP code 0x6.

The ROP2 codes from WINGDI.H are biased up by 1.

Now the ternary ROPs. A byte, senior nibble is ROP2 for Pat = 1, junior
is - ROP2 for Pat = 0. So, the pattern-less ROP3 have the same both nibbles -
like 0xcc for SRCCOPY and 0x88 for SRCAND.
PATCOPY has 0xf0 - 1 if Pat is 1, 0 otherwise. And so on.

The other bytes in ROP3 values from WINGDI.H are not known to me, possibly
they are the legacy from Win16 due to some internal Win16's stuff.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
ma...@storagecraft.com
http://www.storagecraft.com

"Meier Rudolf" <me...@gmx.net> wrote in message
news:OLokCZG1...@TK2MSFTNGP09.phx.gbl...

0 new messages