xref: /reactos/win32ss/gdi/eng/inteng.h (revision c2c66aff)
1*c2c66affSColin Finck #pragma once
2*c2c66affSColin Finck 
3*c2c66affSColin Finck typedef ULONG HCLIP;
4*c2c66affSColin Finck 
5*c2c66affSColin Finck #define ENUM_RECT_LIMIT 32
6*c2c66affSColin Finck 
7*c2c66affSColin Finck typedef struct _RECT_ENUM
8*c2c66affSColin Finck {
9*c2c66affSColin Finck   ULONG c;
10*c2c66affSColin Finck   RECTL arcl[ENUM_RECT_LIMIT];
11*c2c66affSColin Finck } RECT_ENUM;
12*c2c66affSColin Finck 
13*c2c66affSColin Finck typedef struct tagSPAN
14*c2c66affSColin Finck {
15*c2c66affSColin Finck   LONG Y;
16*c2c66affSColin Finck   LONG X;
17*c2c66affSColin Finck   ULONG Width;
18*c2c66affSColin Finck } SPAN, *PSPAN;
19*c2c66affSColin Finck 
20*c2c66affSColin Finck enum _R3_ROPCODES
21*c2c66affSColin Finck {
22*c2c66affSColin Finck     R3_OPINDEX_NOOP         = 0xAA,
23*c2c66affSColin Finck     R3_OPINDEX_BLACKNESS    = 0x00,
24*c2c66affSColin Finck     R3_OPINDEX_NOTSRCERASE  = 0x11,
25*c2c66affSColin Finck     R3_OPINDEX_NOTSRCCOPY   = 0x33,
26*c2c66affSColin Finck     R3_OPINDEX_SRCERASE     = 0x44,
27*c2c66affSColin Finck     R3_OPINDEX_DSTINVERT    = 0x55,
28*c2c66affSColin Finck     R3_OPINDEX_PATINVERT    = 0x5A,
29*c2c66affSColin Finck     R3_OPINDEX_SRCINVERT    = 0x66,
30*c2c66affSColin Finck     R3_OPINDEX_SRCAND       = 0x88,
31*c2c66affSColin Finck     R3_OPINDEX_MERGEPAINT   = 0xBB,
32*c2c66affSColin Finck     R3_OPINDEX_MERGECOPY    = 0xC0,
33*c2c66affSColin Finck     R3_OPINDEX_SRCCOPY      = 0xCC,
34*c2c66affSColin Finck     R3_OPINDEX_SRCPAINT     = 0xEE,
35*c2c66affSColin Finck     R3_OPINDEX_PATCOPY      = 0xF0,
36*c2c66affSColin Finck     R3_OPINDEX_PATPAINT     = 0xFB,
37*c2c66affSColin Finck     R3_OPINDEX_WHITENESS    = 0xFF
38*c2c66affSColin Finck };
39*c2c66affSColin Finck 
40*c2c66affSColin Finck #define ROP2_TO_MIX(Rop2) (((Rop2) << 8) | (Rop2))
41*c2c66affSColin Finck 
42*c2c66affSColin Finck #define ROP4_FROM_INDEX(index) ((index) | ((index) << 8))
43*c2c66affSColin Finck 
44*c2c66affSColin Finck #define ROP4_USES_DEST(Rop4)    ((((Rop4) & 0xAAAA) >> 1) != ((Rop4) & 0x5555))
45*c2c66affSColin Finck #define ROP4_USES_SOURCE(Rop4)  ((((Rop4) & 0xCCCC) >> 2) != ((Rop4) & 0x3333))
46*c2c66affSColin Finck #define ROP4_USES_PATTERN(Rop4) ((((Rop4) & 0xF0F0) >> 4) != ((Rop4) & 0x0F0F))
47*c2c66affSColin Finck #define ROP4_USES_MASK(Rop4)    ((((Rop4) & 0xFF00) >> 8) != ((Rop4) & 0x00ff))
48*c2c66affSColin Finck 
49*c2c66affSColin Finck #define IS_VALID_ROP4(rop) (((rop) & 0xFFFF0000) == 0)
50*c2c66affSColin Finck 
51*c2c66affSColin Finck #define ROP4_FGND(Rop4)    ((Rop4) & 0x00FF)
52*c2c66affSColin Finck #define ROP4_BKGND(Rop4)    (((Rop4) & 0xFF00) >> 8)
53*c2c66affSColin Finck 
54*c2c66affSColin Finck #define ROP4_NOOP (R3_OPINDEX_NOOP | (R3_OPINDEX_NOOP << 8))
55*c2c66affSColin Finck #define ROP4_MASK (R3_OPINDEX_SRCCOPY | (R3_OPINDEX_NOOP << 8))
56*c2c66affSColin Finck #define ROP4_MASKPAINT (R3_OPINDEX_PATCOPY | (R3_OPINDEX_NOOP << 8))
57*c2c66affSColin Finck 
58*c2c66affSColin Finck /* Definitions of IntEngXxx functions */
59*c2c66affSColin Finck 
60*c2c66affSColin Finck BOOL APIENTRY
61*c2c66affSColin Finck IntEngLineTo(SURFOBJ *Surface,
62*c2c66affSColin Finck              CLIPOBJ *Clip,
63*c2c66affSColin Finck              BRUSHOBJ *Brush,
64*c2c66affSColin Finck              LONG x1,
65*c2c66affSColin Finck              LONG y1,
66*c2c66affSColin Finck              LONG x2,
67*c2c66affSColin Finck              LONG y2,
68*c2c66affSColin Finck              RECTL *RectBounds,
69*c2c66affSColin Finck              MIX mix);
70*c2c66affSColin Finck 
71*c2c66affSColin Finck BOOL APIENTRY
72*c2c66affSColin Finck IntEngBitBlt(SURFOBJ *DestObj,
73*c2c66affSColin Finck                SURFOBJ *SourceObj,
74*c2c66affSColin Finck                SURFOBJ *Mask,
75*c2c66affSColin Finck                CLIPOBJ *ClipRegion,
76*c2c66affSColin Finck                XLATEOBJ *ColorTranslation,
77*c2c66affSColin Finck                RECTL *DestRect,
78*c2c66affSColin Finck                POINTL *SourcePoint,
79*c2c66affSColin Finck                POINTL *MaskOrigin,
80*c2c66affSColin Finck                BRUSHOBJ *Brush,
81*c2c66affSColin Finck                POINTL *BrushOrigin,
82*c2c66affSColin Finck                ROP4 Rop4);
83*c2c66affSColin Finck 
84*c2c66affSColin Finck BOOL APIENTRY
85*c2c66affSColin Finck IntEngStretchBlt(SURFOBJ *DestObj,
86*c2c66affSColin Finck                  SURFOBJ *SourceObj,
87*c2c66affSColin Finck                  SURFOBJ *Mask,
88*c2c66affSColin Finck                  CLIPOBJ *ClipRegion,
89*c2c66affSColin Finck                  XLATEOBJ *ColorTranslation,
90*c2c66affSColin Finck                  COLORADJUSTMENT *pca,
91*c2c66affSColin Finck                  RECTL *DestRect,
92*c2c66affSColin Finck                  RECTL *SourceRect,
93*c2c66affSColin Finck                  POINTL *pMaskOrigin,
94*c2c66affSColin Finck                  BRUSHOBJ *Brush,
95*c2c66affSColin Finck                  POINTL *BrushOrigin,
96*c2c66affSColin Finck                  ULONG Mode);
97*c2c66affSColin Finck 
98*c2c66affSColin Finck BOOL APIENTRY
99*c2c66affSColin Finck IntEngGradientFill(SURFOBJ *psoDest,
100*c2c66affSColin Finck                    CLIPOBJ *pco,
101*c2c66affSColin Finck                    XLATEOBJ *pxlo,
102*c2c66affSColin Finck                    TRIVERTEX *pVertex,
103*c2c66affSColin Finck                    ULONG nVertex,
104*c2c66affSColin Finck                    PVOID pMesh,
105*c2c66affSColin Finck                    ULONG nMesh,
106*c2c66affSColin Finck                    RECTL *prclExtents,
107*c2c66affSColin Finck                    POINTL *pptlDitherOrg,
108*c2c66affSColin Finck                    ULONG ulMode);
109*c2c66affSColin Finck 
110*c2c66affSColin Finck BOOL APIENTRY
111*c2c66affSColin Finck IntEngPolyline(SURFOBJ *DestSurf,
112*c2c66affSColin Finck                CLIPOBJ *Clip,
113*c2c66affSColin Finck                BRUSHOBJ *Brush,
114*c2c66affSColin Finck                CONST LPPOINT  pt,
115*c2c66affSColin Finck                LONG dCount,
116*c2c66affSColin Finck                MIX mix);
117*c2c66affSColin Finck 
118*c2c66affSColin Finck VOID FASTCALL
119*c2c66affSColin Finck IntEngUpdateClipRegion(XCLIPOBJ* Clip,
120*c2c66affSColin Finck                        ULONG count,
121*c2c66affSColin Finck                        const RECTL* pRect,
122*c2c66affSColin Finck                        const RECTL* rcBounds);
123*c2c66affSColin Finck 
124*c2c66affSColin Finck VOID FASTCALL
125*c2c66affSColin Finck IntEngInitClipObj(XCLIPOBJ *Clip);
126*c2c66affSColin Finck 
127*c2c66affSColin Finck VOID FASTCALL
128*c2c66affSColin Finck IntEngFreeClipResources(XCLIPOBJ *Clip);
129*c2c66affSColin Finck 
130*c2c66affSColin Finck 
131*c2c66affSColin Finck BOOL FASTCALL
132*c2c66affSColin Finck IntEngTransparentBlt(SURFOBJ *Dest,
133*c2c66affSColin Finck                      SURFOBJ *Source,
134*c2c66affSColin Finck                      CLIPOBJ *Clip,
135*c2c66affSColin Finck                      XLATEOBJ *ColorTranslation,
136*c2c66affSColin Finck                      PRECTL DestRect,
137*c2c66affSColin Finck                      PRECTL SourceRect,
138*c2c66affSColin Finck                      ULONG iTransColor,
139*c2c66affSColin Finck                      ULONG Reserved);
140*c2c66affSColin Finck 
141*c2c66affSColin Finck BOOL
142*c2c66affSColin Finck APIENTRY
143*c2c66affSColin Finck IntEngPaint(
144*c2c66affSColin Finck     _In_ SURFOBJ *pso,
145*c2c66affSColin Finck     _In_ CLIPOBJ *pco,
146*c2c66affSColin Finck     _In_ BRUSHOBJ *pbo,
147*c2c66affSColin Finck     _In_ POINTL *pptlBrushOrg,
148*c2c66affSColin Finck     _In_ __in_data_source(USER_MODE) MIX mix);
149*c2c66affSColin Finck 
150*c2c66affSColin Finck BOOL
151*c2c66affSColin Finck APIENTRY
152*c2c66affSColin Finck IntEngAlphaBlend(
153*c2c66affSColin Finck     _Inout_ SURFOBJ *psoDest,
154*c2c66affSColin Finck     _In_ SURFOBJ *psoSource,
155*c2c66affSColin Finck     _In_opt_ CLIPOBJ *pco,
156*c2c66affSColin Finck     _In_opt_ XLATEOBJ *pxlo,
157*c2c66affSColin Finck     _In_ RECTL *prclDest,
158*c2c66affSColin Finck     _In_ RECTL *prclSrc,
159*c2c66affSColin Finck     _In_ BLENDOBJ *pBlendObj);
160*c2c66affSColin Finck 
161*c2c66affSColin Finck BOOL APIENTRY
162*c2c66affSColin Finck IntEngCopyBits(SURFOBJ *psoDest,
163*c2c66affSColin Finck 	    SURFOBJ *psoSource,
164*c2c66affSColin Finck 	    CLIPOBJ *pco,
165*c2c66affSColin Finck 	    XLATEOBJ *pxlo,
166*c2c66affSColin Finck 	    RECTL *prclDest,
167*c2c66affSColin Finck 	    POINTL *ptlSource);
168