IIXC_Page::Rop3 Method
From PDF XChange PDF SDK
The Rop3 method combines up to three images in different ways using the raster operations codes (ROP3).
Syntax
HRESULT Rop3([in] RECT* stRect, [in] IIXC_Page* pSrcFrom, [in] LONG nSrcX, [in] LONG nSrcY, [in] ULONG nSrcColor, [in] IIXC_Page* pPattern, [in] LONG nPatX, [in] LONG nPatY, [in] ULONG nPatColor, [in] UCHAR nRopCode, [in] ULONG nFlags);
Parameters
- stRect
- [in] Pointer to RECT specifies the rectangular area on the destination page which will be affected. If NULL then the entire page will be used.
- pSrcFrom
- [in] Specifies the IIXC_Page of the source page. This parameter can be NULL (see Comments for details).
- nSrcX
- [in] Specifies the x-coordinate of the left-top corner of the affected rectangle in the source page.
- nSrcY
- [in] Specifies the y-coordinate of the left-top corner of the affected rectangle in the source page.
- nSrcColor
- [in] Specifies the color which should be used if pSource is NULL.
- pPattern
- [in] Specifies the IIXC_Page of the pattern page. This parameter can be NULL (see Comments for details).
- nPatX
- [in] Specifies the x-coordinate of the left-top corner of the affected rectangle in pattern page.
- nPatY
- [in] Specifies the y-coordinate of the left-top corner of the affected rectangle in pattern page.
- nPatColor
- [in] Specifies the color which should be used if pPattern is NULL.
- nRopCode
- [in] Specifies a ternary raster-operation value. This value determines how BitBlt combines corresponding pixels from the source, destination, and pattern that is used to produce the final pixels in the destination rectangle. This parameter can be any one of 256 ternary raster-operation values; the following lists the most common values:
Constant Value Meaning SRCCOPY 0xCC = 0xCC
Destination = SourceCopies source bits to the destination rectangle SRCPAINT 0xAA
Destination = Source | DestinationCombines the source and destination bits using the bitwise OR operator SRCAND 0x88 = 0xCC & 0xAA
Destination = Source & DestinationCombines the source and destination bits using the bitwise AND operator SRCINVERT 0x66 = 0xCC ^ 0xAA
Destination = Source ^ DestinationCombines the source and destination bits using the bitwise exclusive OR operator SRCERASE 0x44 = 0xCC & (~0xAA)
Destination = Source & (~ Destination)Combines the source and inverse of destination bits using the bitwise AND operator NOTSRCCOPY 0x33 = ~0xAA
Destination = ~ DestinationCopies the inverse of the destination bits to the destination rectangle NOTSRCERASE 0x11 = (~0xCC) & (~0xAA)
Destination = (~ Source) & (~ Destination)Combines the inverse of the source and destination bits using the bitwise AND operator MERGECOPY 0xC0 = 0xCC & 0xF0
Destination = Source & pPatternCombines the source and pattern bits using the bitwise AND operator MERGEPAINT 0xAA
Destination = (~ Source) | DestinationCombines the destination and inverse of the source bits using the bitwise OR operator PATCOPY 0xF0 = 0xF0
Destination = pPatternCopies the pattern bits to the destination rectangle PATPAINT 0x0F | 0xAA
Destination = (~ Source) | pPattern | DestinationCombines the destination, pattern, and the inverse of source bits using the bitwise OR operator PATINVERT 0x5A = 0xF0 ^ 0xAA
Destination = pPattern ^ DestinationCombines the pattern and destination bits using the bitwise exclusive OR operator DSTINVERT 0x55 = ~0xAA
Destination = ~ DestinationCopies the inverse of the destination bits BLACKNESS 0x00
Set all destination bits to black WHITENESS 0xFF
Set all bits to white
- In this table Source was represented as 0xCC, Destination as 0xAA, and Pattern as 0xF0.
- nFlags
- [in] Combination of IXC_FilterFlags flags which specifies how the data will be processed.
Return Value
Returns S_OK if operation was successful or error code in other cases.
Remarks
Most raster operations combine all three pages - Destination, Source and Pattern, but some of them do not use Source or Pattern, or either of them. Also, sometimes Source or Pattern are "solid" pages filled by one color. So IMG_PageRop3 supports one extension - if Source or Pattern (or both) handles are NULL the corresponding color will be used for each pixel, instead of getting the pixel value from the page.