IIXC_Page::Rop3 Method

From PDF XChange PDF SDK
Jump to: navigation, search
m (Automatic page editing by robot)
 
(10 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
__NOTOC__
 
[[Category:Editor]]
 
[[Category:Editor]]
 
{{#customTitle:IIXC_Page::Rop3 Method}}
 
{{#customTitle:IIXC_Page::Rop3 Method}}
{{#parentPage:PXV:IIXC_Page|Rop3 Method|method}}
+
{{#parentPage:PXV:IIXC_Page#Methods|Rop3|method}}
{{ToWrite}}
+
{{ToReview}}
+
  
The method combines up to three images in different ways using the raster operations codes (ROP3).
+
The '''Rop3''' method combines up to three images in different ways using the raster operations codes (ROP3).
  
 
== Syntax ==
 
== Syntax ==
<pre class="brush:cpp;gutter:false">HRESULT Rop3([in]  RECT*      pRect,
+
<pre class="brush:cpp;gutter:false">HRESULT Rop3([in]  RECT*      stRect,
             [in]  IIXC_Page*  srcFrom,
+
             [in]  IIXC_Page*  pSrcFrom,
             [in]  LONG        srcX,
+
             [in]  LONG        nSrcX,
             [in]  LONG        srcY,
+
             [in]  LONG        nSrcY,
             [in]  ULONG      srcColor,
+
             [in]  ULONG      nSrcColor,
 
             [in]  IIXC_Page*  pPattern,
 
             [in]  IIXC_Page*  pPattern,
             [in]  LONG        patX,
+
             [in]  LONG        nPatX,
             [in]  LONG        patY,
+
             [in]  LONG        nPatY,
             [in]  ULONG      patColor,
+
             [in]  ULONG      nPatColor,
             [in]  UCHAR      ropCode,
+
             [in]  UCHAR      nRopCode,
 
             [in]  ULONG      nFlags);</pre>
 
             [in]  ULONG      nFlags);</pre>
  
 
== Parameters ==
 
== Parameters ==
;pRect
+
;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.
+
:[in]  Pointer to RECT specifies the rectangular area on the destination page which will be affected. If <tt>NULL</tt> then the entire page will be used.
;srcFrom
+
;pSrcFrom
:[in]  Specifies the [[PXV:IIXC_Page|IIXC_Page]] of the source page. This parameter can be NULL (see Comments for details).  
+
:[in]  Specifies the [[PXV:IIXC_Page|IIXC_Page]] of the source page. This parameter can be <tt>NULL</tt> (see Comments for details).  
;srcX
+
;nSrcX
 
:[in]  Specifies the x-coordinate of the left-top corner of the affected rectangle in the source page.
 
:[in]  Specifies the x-coordinate of the left-top corner of the affected rectangle in the source page.
;srcY
+
;nSrcY
 
:[in]  Specifies the y-coordinate of the left-top corner of the affected rectangle in the source page.
 
:[in]  Specifies the y-coordinate of the left-top corner of the affected rectangle in the source page.
;srcColor
+
;nSrcColor
:[in]  Specifies the color which should be used if pSource is NULL.
+
:[in]  Specifies the color which should be used if pSource is <tt>NULL</tt>.
 
;pPattern
 
;pPattern
:[in]  Specifies the [[PXV:IIXC_Page|IIXC_Page]] of the pattern page. This parameter can be NULL (see Comments for details).  
+
:[in]  Specifies the [[PXV:IIXC_Page|IIXC_Page]] of the pattern page. This parameter can be <tt>NULL</tt> (see Comments for details).  
;patX
+
;nPatX
 
:[in]  Specifies the x-coordinate of the left-top corner of the affected rectangle in pattern page.
 
:[in]  Specifies the x-coordinate of the left-top corner of the affected rectangle in pattern page.
;patY
+
;nPatY
 
:[in]  Specifies the y-coordinate of the left-top corner of the affected rectangle in pattern page.
 
:[in]  Specifies the y-coordinate of the left-top corner of the affected rectangle in pattern page.
;patColor
+
;nPatColor
:[in]  Specifies the color which should be used if pPattern is NULL.
+
:[in]  Specifies the color which should be used if pPattern is <tt>NULL</tt>.
;ropCode
+
;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.
+
:[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:
 +
::{| class="wikitable"
 +
! width="10%" align="left" | '''Constant'''
 +
! width="37%" align="left" | '''Value'''
 +
! width="53%" align="left" | '''Meaning'''
 +
|-
 +
| SRCCOPY
 +
| 0xCC = 0xCC<br />''Destination'' = ''Source''
 +
| Copies source bits to the destination rectangle
 +
|-
 +
| SRCPAINT
 +
| 0xEE = 0xCC | 0xAA<br />''Destination'' = ''Source'' | ''Destination''
 +
| Combines the source and destination bits using the bitwise OR operator
 +
|-
 +
| SRCAND
 +
| 0x88 = 0xCC &amp; 0xAA<br />''Destination'' = ''Source'' &amp; ''Destination''
 +
| Combines the source and destination bits using the bitwise AND operator
 +
|-
 +
| SRCINVERT
 +
| 0x66 = 0xCC ^ 0xAA<br />''Destination'' = ''Source'' ^ ''Destination''
 +
| Combines the source and destination bits using the bitwise exclusive OR operator
 +
|-
 +
| SRCERASE
 +
| 0x44 = 0xCC &amp; (~0xAA)<br />''Destination'' = ''Source'' &amp; (~ ''Destination'')
 +
| Combines the source and inverse of destination bits using the bitwise AND operator
 +
|-
 +
| NOTSRCCOPY
 +
| 0x33 = ~0xAA<br />''Destination'' = ~ ''Destination''
 +
| Copies the inverse of the destination bits to the destination rectangle
 +
|-
 +
| NOTSRCERASE
 +
| 0x11 = (~0xCC) &amp; (~0xAA)<br />''Destination'' = (~ ''Source'') &amp; (~ ''Destination'')
 +
| Combines the inverse of the source and destination bits using the bitwise AND operator
 +
|-
 +
| MERGECOPY
 +
| 0xC0 = 0xCC &amp; 0xF0<br />''Destination'' = ''Source'' &amp; ''pPattern''
 +
| Combines the source and pattern bits using the bitwise AND operator
 +
|-
 +
| MERGEPAINT
 +
| 0xBB = (~0xCC) | 0xAA<br />''Destination'' = (~ ''Source'') | ''Destination''
 +
| Combines the destination and inverse of the source bits using the bitwise OR operator
 +
|-
 +
| PATCOPY
 +
| 0xF0 = 0xF0<br />''Destination'' = ''pPattern''
 +
| Copies the pattern bits to the destination rectangle
 +
|-
 +
| PATPAINT
 +
| 0xFB = (~0xCC) | 0x0F | 0xAA<br />''Destination'' = (~ ''Source'') | ''pPattern'' | ''Destination''
 +
| Combines the destination, pattern, and the inverse of source bits using the bitwise OR operator
 +
|-
 +
| PATINVERT
 +
| 0x5A = 0xF0 ^ 0xAA<br />''Destination'' = ''pPattern'' ^ ''Destination''
 +
| Combines the pattern and destination bits using the bitwise exclusive OR operator
 +
|-
 +
| DSTINVERT
 +
| 0x55 = ~0xAA<br />''Destination'' = ~ ''Destination''
 +
| Copies the inverse of the destination bits
 +
|-
 +
| BLACKNESS
 +
| 0x00<br />
 +
| Set all destination bits to black
 +
|-
 +
| WHITENESS
 +
| 0xFF<br />
 +
| Set all bits to white
 +
|}
 +
:In this table Source was represented as 0xCC, Destination as 0xAA, and Pattern as 0xF0.  
 
;nFlags
 
;nFlags
:[in]  Combination of [[PXV:IXC_FilterFlags|flags]] which specifies how the data will be processed.
+
:[in]  Combination of [[PXV:IXC_FilterFlags|IXC_FilterFlags flags]] which specifies how the data will be processed.
  
 
== Return Value ==
 
== Return Value ==
 
Returns S_OK if operation was successful or error code in other cases.
 
Returns S_OK if operation was successful or error code in other cases.
  
== Comments ==
+
== 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 <tt>NULL</tt> the corresponding color will be used for each pixel, instead of getting the pixel value from the page.
{{note|In the current implementation this page should have one of following internal formats: PageFormat_8Gray, PageFormat_8AlphaGray, PageFormat_8RGB, PageFormat_8ARGB.}}
+
 
+
 
+
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.
+
 
+
  
 
== See Also ==
 
== See Also ==
See also [[PXV:IIXC_Page|IIXC_Page]].
+
[[PXV:IIXC_Page|IIXC_Page]]

Latest revision as of 03:16, 15 June 2015

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 = Source
Copies source bits to the destination rectangle
SRCPAINT 0xAA
Destination = Source | Destination
Combines the source and destination bits using the bitwise OR operator
SRCAND 0x88 = 0xCC & 0xAA
Destination = Source & Destination
Combines the source and destination bits using the bitwise AND operator
SRCINVERT 0x66 = 0xCC ^ 0xAA
Destination = Source ^ Destination
Combines 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 = ~ Destination
Copies 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 & pPattern
Combines the source and pattern bits using the bitwise AND operator
MERGEPAINT 0xAA
Destination = (~ Source) | Destination
Combines the destination and inverse of the source bits using the bitwise OR operator
PATCOPY 0xF0 = 0xF0
Destination = pPattern
Copies the pattern bits to the destination rectangle
PATPAINT 0x0F | 0xAA
Destination = (~ Source) | pPattern | Destination
Combines the destination, pattern, and the inverse of source bits using the bitwise OR operator
PATINVERT 0x5A = 0xF0 ^ 0xAA
Destination = pPattern ^ Destination
Combines the pattern and destination bits using the bitwise exclusive OR operator
DSTINVERT 0x55 = ~0xAA
Destination = ~ Destination
Copies 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.

See Also

IIXC_Page