1 #undef WIN32_LEAN_AND_MEAN
4 #include <win32k/bitmaps.h>
5 #include <win32k/debug.h>
7 #include <ddk/winddi.h>
8 #include "../eng/objects.h"
11 VOID
DIB_1BPP_PutPixel(PSURFOBJ SurfObj
, LONG x
, LONG y
, ULONG c
)
13 PBYTE addr
= SurfObj
->pvBits
;
15 addr
+= y
* SurfObj
->lDelta
+ (x
>> 3);
19 *addr
= (*addr
^ mask1Bpp
[x
% 8]);
23 *addr
= (*addr
| mask1Bpp
[x
% 8]);
27 ULONG
DIB_1BPP_GetPixel(PSURFOBJ SurfObj
, LONG x
, LONG y
)
29 PBYTE addr
= SurfObj
->pvBits
+ y
* SurfObj
->lDelta
+ (x
>> 3);
31 return (*addr
& mask1Bpp
[x
% 8] ? 1 : 0);
34 VOID
DIB_1BPP_HLine(PSURFOBJ SurfObj
, LONG x1
, LONG x2
, LONG y
, ULONG c
)
37 DIB_1BPP_PutPixel(SurfObj
, x1
, y
, c
);
42 VOID
DIB_1BPP_VLine(PSURFOBJ SurfObj
, LONG x
, LONG y1
, LONG y2
, ULONG c
)
45 DIB_1BPP_PutPixel(SurfObj
, x
, y1
, c
);
50 BOOLEAN
DIB_To_1BPP_Bitblt( SURFOBJ
*DestSurf
, SURFOBJ
*SourceSurf
,
51 SURFGDI
*DestGDI
, SURFGDI
*SourceGDI
,
52 PRECTL DestRect
, POINTL
*SourcePoint
,
53 LONG Delta
, XLATEOBJ
*ColorTranslation
)
55 LONG i
, j
, sx
, sy
= SourcePoint
->y
;
57 switch(SourceGDI
->BitsPerPixel
)
60 for (j
=DestRect
->top
; j
<DestRect
->bottom
; j
++)
63 for (i
=DestRect
->left
; i
<DestRect
->right
; i
++)
65 if(DIB_1BPP_GetPixel(SourceSurf
, sx
, sy
) == 0)
67 DIB_1BPP_PutPixel(DestSurf
, i
, j
, 0);
69 DIB_1BPP_PutPixel(DestSurf
, i
, j
, 1);
78 for (j
=DestRect
->top
; j
<DestRect
->bottom
; j
++)
81 for (i
=DestRect
->left
; i
<DestRect
->right
; i
++)
83 if(XLATEOBJ_iXlate(ColorTranslation
, DIB_4BPP_GetPixel(SourceSurf
, sx
, sy
)) == 0)
85 DIB_1BPP_PutPixel(DestSurf
, i
, j
, 0);
87 DIB_1BPP_PutPixel(DestSurf
, i
, j
, 1);
96 for (j
=DestRect
->top
; j
<DestRect
->bottom
; j
++)
99 for (i
=DestRect
->left
; i
<DestRect
->right
; i
++)
101 if(XLATEOBJ_iXlate(ColorTranslation
, DIB_24BPP_GetPixel(SourceSurf
, sx
, sy
)) == 0)
103 DIB_1BPP_PutPixel(DestSurf
, i
, j
, 0);
105 DIB_1BPP_PutPixel(DestSurf
, i
, j
, 1);
114 DbgPrint("DIB_1BPP_Bitblt: Unhandled Source BPP: %u\n", SourceGDI
->BitsPerPixel
);