4 #define __USES_PATTERN 0
7 #define _DibFunction __DIB_FUNCTION_NAME(__FUNCTIONNAME, _SOURCE_BPP, _DEST_BPP)
8 #define _ReadPixel(bpp, pj, jShift) __PASTE(_ReadPixel_, bpp)(pj, jShift)
9 #define _WritePixel(pj, jShift, c) __PASTE(_WritePixel_, _DEST_BPP)(pj, jShift, c)
10 #define _NextPixel(bpp, ppj, pjShift) __PASTE(_NextPixel_, bpp)(ppj, pjShift)
11 #define _SHIFT(bpp, x) __PASTE(_SHIFT_, bpp)(x)
12 #define _CALCSHIFT(bpp, pshift, x) __PASTE(_CALCSHIFT_, bpp)(pshift, x)
14 #if (__PASTE(_DibFunction, _manual) != 1)
18 _DibFunction(PBLTDATA pBltData
)
20 ULONG cRows
, cLines
, ulDest
;
21 PBYTE pjDest
, pjDestBase
;
22 _SHIFT(_DEST_BPP
, BYTE jDstShift
;)
24 PBYTE pjMask
, pjMaskBase
;
25 BYTE jMaskBit
, jMskShift
;
28 PBYTE pjSource
, pjSrcBase
;
30 _SHIFT(_SOURCE_BPP
, BYTE jSrcShift
;)
33 PBYTE pjPattern
, pjPatBase
;
34 ULONG ulPattern
, cPatRows
, cPatLines
;
35 _SHIFT(_DEST_BPP
, BYTE jPatShift
;)
37 #if __USES_SOLID_BRUSH
38 ULONG ulPattern
= pBltData
->ulSolidColor
;
42 pjMaskBase
= pBltData
->siMsk
.pjBase
;
45 pjPatBase
= pBltData
->siPat
.pjBase
;
46 pjPatBase
+= pBltData
->siPat
.ptOrig
.y
* pBltData
->siPat
.lDelta
;
47 cPatLines
= pBltData
->ulPatHeight
- pBltData
->siPat
.ptOrig
.y
;
49 pjDestBase
= pBltData
->siDst
.pjBase
;
51 pjSrcBase
= pBltData
->siSrc
.pjBase
;
55 cLines
= pBltData
->ulHeight
;
58 /* Set current bit pointers and shifts */
60 _CALCSHIFT(_DEST_BPP
, &jDstShift
, pBltData
->siDst
.ptOrig
.x
);
63 _CALCSHIFT(_SOURCE_BPP
, &jSrcShift
, pBltData
->siSrc
.ptOrig
.x
);
67 _CALCSHIFT_1(&jMskShift
, pBltData
->siMsk
.ptOrig
.x
);
70 pjPattern
= pjPatBase
+ pBltData
->siPat
.ptOrig
.x
* _DEST_BPP
/ 8;
71 _CALCSHIFT(_DEST_BPP
, &jPatShift
, pBltData
->siPat
.ptOrig
.x
);
72 cPatRows
= pBltData
->ulPatWidth
- pBltData
->siPat
.ptOrig
.x
;
76 cRows
= pBltData
->ulWidth
;
80 /* Read the mask color and go to the next mask pixel */
81 jMaskBit
= _ReadPixel_1(pjMask
, jMskShift
);
82 _NextPixel(1, &pjMask
, &jMskShift
);
85 /* Read the pattern color and go to the next pattern pixel */
86 ulPattern
= _ReadPixel(_DEST_BPP
, pjPattern
, jPatShift
);
87 _NextPixel(_DEST_BPP
, &pjPattern
, &jPatShift
);
89 /* Check if this was the last pixel in the pattern */
92 /* Restart pattern from x = 0 */
93 pjPattern
= pjPatBase
;
94 _SHIFT(_DEST_BPP
, jPatShift
= (_DEST_BPP
== 1) ? 7 : 4;)
95 cPatRows
= pBltData
->ulPatWidth
;
99 /* Read the pattern color, xlate it and go to the next pixel */
100 ulSource
= _ReadPixel(_SOURCE_BPP
, pjSource
, jSrcShift
);
101 ulSource
= _DibXlate(pBltData
, ulSource
);
102 _NextPixel(_SOURCE_BPP
, &pjSource
, &jSrcShift
);
105 ulDest
= _ReadPixel(_DEST_BPP
, pjDest
, jDstShift
);
107 /* Apply the ROP operation on the colors */
108 ulDest
= _DibDoRop(pBltData
, jMaskBit
, ulDest
, ulSource
, ulPattern
);
110 /* Write the pixel and go to the next dest pixel */
111 _WritePixel(pjDest
, jDstShift
, ulDest
);
112 _NextPixel(_DEST_BPP
, &pjDest
, &jDstShift
);
115 pjDestBase
+= pBltData
->siDst
.cjAdvanceY
;
117 pjSrcBase
+= pBltData
->siSrc
.cjAdvanceY
;
120 /* Go to the next pattern line */
121 pjPatBase
+= pBltData
->siPat
.cjAdvanceY
;
123 /* Check if this was the last line in the pattern */
124 if (--cPatLines
== 0)
126 /* Restart pattern from y = 0 */
127 pjPatBase
= pBltData
->siPat
.pjBase
;
128 cPatLines
= pBltData
->ulPatHeight
;
137 #undef __FUNCTIONNAME2