2 * DIB driver private definitions
4 * Copyright 2007 Jesse Allen
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
21 #ifndef __WINE_DIBDRV_H
22 #define __WINE_DIBDRV_H
26 typedef enum _DIBFORMAT
31 /*DIBFMT_DIB4RLE = 3,*/
33 /*DIBFMT_DIB8RLE = 5,*/
41 /* DIB driver's generic bitmap structure */
42 typedef struct _DIBDRVBITMAP
53 /* calculated numbers for bitfields */
54 INT bf_pos
[3]; /* starting position of the field */
55 INT bf_size
[3]; /* size of the field */
56 INT bf_shift
[3]; /* shifting required within a COLORREF's BYTE */
58 /* current drawing address */
62 /* ready encoded colors for drawing */
69 /* DIB conversions functions */
70 typedef struct _DIBCONVERT
72 void (*ConvertToDIB1
)(DIBDRVBITMAP
*,DIBDRVBITMAP
*,int);
73 void (*ConvertToDIB4
)(DIBDRVBITMAP
*,DIBDRVBITMAP
*,int);
74 void (*ConvertToDIB8
)(DIBDRVBITMAP
*,DIBDRVBITMAP
*,int);
75 void (*ConvertToDIB16
)(DIBDRVBITMAP
*,DIBDRVBITMAP
*,int);
76 void (*ConvertToDIB24
)(DIBDRVBITMAP
*,DIBDRVBITMAP
*,int);
77 void (*ConvertToDIB32
)(DIBDRVBITMAP
*,DIBDRVBITMAP
*,int);
80 /* DIB manipulation functions */
81 typedef struct _DIBFUNCS
83 void (*AdvancePosition
)(DIBDRVBITMAP
*,int);
84 void (*Copy
)(DIBDRVBITMAP
*,DIBDRVBITMAP
*,int,const DIBCONVERT
*);
85 void (*MoveXY
)(DIBDRVBITMAP
*,INT
,INT
);
86 void (*ReadColor
)(DIBDRVBITMAP
*,BYTE
*,BYTE
*,BYTE
*);
87 void (*SelectColor
)(DIBDRVBITMAP
*,COLORREF
);
88 void (*SetPixel
)(DIBDRVBITMAP
*,COLORREF
);
89 void (*WriteColor
)(DIBDRVBITMAP
*,int);
92 /* DIB driver physical device */
93 typedef struct _DIBDRVPHYSDEV
98 const DIBFUNCS
*funcs
;
99 const DIBCONVERT
*convs
;
102 /* bitmap handling functions */
103 extern DIBFORMAT
BITMAP_GetFormat( WORD depth
, DWORD compression
);
104 extern const DIBFUNCS
*BITMAP_GetDIBFuncs( DIBFORMAT format
);
105 extern const DIBCONVERT
*BITMAP_GetDIBConversions( DIBFORMAT format
);
106 extern DIBDRVBITMAP
*BITMAP_CreateFromBmi( const BITMAPINFO
*bmi
, void *bits
);
107 extern DIBDRVBITMAP
*BITMAP_CreateFromHBitmap( HBITMAP hbitmap
, RGBQUAD
*ct
, UINT nb_colors
);
109 /* DIB function tables for each format */
110 extern const DIBFUNCS DIB1_funcs
, DIB4_funcs
, DIB8_funcs
, DIB16_funcs
, DIB24_funcs
, DIB32_funcs
;
111 extern const DIBCONVERT DIB1_convs
, DIB4_convs
, DIB8_convs
, DIB16_convs
, DIB24_convs
, DIB32_convs
;
113 #endif /* __WINE_DIBDRV_H */