2 * DIB Engine Primitives function pointers
4 * Copyright 2009 Massimo Del Fedele
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 #include "wine/port.h"
26 WINE_DEFAULT_DEBUG_CHANNEL(dibdrv
);
28 /* ------------------------------------------------------------*/
30 DWORD
_DIBDRV_ColorToPixel32_RGB (const DIBDRVBITMAP
*dib
, COLORREF color
);
31 DWORD
_DIBDRV_ColorToPixel32_BITFIELDS(const DIBDRVBITMAP
*dib
, COLORREF color
);
32 DWORD
_DIBDRV_ColorToPixel24 (const DIBDRVBITMAP
*dib
, COLORREF color
);
33 DWORD
_DIBDRV_ColorToPixel16_RGB (const DIBDRVBITMAP
*dib
, COLORREF color
);
34 DWORD
_DIBDRV_ColorToPixel16_BITFIELDS(const DIBDRVBITMAP
*dib
, COLORREF color
);
35 DWORD
_DIBDRV_ColorToPixelColortable (const DIBDRVBITMAP
*dib
, COLORREF color
);
37 /* ------------------------------------------------------------*/
38 /* PIXEL POINTER READING */
39 void *_DIBDRV_GetPixelPointer32(const DIBDRVBITMAP
*dib
, int x
, int y
);
40 void *_DIBDRV_GetPixelPointer24(const DIBDRVBITMAP
*dib
, int x
, int y
);
41 void *_DIBDRV_GetPixelPointer16(const DIBDRVBITMAP
*dib
, int x
, int y
);
42 void *_DIBDRV_GetPixelPointer8 (const DIBDRVBITMAP
*dib
, int x
, int y
);
43 void *_DIBDRV_GetPixelPointer4 (const DIBDRVBITMAP
*dib
, int x
, int y
);
44 void *_DIBDRV_GetPixelPointer1 (const DIBDRVBITMAP
*dib
, int x
, int y
);
46 /* ------------------------------------------------------------*/
48 void _DIBDRV_SetPixel32(DIBDRVBITMAP
*dib
, int x
, int y
, DWORD
and, DWORD
xor);
49 void _DIBDRV_SetPixel24(DIBDRVBITMAP
*dib
, int x
, int y
, DWORD
and, DWORD
xor);
50 void _DIBDRV_SetPixel16(DIBDRVBITMAP
*dib
, int x
, int y
, DWORD
and, DWORD
xor);
51 void _DIBDRV_SetPixel8 (DIBDRVBITMAP
*dib
, int x
, int y
, DWORD
and, DWORD
xor);
52 void _DIBDRV_SetPixel4 (DIBDRVBITMAP
*dib
, int x
, int y
, DWORD
and, DWORD
xor);
53 void _DIBDRV_SetPixel1 (DIBDRVBITMAP
*dib
, int x
, int y
, DWORD
and, DWORD
xor);
55 /* ------------------------------------------------------------*/
57 DWORD
_DIBDRV_GetPixel32_RGB (const DIBDRVBITMAP
*dib
, int x
, int y
);
58 DWORD
_DIBDRV_GetPixel32_BITFIELDS(const DIBDRVBITMAP
*dib
, int x
, int y
);
59 DWORD
_DIBDRV_GetPixel24 (const DIBDRVBITMAP
*dib
, int x
, int y
);
60 DWORD
_DIBDRV_GetPixel16_RGB (const DIBDRVBITMAP
*dib
, int x
, int y
);
61 DWORD
_DIBDRV_GetPixel16_BITFIELDS(const DIBDRVBITMAP
*dib
, int x
, int y
);
62 DWORD
_DIBDRV_GetPixel8 (const DIBDRVBITMAP
*dib
, int x
, int y
);
63 DWORD
_DIBDRV_GetPixel4 (const DIBDRVBITMAP
*dib
, int x
, int y
);
64 DWORD
_DIBDRV_GetPixel1 (const DIBDRVBITMAP
*dib
, int x
, int y
);
66 /* ------------------------------------------------------------*/
67 /* HORIZONTAL SOLID LINES */
68 void _DIBDRV_SolidHLine32(DIBDRVBITMAP
*dib
, int start
, int end
, int row
, DWORD
and, DWORD
xor);
69 void _DIBDRV_SolidHLine24(DIBDRVBITMAP
*dib
, int start
, int end
, int row
, DWORD
and, DWORD
xor);
70 void _DIBDRV_SolidHLine16(DIBDRVBITMAP
*dib
, int start
, int end
, int row
, DWORD
and, DWORD
xor);
71 void _DIBDRV_SolidHLine8 (DIBDRVBITMAP
*dib
, int start
, int end
, int row
, DWORD
and, DWORD
xor);
72 void _DIBDRV_SolidHLine4 (DIBDRVBITMAP
*dib
, int start
, int end
, int row
, DWORD
and, DWORD
xor);
73 void _DIBDRV_SolidHLine1 (DIBDRVBITMAP
*dib
, int start
, int end
, int row
, DWORD
and, DWORD
xor);
75 /* ------------------------------------------------------------*/
76 /* HORIZONTAL PATTERN LINES */
77 void _DIBDRV_PatternHLine32(DIBDRVBITMAP
*dib
, int start
, int end
, int row
, const void *and, const void *xor, DWORD count
, DWORD offset
);
78 void _DIBDRV_PatternHLine24(DIBDRVBITMAP
*dib
, int start
, int end
, int row
, const void *and, const void *xor, DWORD count
, DWORD offset
);
79 void _DIBDRV_PatternHLine16(DIBDRVBITMAP
*dib
, int start
, int end
, int row
, const void *and, const void *xor, DWORD count
, DWORD offset
);
80 void _DIBDRV_PatternHLine8 (DIBDRVBITMAP
*dib
, int start
, int end
, int row
, const void *and, const void *xor, DWORD count
, DWORD offset
);
81 void _DIBDRV_PatternHLine4 (DIBDRVBITMAP
*dib
, int start
, int end
, int row
, const void *and, const void *xor, DWORD count
, DWORD offset
);
82 void _DIBDRV_PatternHLine1 (DIBDRVBITMAP
*dib
, int start
, int end
, int row
, const void *and, const void *xor, DWORD count
, DWORD offset
);
84 /* ------------------------------------------------------------*/
86 void _DIBDRV_SolidVLine32(DIBDRVBITMAP
*dib
, int col
, int start
, int end
, DWORD
and, DWORD
xor);
87 void _DIBDRV_SolidVLine24(DIBDRVBITMAP
*dib
, int col
, int start
, int end
, DWORD
and, DWORD
xor);
88 void _DIBDRV_SolidVLine16(DIBDRVBITMAP
*dib
, int col
, int start
, int end
, DWORD
and, DWORD
xor);
89 void _DIBDRV_SolidVLine8 (DIBDRVBITMAP
*dib
, int col
, int start
, int end
, DWORD
and, DWORD
xor);
90 void _DIBDRV_SolidVLine4 (DIBDRVBITMAP
*dib
, int col
, int start
, int end
, DWORD
and, DWORD
xor);
91 void _DIBDRV_SolidVLine1 (DIBDRVBITMAP
*dib
, int col
, int start
, int end
, DWORD
and, DWORD
xor);
93 /* ----------------------------------------------------------------*/
94 /* CONVERT PRIMITIVES */
95 /* converts (part of) line of any DIB format from/to DIB32_RGB one */
96 BOOL
_DIBDRV_GetLine32_RGB (const DIBDRVBITMAP
*bmp
, INT line
, INT startx
, int width
, void *buf
);
97 BOOL
_DIBDRV_GetLine32_BITFIELDS(const DIBDRVBITMAP
*bmp
, INT line
, INT startx
, int width
, void *buf
);
98 BOOL
_DIBDRV_GetLine24 (const DIBDRVBITMAP
*bmp
, INT line
, INT startx
, int width
, void *buf
);
99 BOOL
_DIBDRV_GetLine16_RGB (const DIBDRVBITMAP
*bmp
, INT line
, INT startx
, int width
, void *buf
);
100 BOOL
_DIBDRV_GetLine16_BITFIELDS(const DIBDRVBITMAP
*bmp
, INT line
, INT startx
, int width
, void *buf
);
101 BOOL
_DIBDRV_GetLine8 (const DIBDRVBITMAP
*bmp
, INT line
, INT startx
, int width
, void *buf
);
102 BOOL
_DIBDRV_GetLine4 (const DIBDRVBITMAP
*bmp
, INT line
, INT startx
, int width
, void *buf
);
103 BOOL
_DIBDRV_GetLine1 (const DIBDRVBITMAP
*bmp
, INT line
, INT startx
, int width
, void *buf
);
105 BOOL
_DIBDRV_PutLine32_RGB (DIBDRVBITMAP
*bmp
, INT line
, INT startx
, int width
, void *buf
);
106 BOOL
_DIBDRV_PutLine32_BITFIELDS(DIBDRVBITMAP
*bmp
, INT line
, INT startx
, int width
, void *buf
);
107 BOOL
_DIBDRV_PutLine24 (DIBDRVBITMAP
*bmp
, INT line
, INT startx
, int width
, void *buf
);
108 BOOL
_DIBDRV_PutLine16_RGB (DIBDRVBITMAP
*bmp
, INT line
, INT startx
, int width
, void *buf
);
109 BOOL
_DIBDRV_PutLine16_BITFIELDS(DIBDRVBITMAP
*bmp
, INT line
, INT startx
, int width
, void *buf
);
110 BOOL
_DIBDRV_PutLine8 (DIBDRVBITMAP
*bmp
, INT line
, INT startx
, int width
, void *buf
);
111 BOOL
_DIBDRV_PutLine4 (DIBDRVBITMAP
*bmp
, INT line
, INT startx
, int width
, void *buf
);
112 BOOL
_DIBDRV_PutLine1 (DIBDRVBITMAP
*bmp
, INT line
, INT startx
, int width
, void *buf
);
114 /* ------------------------------------------------------------*/
115 /* BLITTING PRIMITIVES */
116 BOOL
_DIBDRV_BitBlt_generic(DIBDRVPHYSDEV
*physDevDst
, INT xDst
, INT yDst
,
117 INT width
, INT height
, const DIBDRVPHYSDEV
*physDevSrc
,
118 INT xSrc
, INT ySrc
, DWORD rop
);
119 BOOL
_DIBDRV_BitBlt_32(DIBDRVPHYSDEV
*physDevDst
, INT xDst
, INT yDst
,
120 INT width
, INT height
, const DIBDRVPHYSDEV
*physDevSrc
,
121 INT xSrc
, INT ySrc
, DWORD rop
);
122 BOOL
_DIBDRV_BitBlt_24(DIBDRVPHYSDEV
*physDevDst
, INT xDst
, INT yDst
,
123 INT width
, INT height
, const DIBDRVPHYSDEV
*physDevSrc
,
124 INT xSrc
, INT ySrc
, DWORD rop
);
125 BOOL
_DIBDRV_BitBlt_16(DIBDRVPHYSDEV
*physDevDst
, INT xDst
, INT yDst
,
126 INT width
, INT height
, const DIBDRVPHYSDEV
*physDevSrc
,
127 INT xSrc
, INT ySrc
, DWORD rop
);
128 BOOL
_DIBDRV_BitBlt_8(DIBDRVPHYSDEV
*physDevDst
, INT xDst
, INT yDst
,
129 INT width
, INT height
, const DIBDRVPHYSDEV
*physDevSrc
,
130 INT xSrc
, INT ySrc
, DWORD rop
);
132 BOOL
_DIBDRV_StretchBlt_generic(DIBDRVPHYSDEV
*physDevDst
, INT xDst
, INT yDst
,
133 INT widthDst
, INT heightDst
, const DIBDRVPHYSDEV
*physDevSrc
,
134 INT xSrc
, INT ySrc
, int widthSrc
, int heightSrc
, DWORD rop
);
136 BOOL
_DIBDRV_AlphaBlend_generic(DIBDRVPHYSDEV
*physDevDst
, int xDst
, int yDst
,
137 int widthDst
, int heightDst
, const DIBDRVPHYSDEV
*physDevSrc
,
138 int xSrc
, int ySrc
, int widthSrc
, int heightSrc
, BLENDFUNCTION blendFn
);
140 /* ------------------------------------------------------------*/
141 /* FREETYPE FONT BITMAP BLITTING */
142 void _DIBDRV_freetype_blit_8888 (DIBDRVPHYSDEV
*dib
, int x
, int y
, RECT
*clipRec
, FT_Bitmap
*bmp
);
143 void _DIBDRV_freetype_blit_32_RGB (DIBDRVPHYSDEV
*dib
, int x
, int y
, RECT
*clipRec
, FT_Bitmap
*bmp
);
144 void _DIBDRV_freetype_blit_32_BITFIELDS(DIBDRVPHYSDEV
*dib
, int x
, int y
, RECT
*clipRec
, FT_Bitmap
*bmp
);
145 void _DIBDRV_freetype_blit_24 (DIBDRVPHYSDEV
*dib
, int x
, int y
, RECT
*clipRec
, FT_Bitmap
*bmp
);
146 void _DIBDRV_freetype_blit_16_RGB (DIBDRVPHYSDEV
*dib
, int x
, int y
, RECT
*clipRec
, FT_Bitmap
*bmp
);
147 void _DIBDRV_freetype_blit_16_BITFIELDS(DIBDRVPHYSDEV
*dib
, int x
, int y
, RECT
*clipRec
, FT_Bitmap
*bmp
);
148 void _DIBDRV_freetype_blit_8 (DIBDRVPHYSDEV
*dib
, int x
, int y
, RECT
*clipRec
, FT_Bitmap
*bmp
);
149 void _DIBDRV_freetype_blit_4 (DIBDRVPHYSDEV
*dib
, int x
, int y
, RECT
*clipRec
, FT_Bitmap
*bmp
);
150 void _DIBDRV_freetype_blit_1 (DIBDRVPHYSDEV
*dib
, int x
, int y
, RECT
*clipRec
, FT_Bitmap
*bmp
);
152 DIBDRV_PRIMITIVE_FUNCS DIBDRV_funcs_DIB32_RGB
=
154 _DIBDRV_ColorToPixel32_RGB
,
155 _DIBDRV_GetPixelPointer32
,
157 _DIBDRV_GetPixel32_RGB
,
158 _DIBDRV_SolidHLine32
,
159 _DIBDRV_PatternHLine32
,
160 _DIBDRV_SolidVLine32
,
161 _DIBDRV_GetLine32_RGB
,
162 _DIBDRV_PutLine32_RGB
,
163 _DIBDRV_AlphaBlend_generic
,
164 _DIBDRV_BitBlt_generic
,
165 _DIBDRV_StretchBlt_generic
,
166 _DIBDRV_freetype_blit_32_RGB
169 DIBDRV_PRIMITIVE_FUNCS DIBDRV_funcs_DIB32_BITFIELDS
=
171 _DIBDRV_ColorToPixel32_BITFIELDS
,
172 _DIBDRV_GetPixelPointer32
,
174 _DIBDRV_GetPixel32_BITFIELDS
,
175 _DIBDRV_SolidHLine32
,
176 _DIBDRV_PatternHLine32
,
177 _DIBDRV_SolidVLine32
,
178 _DIBDRV_GetLine32_BITFIELDS
,
179 _DIBDRV_PutLine32_BITFIELDS
,
180 _DIBDRV_AlphaBlend_generic
,
181 _DIBDRV_BitBlt_generic
,
182 _DIBDRV_StretchBlt_generic
,
183 _DIBDRV_freetype_blit_32_BITFIELDS
186 DIBDRV_PRIMITIVE_FUNCS DIBDRV_funcs_DIB24
=
188 _DIBDRV_ColorToPixel24
,
189 _DIBDRV_GetPixelPointer24
,
192 _DIBDRV_SolidHLine24
,
193 _DIBDRV_PatternHLine24
,
194 _DIBDRV_SolidVLine24
,
197 _DIBDRV_AlphaBlend_generic
,
198 _DIBDRV_BitBlt_generic
,
199 _DIBDRV_StretchBlt_generic
,
200 _DIBDRV_freetype_blit_24
203 DIBDRV_PRIMITIVE_FUNCS DIBDRV_funcs_DIB16_RGB
=
205 _DIBDRV_ColorToPixel16_RGB
,
206 _DIBDRV_GetPixelPointer16
,
208 _DIBDRV_GetPixel16_RGB
,
209 _DIBDRV_SolidHLine16
,
210 _DIBDRV_PatternHLine16
,
211 _DIBDRV_SolidVLine16
,
212 _DIBDRV_GetLine16_RGB
,
213 _DIBDRV_PutLine16_RGB
,
214 _DIBDRV_AlphaBlend_generic
,
215 _DIBDRV_BitBlt_generic
,
216 _DIBDRV_StretchBlt_generic
,
217 _DIBDRV_freetype_blit_16_RGB
220 DIBDRV_PRIMITIVE_FUNCS DIBDRV_funcs_DIB16_BITFIELDS
=
222 _DIBDRV_ColorToPixel16_BITFIELDS
,
223 _DIBDRV_GetPixelPointer16
,
225 _DIBDRV_GetPixel16_BITFIELDS
,
226 _DIBDRV_SolidHLine16
,
227 _DIBDRV_PatternHLine16
,
228 _DIBDRV_SolidVLine16
,
229 _DIBDRV_GetLine16_BITFIELDS
,
230 _DIBDRV_PutLine16_BITFIELDS
,
231 _DIBDRV_AlphaBlend_generic
,
232 _DIBDRV_BitBlt_generic
,
233 _DIBDRV_StretchBlt_generic
,
234 _DIBDRV_freetype_blit_16_BITFIELDS
237 DIBDRV_PRIMITIVE_FUNCS DIBDRV_funcs_DIB8
=
239 _DIBDRV_ColorToPixelColortable
,
240 _DIBDRV_GetPixelPointer8
,
244 _DIBDRV_PatternHLine8
,
248 _DIBDRV_AlphaBlend_generic
,
249 _DIBDRV_BitBlt_generic
,
250 _DIBDRV_StretchBlt_generic
,
251 _DIBDRV_freetype_blit_8
254 DIBDRV_PRIMITIVE_FUNCS DIBDRV_funcs_DIB4
=
256 _DIBDRV_ColorToPixelColortable
,
257 _DIBDRV_GetPixelPointer4
,
261 _DIBDRV_PatternHLine4
,
265 _DIBDRV_AlphaBlend_generic
,
266 _DIBDRV_BitBlt_generic
,
267 _DIBDRV_StretchBlt_generic
,
268 _DIBDRV_freetype_blit_4
271 DIBDRV_PRIMITIVE_FUNCS DIBDRV_funcs_DIB1
=
273 _DIBDRV_ColorToPixelColortable
,
274 _DIBDRV_GetPixelPointer1
,
278 _DIBDRV_PatternHLine1
,
282 _DIBDRV_AlphaBlend_generic
,
283 _DIBDRV_BitBlt_generic
,
284 _DIBDRV_StretchBlt_generic
,
285 _DIBDRV_freetype_blit_1