2
* FreeRDP: A Remote Desktop Protocol Implementation
3
* GDI 16bpp Internal Buffer Routines
5
* Copyright 2010-2011 Marc-Andre Moreau <marcandre.moreau@gmail.com>
7
* Licensed under the Apache License, Version 2.0 (the "License");
8
* you may not use this file except in compliance with the License.
9
* You may obtain a copy of the License at
11
* http://www.apache.org/licenses/LICENSE-2.0
13
* Unless required by applicable law or agreed to in writing, software
14
* distributed under the License is distributed on an "AS IS" BASIS,
15
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
* See the License for the specific language governing permissions and
17
* limitations under the License.
28
#include <freerdp/api.h>
29
#include <freerdp/freerdp.h>
30
#include <freerdp/gdi/gdi.h>
31
#include <freerdp/codec/color.h>
33
#include <freerdp/gdi/pen.h>
34
#include <freerdp/gdi/bitmap.h>
35
#include <freerdp/gdi/region.h>
36
#include <freerdp/gdi/clipping.h>
37
#include <freerdp/gdi/drawing.h>
39
#include <freerdp/gdi/16bpp.h>
41
UINT16 gdi_get_color_16bpp(HGDI_DC hdc, GDI_COLOR color)
46
GetBGR32(r, g, b, color);
52
color16 = BGR15(r, g, b);
56
color16 = RGB15(r, g, b);
63
color16 = BGR16(r, g, b);
67
color16 = RGB16(r, g, b);
74
int FillRect_16bpp(HGDI_DC hdc, HGDI_RECT rect, HGDI_BRUSH hbr)
83
gdi_RectToCRgn(rect, &nXDest, &nYDest, &nWidth, &nHeight);
85
if (gdi_ClipCoords(hdc, &nXDest, &nYDest, &nWidth, &nHeight, NULL, NULL) == 0)
88
color16 = gdi_get_color_16bpp(hdc, hbr->color);
90
for (y = 0; y < nHeight; y++)
92
dstp = (UINT16*) gdi_get_bitmap_pointer(hdc, nXDest, nYDest + y);
96
for (x = 0; x < nWidth; x++)
104
gdi_InvalidateRegion(hdc, nXDest, nYDest, nWidth, nHeight);
108
static int BitBlt_BLACKNESS_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
113
for (y = 0; y < nHeight; y++)
115
dstp = gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
118
memset(dstp, 0, nWidth * hdcDest->bytesPerPixel);
124
static int BitBlt_WHITENESS_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
129
for (y = 0; y < nHeight; y++)
131
dstp = gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
134
memset(dstp, 0xFF, nWidth * hdcDest->bytesPerPixel);
140
static int BitBlt_SRCCOPY_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
146
if ((hdcDest->selectedObject != hdcSrc->selectedObject) ||
147
gdi_CopyOverlap(nXDest, nYDest, nWidth, nHeight, nXSrc, nYSrc) == 0)
149
for (y = 0; y < nHeight; y++)
151
srcp = gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
152
dstp = gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
154
if (srcp != 0 && dstp != 0)
155
memcpy(dstp, srcp, nWidth * hdcDest->bytesPerPixel);
163
/* copy down (bottom to top) */
164
for (y = nHeight - 1; y >= 0; y--)
166
srcp = gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
167
dstp = gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
169
if (srcp != 0 && dstp != 0)
170
memmove(dstp, srcp, nWidth * hdcDest->bytesPerPixel);
173
else if (nYSrc > nYDest || nXSrc > nXDest)
175
/* copy up or left (top top bottom) */
176
for (y = 0; y < nHeight; y++)
178
srcp = gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
179
dstp = gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
181
if (srcp != 0 && dstp != 0)
182
memmove(dstp, srcp, nWidth * hdcDest->bytesPerPixel);
187
/* copy straight right */
188
for (y = 0; y < nHeight; y++)
190
srcp = gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
191
dstp = gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
193
if (srcp != 0 && dstp != 0)
194
memmove(dstp, srcp, nWidth * hdcDest->bytesPerPixel);
201
static int BitBlt_NOTSRCCOPY_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
207
for (y = 0; y < nHeight; y++)
209
srcp = (UINT16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
210
dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
214
for (x = 0; x < nWidth; x++)
226
static int BitBlt_DSTINVERT_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
231
for (y = 0; y < nHeight; y++)
233
dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
237
for (x = 0; x < nWidth; x++)
248
static int BitBlt_SRCERASE_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
254
for (y = 0; y < nHeight; y++)
256
srcp = (UINT16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
257
dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
261
for (x = 0; x < nWidth; x++)
263
*dstp = *srcp & ~(*dstp);
273
static int BitBlt_NOTSRCERASE_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
279
for (y = 0; y < nHeight; y++)
281
srcp = (UINT16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
282
dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
286
for (x = 0; x < nWidth; x++)
288
*dstp = ~(*srcp) & ~(*dstp);
298
static int BitBlt_SRCINVERT_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
304
for (y = 0; y < nHeight; y++)
306
srcp = (UINT16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
307
dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
311
for (x = 0; x < nWidth; x++)
323
static int BitBlt_SRCAND_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
329
for (y = 0; y < nHeight; y++)
331
srcp = (UINT16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
332
dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
336
for (x = 0; x < nWidth; x++)
348
static int BitBlt_SRCPAINT_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
354
for (y = 0; y < nHeight; y++)
356
srcp = (UINT16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
357
dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
361
for (x = 0; x < nWidth; x++)
373
static int BitBlt_DSPDxax_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
382
/* D = (S & P) | (~S & D) */
383
/* DSPDxax, used to draw glyphs */
385
color16 = gdi_get_color_16bpp(hdcDest, hdcDest->textColor);
387
hSrcBmp = (HGDI_BITMAP) hdcSrc->selectedObject;
389
if (hdcSrc->bytesPerPixel != 1)
391
fprintf(stderr, "BitBlt_DSPDxax expects 1 bpp, unimplemented for %d\n", hdcSrc->bytesPerPixel);
395
for (y = 0; y < nHeight; y++)
397
srcp = (BYTE*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
398
dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
402
for (x = 0; x < nWidth; x++)
404
src16 = (*srcp << 8) | *srcp;
405
*dstp = (src16 & color16) | (~src16 & *dstp);
415
static int BitBlt_PSDPxax_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
423
/* D = (S & D) | (~S & P) */
425
if (hdcDest->brush->style == GDI_BS_SOLID)
427
color16 = gdi_get_color_16bpp(hdcDest, hdcDest->brush->color);
428
patp = (UINT16*) &color16;
430
for (y = 0; y < nHeight; y++)
432
srcp = (UINT16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
433
dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
437
for (x = 0; x < nWidth; x++)
439
*dstp = (*srcp & *dstp) | (~(*srcp) & *patp);
448
for (y = 0; y < nHeight; y++)
450
srcp = (UINT16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
451
dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
455
for (x = 0; x < nWidth; x++)
457
patp = (UINT16*) gdi_get_brush_pointer(hdcDest, x, y);
458
*dstp = (*srcp & *dstp) | (~(*srcp) & *patp);
469
static int BitBlt_SPna_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
476
for (y = 0; y < nHeight; y++)
478
srcp = (UINT16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
479
dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
483
for (x = 0; x < nWidth; x++)
485
patp = (UINT16*) gdi_get_brush_pointer(hdcDest, x, y);
486
*dstp = *srcp & ~(*patp);
496
static int BitBlt_DPa_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
502
for (y = 0; y < nHeight; y++)
504
dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
508
for (x = 0; x < nWidth; x++)
510
patp = (UINT16*) gdi_get_brush_pointer(hdcDest, x, y);
512
*dstp = *dstp & *patp;
521
static int BitBlt_PDxn_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
527
for (y = 0; y < nHeight; y++)
529
dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
533
for (x = 0; x < nWidth; x++)
535
patp = (UINT16*) gdi_get_brush_pointer(hdcDest, x, y);
536
*dstp = *dstp ^ ~(*patp);
545
static int BitBlt_DSna_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
551
for (y = 0; y < nHeight; y++)
553
srcp = (UINT16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
554
dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
558
for (x = 0; x < nWidth; x++)
560
*dstp = ~(*srcp) & (*dstp);
571
static int BitBlt_MERGECOPY_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
578
for (y = 0; y < nHeight; y++)
580
srcp = (UINT16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
581
dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
585
for (x = 0; x < nWidth; x++)
587
patp = (UINT16*) gdi_get_brush_pointer(hdcDest, x, y);
588
*dstp = *srcp & *patp;
598
static int BitBlt_MERGEPAINT_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
604
for (y = 0; y < nHeight; y++)
606
srcp = (UINT16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
607
dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
611
for (x = 0; x < nWidth; x++)
613
*dstp = ~(*srcp) | *dstp;
623
static int BitBlt_PATCOPY_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
625
int x, y, xOffset, yOffset;
630
if (hdcDest->brush->style == GDI_BS_SOLID)
632
color16 = gdi_get_color_16bpp(hdcDest, hdcDest->brush->color);
634
for (y = 0; y < nHeight; y++)
636
dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
640
for (x = 0; x < nWidth; x++)
650
/* align pattern to 8x8 grid to make sure transition
651
between different pattern blocks are smooth */
653
if (hdcDest->brush->style == GDI_BS_HATCHED)
655
xOffset = nXDest % 8;
656
yOffset = nYDest % 8 + 2; // +2 added after comparison to mstsc
663
for (y = 0; y < nHeight; y++)
665
dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
669
for (x = 0; x < nWidth; x++)
671
patp = (UINT16*) gdi_get_brush_pointer(hdcDest, x+xOffset, y+yOffset);
682
static int BitBlt_PATINVERT_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
689
if (hdcDest->brush->style == GDI_BS_SOLID)
691
color16 = gdi_get_color_16bpp(hdcDest, hdcDest->brush->color);
693
for (y = 0; y < nHeight; y++)
695
dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
699
for (x = 0; x < nWidth; x++)
709
for (y = 0; y < nHeight; y++)
711
dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
715
for (x = 0; x < nWidth; x++)
717
patp = (UINT16*) gdi_get_brush_pointer(hdcDest, x, y);
718
*dstp = *patp ^ *dstp;
728
static int BitBlt_PATPAINT_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
735
for (y = 0; y < nHeight; y++)
737
srcp = (UINT16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
738
dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
742
for (x = 0; x < nWidth; x++)
744
patp = (UINT16*) gdi_get_brush_pointer(hdcDest, x, y);
745
*dstp = *dstp | (*patp | ~(*srcp));
755
int BitBlt_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc, int rop)
759
if (gdi_ClipCoords(hdcDest, &nXDest, &nYDest, &nWidth, &nHeight, &nXSrc, &nYSrc) == 0)
764
if (gdi_ClipCoords(hdcDest, &nXDest, &nYDest, &nWidth, &nHeight, NULL, NULL) == 0)
768
gdi_InvalidateRegion(hdcDest, nXDest, nYDest, nWidth, nHeight);
773
return BitBlt_BLACKNESS_16bpp(hdcDest, nXDest, nYDest, nWidth, nHeight);
777
return BitBlt_WHITENESS_16bpp(hdcDest, nXDest, nYDest, nWidth, nHeight);
781
return BitBlt_SRCCOPY_16bpp(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc);
785
return BitBlt_SPna_16bpp(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc);
789
return BitBlt_DSna_16bpp(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc);
793
return BitBlt_DSPDxax_16bpp(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc);
797
return BitBlt_PSDPxax_16bpp(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc);
801
return BitBlt_NOTSRCCOPY_16bpp(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc);
805
return BitBlt_DSTINVERT_16bpp(hdcDest, nXDest, nYDest, nWidth, nHeight);
809
return BitBlt_SRCERASE_16bpp(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc);
812
case GDI_NOTSRCERASE:
813
return BitBlt_NOTSRCERASE_16bpp(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc);
817
return BitBlt_SRCINVERT_16bpp(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc);
821
return BitBlt_SRCAND_16bpp(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc);
825
return BitBlt_SRCPAINT_16bpp(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc);
829
return BitBlt_MERGECOPY_16bpp(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc);
833
return BitBlt_MERGEPAINT_16bpp(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc);
837
return BitBlt_PATCOPY_16bpp(hdcDest, nXDest, nYDest, nWidth, nHeight);
841
return BitBlt_PATINVERT_16bpp(hdcDest, nXDest, nYDest, nWidth, nHeight);
845
return BitBlt_PATPAINT_16bpp(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc);
849
fprintf(stderr, "BitBlt: unknown rop: 0x%08X\n", rop);
853
int PatBlt_16bpp(HGDI_DC hdc, int nXLeft, int nYLeft, int nWidth, int nHeight, int rop)
855
if (gdi_ClipCoords(hdc, &nXLeft, &nYLeft, &nWidth, &nHeight, NULL, NULL) == 0)
858
gdi_InvalidateRegion(hdc, nXLeft, nYLeft, nWidth, nHeight);
863
return BitBlt_PATCOPY_16bpp(hdc, nXLeft, nYLeft, nWidth, nHeight);
867
return BitBlt_PATINVERT_16bpp(hdc, nXLeft, nYLeft, nWidth, nHeight);
871
return BitBlt_DSTINVERT_16bpp(hdc, nXLeft, nYLeft, nWidth, nHeight);
875
return BitBlt_BLACKNESS_16bpp(hdc, nXLeft, nYLeft, nWidth, nHeight);
879
return BitBlt_WHITENESS_16bpp(hdc, nXLeft, nYLeft, nWidth, nHeight);
883
return BitBlt_DPa_16bpp(hdc, nXLeft, nYLeft, nWidth, nHeight);
887
return BitBlt_PDxn_16bpp(hdc, nXLeft, nYLeft, nWidth, nHeight);
894
fprintf(stderr, "PatBlt: unknown rop: 0x%08X\n", rop);
898
static INLINE void SetPixel_BLACK_16bpp(UINT16 *pixel, UINT16 *pen)
904
static INLINE void SetPixel_NOTMERGEPEN_16bpp(UINT16 *pixel, UINT16 *pen)
907
*pixel = ~(*pixel | *pen);
910
static INLINE void SetPixel_MASKNOTPEN_16bpp(UINT16 *pixel, UINT16 *pen)
916
static INLINE void SetPixel_NOTCOPYPEN_16bpp(UINT16 *pixel, UINT16 *pen)
922
static INLINE void SetPixel_MASKPENNOT_16bpp(UINT16 *pixel, UINT16 *pen)
925
*pixel = *pen & ~*pixel;
928
static INLINE void SetPixel_NOT_16bpp(UINT16 *pixel, UINT16 *pen)
934
static INLINE void SetPixel_XORPEN_16bpp(UINT16 *pixel, UINT16 *pen)
937
*pixel = *pixel ^ *pen;
940
static INLINE void SetPixel_NOTMASKPEN_16bpp(UINT16 *pixel, UINT16 *pen)
943
*pixel = ~(*pixel & *pen);
946
static INLINE void SetPixel_MASKPEN_16bpp(UINT16 *pixel, UINT16 *pen)
952
static INLINE void SetPixel_NOTXORPEN_16bpp(UINT16 *pixel, UINT16 *pen)
955
*pixel = ~(*pixel ^ *pen);
958
static INLINE void SetPixel_NOP_16bpp(UINT16 *pixel, UINT16 *pen)
963
static INLINE void SetPixel_MERGENOTPEN_16bpp(UINT16 *pixel, UINT16 *pen)
969
static INLINE void SetPixel_COPYPEN_16bpp(UINT16 *pixel, UINT16 *pen)
975
static INLINE void SetPixel_MERGEPENNOT_16bpp(UINT16 *pixel, UINT16 *pen)
978
*pixel = *pen | ~(*pixel);
981
static INLINE void SetPixel_MERGEPEN_16bpp(UINT16 *pixel, UINT16 *pen)
987
static INLINE void SetPixel_WHITE_16bpp(UINT16 *pixel, UINT16 *pen)
993
#define PIXEL_TYPE UINT16
994
#define GDI_GET_POINTER gdi_GetPointer_16bpp
995
#define GDI_GET_PEN_COLOR gdi_GetPenColor_16bpp
997
#define LINE_TO LineTo_BLACK_16bpp
998
#define SET_PIXEL_ROP2 SetPixel_BLACK_16bpp
999
#include "include/line.c"
1001
#undef SET_PIXEL_ROP2
1003
#define LINE_TO LineTo_NOTMERGEPEN_16bpp
1004
#define SET_PIXEL_ROP2 SetPixel_NOTMERGEPEN_16bpp
1005
#include "include/line.c"
1007
#undef SET_PIXEL_ROP2
1009
#define LINE_TO LineTo_MASKNOTPEN_16bpp
1010
#define SET_PIXEL_ROP2 SetPixel_MASKNOTPEN_16bpp
1011
#include "include/line.c"
1013
#undef SET_PIXEL_ROP2
1015
#define LINE_TO LineTo_NOTCOPYPEN_16bpp
1016
#define SET_PIXEL_ROP2 SetPixel_NOTCOPYPEN_16bpp
1017
#include "include/line.c"
1019
#undef SET_PIXEL_ROP2
1021
#define LINE_TO LineTo_MASKPENNOT_16bpp
1022
#define SET_PIXEL_ROP2 SetPixel_MASKPENNOT_16bpp
1023
#include "include/line.c"
1025
#undef SET_PIXEL_ROP2
1027
#define LINE_TO LineTo_NOT_16bpp
1028
#define SET_PIXEL_ROP2 SetPixel_NOT_16bpp
1029
#include "include/line.c"
1031
#undef SET_PIXEL_ROP2
1033
#define LINE_TO LineTo_XORPEN_16bpp
1034
#define SET_PIXEL_ROP2 SetPixel_XORPEN_16bpp
1035
#include "include/line.c"
1037
#undef SET_PIXEL_ROP2
1039
#define LINE_TO LineTo_NOTMASKPEN_16bpp
1040
#define SET_PIXEL_ROP2 SetPixel_NOTMASKPEN_16bpp
1041
#include "include/line.c"
1043
#undef SET_PIXEL_ROP2
1045
#define LINE_TO LineTo_MASKPEN_16bpp
1046
#define SET_PIXEL_ROP2 SetPixel_MASKPEN_16bpp
1047
#include "include/line.c"
1049
#undef SET_PIXEL_ROP2
1051
#define LINE_TO LineTo_NOTXORPEN_16bpp
1052
#define SET_PIXEL_ROP2 SetPixel_NOTXORPEN_16bpp
1053
#include "include/line.c"
1055
#undef SET_PIXEL_ROP2
1057
#define LINE_TO LineTo_NOP_16bpp
1058
#define SET_PIXEL_ROP2 SetPixel_NOP_16bpp
1059
#include "include/line.c"
1061
#undef SET_PIXEL_ROP2
1063
#define LINE_TO LineTo_MERGENOTPEN_16bpp
1064
#define SET_PIXEL_ROP2 SetPixel_MERGENOTPEN_16bpp
1065
#include "include/line.c"
1067
#undef SET_PIXEL_ROP2
1069
#define LINE_TO LineTo_COPYPEN_16bpp
1070
#define SET_PIXEL_ROP2 SetPixel_COPYPEN_16bpp
1071
#include "include/line.c"
1073
#undef SET_PIXEL_ROP2
1075
#define LINE_TO LineTo_MERGEPENNOT_16bpp
1076
#define SET_PIXEL_ROP2 SetPixel_MERGEPENNOT_16bpp
1077
#include "include/line.c"
1079
#undef SET_PIXEL_ROP2
1081
#define LINE_TO LineTo_MERGEPEN_16bpp
1082
#define SET_PIXEL_ROP2 SetPixel_MERGEPEN_16bpp
1083
#include "include/line.c"
1085
#undef SET_PIXEL_ROP2
1087
#define LINE_TO LineTo_WHITE_16bpp
1088
#define SET_PIXEL_ROP2 SetPixel_WHITE_16bpp
1089
#include "include/line.c"
1091
#undef SET_PIXEL_ROP2
1094
#undef GDI_GET_POINTER
1095
#undef GDI_GET_PEN_COLOR
1097
pLineTo_16bpp LineTo_ROP2_16bpp[32] =
1100
LineTo_NOTMERGEPEN_16bpp,
1101
LineTo_MASKNOTPEN_16bpp,
1102
LineTo_NOTCOPYPEN_16bpp,
1103
LineTo_MASKPENNOT_16bpp,
1105
LineTo_XORPEN_16bpp,
1106
LineTo_NOTMASKPEN_16bpp,
1107
LineTo_MASKPEN_16bpp,
1108
LineTo_NOTXORPEN_16bpp,
1110
LineTo_MERGENOTPEN_16bpp,
1111
LineTo_COPYPEN_16bpp,
1112
LineTo_MERGEPENNOT_16bpp,
1113
LineTo_MERGEPEN_16bpp,
1117
int LineTo_16bpp(HGDI_DC hdc, int nXEnd, int nYEnd)
1119
pLineTo_16bpp _LineTo;
1120
int rop2 = gdi_GetROP2(hdc) - 1;
1122
_LineTo = LineTo_ROP2_16bpp[rop2];
1124
if (_LineTo != NULL)
1125
return _LineTo(hdc, nXEnd, nYEnd);