2 * FreeRDP: A Remote Desktop Protocol Client
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.
23 #include <freerdp/api.h>
24 #include <freerdp/freerdp.h>
25 #include <freerdp/gdi/gdi.h>
26 #include <freerdp/codec/color.h>
28 #include <freerdp/gdi/pen.h>
29 #include <freerdp/gdi/bitmap.h>
30 #include <freerdp/gdi/region.h>
31 #include <freerdp/gdi/clipping.h>
32 #include <freerdp/gdi/drawing.h>
34 #include <freerdp/gdi/16bpp.h>
36 uint16 gdi_get_color_16bpp(HGDI_DC hdc, GDI_COLOR color)
41 GetBGR32(r, g, b, color);
47 color16 = BGR15(r, g, b);
51 color16 = RGB15(r, g, b);
58 color16 = BGR16(r, g, b);
62 color16 = RGB16(r, g, b);
69 int FillRect_16bpp(HGDI_DC hdc, HGDI_RECT rect, HGDI_BRUSH hbr)
78 gdi_RectToCRgn(rect, &nXDest, &nYDest, &nWidth, &nHeight);
80 if (gdi_ClipCoords(hdc, &nXDest, &nYDest, &nWidth, &nHeight, NULL, NULL) == 0)
83 color16 = gdi_get_color_16bpp(hdc, hbr->color);
85 for (y = 0; y < nHeight; y++)
87 dstp = (uint16*) gdi_get_bitmap_pointer(hdc, nXDest, nYDest + y);
91 for (x = 0; x < nWidth; x++)
99 gdi_InvalidateRegion(hdc, nXDest, nYDest, nWidth, nHeight);
103 static int BitBlt_BLACKNESS_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
108 for (y = 0; y < nHeight; y++)
110 dstp = gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
113 memset(dstp, 0, nWidth * hdcDest->bytesPerPixel);
119 static int BitBlt_WHITENESS_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
124 for (y = 0; y < nHeight; y++)
126 dstp = gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
129 memset(dstp, 0xFF, nWidth * hdcDest->bytesPerPixel);
135 static int BitBlt_SRCCOPY_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
141 if ((hdcDest->selectedObject != hdcSrc->selectedObject) ||
142 gdi_CopyOverlap(nXDest, nYDest, nWidth, nHeight, nXSrc, nYSrc) == 0)
144 for (y = 0; y < nHeight; y++)
146 srcp = gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
147 dstp = gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
149 if (srcp != 0 && dstp != 0)
150 memcpy(dstp, srcp, nWidth * hdcDest->bytesPerPixel);
158 /* copy down (bottom to top) */
159 for (y = nHeight - 1; y >= 0; y--)
161 srcp = gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
162 dstp = gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
164 if (srcp != 0 && dstp != 0)
165 memmove(dstp, srcp, nWidth * hdcDest->bytesPerPixel);
168 else if (nYSrc > nYDest || nXSrc > nXDest)
170 /* copy up or left (top top bottom) */
171 for (y = 0; y < nHeight; y++)
173 srcp = gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
174 dstp = gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
176 if (srcp != 0 && dstp != 0)
177 memmove(dstp, srcp, nWidth * hdcDest->bytesPerPixel);
182 /* copy straight right */
183 for (y = 0; y < nHeight; y++)
185 srcp = gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
186 dstp = gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
188 if (srcp != 0 && dstp != 0)
189 memmove(dstp, srcp, nWidth * hdcDest->bytesPerPixel);
196 static int BitBlt_NOTSRCCOPY_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
202 for (y = 0; y < nHeight; y++)
204 srcp = (uint16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
205 dstp = (uint16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
209 for (x = 0; x < nWidth; x++)
221 static int BitBlt_DSTINVERT_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
226 for (y = 0; y < nHeight; y++)
228 dstp = (uint16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
232 for (x = 0; x < nWidth; x++)
243 static int BitBlt_SRCERASE_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
249 for (y = 0; y < nHeight; y++)
251 srcp = (uint16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
252 dstp = (uint16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
256 for (x = 0; x < nWidth; x++)
258 *dstp = *srcp & ~(*dstp);
268 static int BitBlt_NOTSRCERASE_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
274 for (y = 0; y < nHeight; y++)
276 srcp = (uint16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
277 dstp = (uint16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
281 for (x = 0; x < nWidth; x++)
283 *dstp = ~(*srcp) & ~(*dstp);
293 static int BitBlt_SRCINVERT_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
299 for (y = 0; y < nHeight; y++)
301 srcp = (uint16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
302 dstp = (uint16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
306 for (x = 0; x < nWidth; x++)
318 static int BitBlt_SRCAND_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
324 for (y = 0; y < nHeight; y++)
326 srcp = (uint16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
327 dstp = (uint16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
331 for (x = 0; x < nWidth; x++)
343 static int BitBlt_SRCPAINT_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
349 for (y = 0; y < nHeight; y++)
351 srcp = (uint16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
352 dstp = (uint16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
356 for (x = 0; x < nWidth; x++)
368 static int BitBlt_DSPDxax_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
377 /* D = (S & P) | (~S & D) */
378 /* DSPDxax, used to draw glyphs */
380 color16 = gdi_get_color_16bpp(hdcDest, hdcDest->textColor);
382 hSrcBmp = (HGDI_BITMAP) hdcSrc->selectedObject;
384 if (hdcSrc->bytesPerPixel != 1)
386 printf("BitBlt_DSPDxax expects 1 bpp, unimplemented for %d\n", hdcSrc->bytesPerPixel);
390 for (y = 0; y < nHeight; y++)
392 srcp = (uint8*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
393 dstp = (uint16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
397 for (x = 0; x < nWidth; x++)
399 src16 = (*srcp << 8) | *srcp;
400 *dstp = (src16 & color16) | (~src16 & *dstp);
410 static int BitBlt_SPna_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
417 for (y = 0; y < nHeight; y++)
419 srcp = (uint16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
420 dstp = (uint16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
424 for (x = 0; x < nWidth; x++)
426 patp = (uint16*) gdi_get_brush_pointer(hdcDest, x, y);
427 *dstp = *srcp & ~(*patp);
437 static int BitBlt_PDxn_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
443 for (y = 0; y < nHeight; y++)
445 dstp = (uint16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
449 for (x = 0; x < nWidth; x++)
451 patp = (uint16*) gdi_get_brush_pointer(hdcDest, x, y);
452 *dstp = *dstp ^ ~(*patp);
461 static int BitBlt_DSna_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
467 for (y = 0; y < nHeight; y++)
469 srcp = (uint16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
470 dstp = (uint16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
474 for (x = 0; x < nWidth; x++)
476 *dstp = ~(*srcp) & (*dstp);
487 static int BitBlt_MERGECOPY_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
494 for (y = 0; y < nHeight; y++)
496 srcp = (uint16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
497 dstp = (uint16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
501 for (x = 0; x < nWidth; x++)
503 patp = (uint16*) gdi_get_brush_pointer(hdcDest, x, y);
504 *dstp = *srcp & *patp;
514 static int BitBlt_MERGEPAINT_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
520 for (y = 0; y < nHeight; y++)
522 srcp = (uint16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
523 dstp = (uint16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
527 for (x = 0; x < nWidth; x++)
529 *dstp = ~(*srcp) | *dstp;
539 static int BitBlt_PATCOPY_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
546 if (hdcDest->brush->style == GDI_BS_SOLID)
548 color16 = gdi_get_color_16bpp(hdcDest, hdcDest->brush->color);
550 for (y = 0; y < nHeight; y++)
552 dstp = (uint16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
556 for (x = 0; x < nWidth; x++)
566 for (y = 0; y < nHeight; y++)
568 dstp = (uint16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
572 for (x = 0; x < nWidth; x++)
574 patp = (uint16*) gdi_get_brush_pointer(hdcDest, x, y);
585 static int BitBlt_PATINVERT_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
592 if (hdcDest->brush->style == GDI_BS_SOLID)
594 color16 = gdi_get_color_16bpp(hdcDest, hdcDest->brush->color);
596 for (y = 0; y < nHeight; y++)
598 dstp = (uint16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
602 for (x = 0; x < nWidth; x++)
612 for (y = 0; y < nHeight; y++)
614 dstp = (uint16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
618 for (x = 0; x < nWidth; x++)
620 patp = (uint16*) gdi_get_brush_pointer(hdcDest, x, y);
621 *dstp = *patp ^ *dstp;
631 static int BitBlt_PATPAINT_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
638 for (y = 0; y < nHeight; y++)
640 srcp = (uint16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
641 dstp = (uint16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
645 for (x = 0; x < nWidth; x++)
647 patp = (uint16*) gdi_get_brush_pointer(hdcDest, x, y);
648 *dstp = *dstp | (*patp | ~(*srcp));
658 int BitBlt_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc, int rop)
662 if (gdi_ClipCoords(hdcDest, &nXDest, &nYDest, &nWidth, &nHeight, &nXSrc, &nYSrc) == 0)
667 if (gdi_ClipCoords(hdcDest, &nXDest, &nYDest, &nWidth, &nHeight, NULL, NULL) == 0)
671 gdi_InvalidateRegion(hdcDest, nXDest, nYDest, nWidth, nHeight);
676 return BitBlt_BLACKNESS_16bpp(hdcDest, nXDest, nYDest, nWidth, nHeight);
680 return BitBlt_WHITENESS_16bpp(hdcDest, nXDest, nYDest, nWidth, nHeight);
684 return BitBlt_SRCCOPY_16bpp(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc);
688 return BitBlt_SPna_16bpp(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc);
692 return BitBlt_DSna_16bpp(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc);
696 return BitBlt_DSPDxax_16bpp(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc);
700 return BitBlt_NOTSRCCOPY_16bpp(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc);
704 return BitBlt_DSTINVERT_16bpp(hdcDest, nXDest, nYDest, nWidth, nHeight);
708 return BitBlt_SRCERASE_16bpp(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc);
711 case GDI_NOTSRCERASE:
712 return BitBlt_NOTSRCERASE_16bpp(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc);
716 return BitBlt_SRCINVERT_16bpp(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc);
720 return BitBlt_SRCAND_16bpp(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc);
724 return BitBlt_SRCPAINT_16bpp(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc);
728 return BitBlt_MERGECOPY_16bpp(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc);
732 return BitBlt_MERGEPAINT_16bpp(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc);
736 return BitBlt_PATCOPY_16bpp(hdcDest, nXDest, nYDest, nWidth, nHeight);
740 return BitBlt_PATINVERT_16bpp(hdcDest, nXDest, nYDest, nWidth, nHeight);
744 return BitBlt_PATPAINT_16bpp(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc);
748 printf("BitBlt: unknown rop: 0x%08X\n", rop);
752 int PatBlt_16bpp(HGDI_DC hdc, int nXLeft, int nYLeft, int nWidth, int nHeight, int rop)
754 if (gdi_ClipCoords(hdc, &nXLeft, &nYLeft, &nWidth, &nHeight, NULL, NULL) == 0)
757 gdi_InvalidateRegion(hdc, nXLeft, nYLeft, nWidth, nHeight);
762 return BitBlt_PATCOPY_16bpp(hdc, nXLeft, nYLeft, nWidth, nHeight);
766 return BitBlt_PATINVERT_16bpp(hdc, nXLeft, nYLeft, nWidth, nHeight);
770 return BitBlt_DSTINVERT_16bpp(hdc, nXLeft, nYLeft, nWidth, nHeight);
774 return BitBlt_BLACKNESS_16bpp(hdc, nXLeft, nYLeft, nWidth, nHeight);
778 return BitBlt_WHITENESS_16bpp(hdc, nXLeft, nYLeft, nWidth, nHeight);
782 return BitBlt_PDxn_16bpp(hdc, nXLeft, nYLeft, nWidth, nHeight);
789 printf("PatBlt: unknown rop: 0x%08X\n", rop);
794 INLINE void SetPixel_BLACK_16bpp(uint16 *pixel, uint16 *pen)
800 INLINE void SetPixel_NOTMERGEPEN_16bpp(uint16 *pixel, uint16 *pen)
803 *pixel = ~(*pixel | *pen);
806 INLINE void SetPixel_MASKNOTPEN_16bpp(uint16 *pixel, uint16 *pen)
812 INLINE void SetPixel_NOTCOPYPEN_16bpp(uint16 *pixel, uint16 *pen)
818 INLINE void SetPixel_MASKPENNOT_16bpp(uint16 *pixel, uint16 *pen)
821 *pixel = *pen & ~*pixel;
824 INLINE void SetPixel_NOT_16bpp(uint16 *pixel, uint16 *pen)
830 INLINE void SetPixel_XORPEN_16bpp(uint16 *pixel, uint16 *pen)
833 *pixel = *pixel ^ *pen;
836 INLINE void SetPixel_NOTMASKPEN_16bpp(uint16 *pixel, uint16 *pen)
839 *pixel = ~(*pixel & *pen);
842 INLINE void SetPixel_MASKPEN_16bpp(uint16 *pixel, uint16 *pen)
848 INLINE void SetPixel_NOTXORPEN_16bpp(uint16 *pixel, uint16 *pen)
851 *pixel = ~(*pixel ^ *pen);
854 INLINE void SetPixel_NOP_16bpp(uint16 *pixel, uint16 *pen)
859 INLINE void SetPixel_MERGENOTPEN_16bpp(uint16 *pixel, uint16 *pen)
865 INLINE void SetPixel_COPYPEN_16bpp(uint16 *pixel, uint16 *pen)
871 INLINE void SetPixel_MERGEPENNOT_16bpp(uint16 *pixel, uint16 *pen)
874 *pixel = *pen | ~(*pixel);
877 INLINE void SetPixel_MERGEPEN_16bpp(uint16 *pixel, uint16 *pen)
883 INLINE void SetPixel_WHITE_16bpp(uint16 *pixel, uint16 *pen)
889 #define PIXEL_TYPE uint16
890 #define GDI_GET_POINTER gdi_GetPointer_16bpp
891 #define GDI_GET_PEN_COLOR gdi_GetPenColor_16bpp
893 #define LINE_TO LineTo_BLACK_16bpp
894 #define SET_PIXEL_ROP2 SetPixel_BLACK_16bpp
895 #include "include/line.c"
897 #undef SET_PIXEL_ROP2
899 #define LINE_TO LineTo_NOTMERGEPEN_16bpp
900 #define SET_PIXEL_ROP2 SetPixel_NOTMERGEPEN_16bpp
901 #include "include/line.c"
903 #undef SET_PIXEL_ROP2
905 #define LINE_TO LineTo_MASKNOTPEN_16bpp
906 #define SET_PIXEL_ROP2 SetPixel_MASKNOTPEN_16bpp
907 #include "include/line.c"
909 #undef SET_PIXEL_ROP2
911 #define LINE_TO LineTo_NOTCOPYPEN_16bpp
912 #define SET_PIXEL_ROP2 SetPixel_NOTCOPYPEN_16bpp
913 #include "include/line.c"
915 #undef SET_PIXEL_ROP2
917 #define LINE_TO LineTo_MASKPENNOT_16bpp
918 #define SET_PIXEL_ROP2 SetPixel_MASKPENNOT_16bpp
919 #include "include/line.c"
921 #undef SET_PIXEL_ROP2
923 #define LINE_TO LineTo_NOT_16bpp
924 #define SET_PIXEL_ROP2 SetPixel_NOT_16bpp
925 #include "include/line.c"
927 #undef SET_PIXEL_ROP2
929 #define LINE_TO LineTo_XORPEN_16bpp
930 #define SET_PIXEL_ROP2 SetPixel_XORPEN_16bpp
931 #include "include/line.c"
933 #undef SET_PIXEL_ROP2
935 #define LINE_TO LineTo_NOTMASKPEN_16bpp
936 #define SET_PIXEL_ROP2 SetPixel_NOTMASKPEN_16bpp
937 #include "include/line.c"
939 #undef SET_PIXEL_ROP2
941 #define LINE_TO LineTo_MASKPEN_16bpp
942 #define SET_PIXEL_ROP2 SetPixel_MASKPEN_16bpp
943 #include "include/line.c"
945 #undef SET_PIXEL_ROP2
947 #define LINE_TO LineTo_NOTXORPEN_16bpp
948 #define SET_PIXEL_ROP2 SetPixel_NOTXORPEN_16bpp
949 #include "include/line.c"
951 #undef SET_PIXEL_ROP2
953 #define LINE_TO LineTo_NOP_16bpp
954 #define SET_PIXEL_ROP2 SetPixel_NOP_16bpp
955 #include "include/line.c"
957 #undef SET_PIXEL_ROP2
959 #define LINE_TO LineTo_MERGENOTPEN_16bpp
960 #define SET_PIXEL_ROP2 SetPixel_MERGENOTPEN_16bpp
961 #include "include/line.c"
963 #undef SET_PIXEL_ROP2
965 #define LINE_TO LineTo_COPYPEN_16bpp
966 #define SET_PIXEL_ROP2 SetPixel_COPYPEN_16bpp
967 #include "include/line.c"
969 #undef SET_PIXEL_ROP2
971 #define LINE_TO LineTo_MERGEPENNOT_16bpp
972 #define SET_PIXEL_ROP2 SetPixel_MERGEPENNOT_16bpp
973 #include "include/line.c"
975 #undef SET_PIXEL_ROP2
977 #define LINE_TO LineTo_MERGEPEN_16bpp
978 #define SET_PIXEL_ROP2 SetPixel_MERGEPEN_16bpp
979 #include "include/line.c"
981 #undef SET_PIXEL_ROP2
983 #define LINE_TO LineTo_WHITE_16bpp
984 #define SET_PIXEL_ROP2 SetPixel_WHITE_16bpp
985 #include "include/line.c"
987 #undef SET_PIXEL_ROP2
990 #undef GDI_GET_POINTER
991 #undef GDI_GET_PEN_COLOR
993 pLineTo_16bpp LineTo_ROP2_16bpp[32] =
996 LineTo_NOTMERGEPEN_16bpp,
997 LineTo_MASKNOTPEN_16bpp,
998 LineTo_NOTCOPYPEN_16bpp,
999 LineTo_MASKPENNOT_16bpp,
1001 LineTo_XORPEN_16bpp,
1002 LineTo_NOTMASKPEN_16bpp,
1003 LineTo_MASKPEN_16bpp,
1004 LineTo_NOTXORPEN_16bpp,
1006 LineTo_MERGENOTPEN_16bpp,
1007 LineTo_COPYPEN_16bpp,
1008 LineTo_MERGEPENNOT_16bpp,
1009 LineTo_MERGEPEN_16bpp,
1013 int LineTo_16bpp(HGDI_DC hdc, int nXEnd, int nYEnd)
1015 pLineTo_16bpp _LineTo;
1016 int rop2 = gdi_GetROP2(hdc) - 1;
1018 _LineTo = LineTo_ROP2_16bpp[rop2];
1020 if (_LineTo != NULL)
1021 return _LineTo(hdc, nXEnd, nYEnd);