2 * GDI bitmap definitions
4 * Copyright 1993, 1994 Alexandre Julliard
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #ifndef __WINE_BITMAP_H
22 #define __WINE_BITMAP_H
26 struct tagGDI_BITMAP_DRIVER
;
28 /* Flags used for BitmapBits. We only use the first two at the moment */
33 #define DDB_SETWITHFILLER 8
35 /* DIB Section sync state */
36 enum { DIB_Status_None
, DIB_Status_InSync
, DIB_Status_GdiMod
, DIB_Status_AppMod
, DIB_Status_AuxMod
};
38 /* GDI logical bitmap object */
39 typedef struct tagBITMAPOBJ
43 SIZE size
; /* For SetBitmapDimension() */
44 const struct tagDC_FUNCS
*funcs
; /* DC function table */
45 void *physBitmap
; /* ptr to device specific data */
46 /* For device-independent bitmaps: */
48 SEGPTR segptr_bits
; /* segptr to DIB bits */
51 typedef struct tagBITMAP_DRIVER
53 INT (*pSetDIBits
)(struct tagBITMAPOBJ
*,struct tagDC
*,UINT
,UINT
,LPCVOID
,const BITMAPINFO
*,UINT
,HBITMAP
);
54 INT (*pGetDIBits
)(struct tagBITMAPOBJ
*,struct tagDC
*,UINT
,UINT
,LPVOID
,BITMAPINFO
*,UINT
,HBITMAP
);
55 VOID (*pDeleteDIBSection
)(struct tagBITMAPOBJ
*);
56 UINT (*pSetDIBColorTable
)(struct tagBITMAPOBJ
*,struct tagDC
*,UINT
,UINT
,const RGBQUAD
*);
57 UINT (*pGetDIBColorTable
)(struct tagBITMAPOBJ
*,struct tagDC
*,UINT
,UINT
,RGBQUAD
*);
58 INT (*pLockDIB
)(struct tagBITMAPOBJ
*,INT
,BOOL
);
59 VOID (*pUnlockDIB
)(struct tagBITMAPOBJ
*,BOOL
);
62 extern BITMAP_DRIVER
*BITMAP_Driver
;
64 /* objects/bitmap.c */
65 extern INT16
BITMAP_GetObject16( BITMAPOBJ
* bmp
, INT16 count
, LPVOID buffer
);
66 extern INT
BITMAP_GetObject( BITMAPOBJ
* bmp
, INT count
, LPVOID buffer
);
67 extern BOOL
BITMAP_DeleteObject( HBITMAP16 hbitmap
, BITMAPOBJ
* bitmap
);
68 extern INT
BITMAP_GetWidthBytes( INT width
, INT depth
);
69 extern HBITMAP
BITMAP_CopyBitmap( HBITMAP hbitmap
);
72 extern int DIB_GetDIBWidthBytes( int width
, int depth
);
73 extern int DIB_GetDIBImageBytes( int width
, int height
, int depth
);
74 extern int DIB_BitmapInfoSize( const BITMAPINFO
* info
, WORD coloruse
);
75 extern int DIB_GetBitmapInfo( const BITMAPINFOHEADER
*header
, DWORD
*width
,
76 int *height
, WORD
*bpp
, WORD
*compr
);
77 extern HBITMAP
DIB_CreateDIBSection( HDC hdc
, BITMAPINFO
*bmi
, UINT usage
, LPVOID
*bits
,
78 HANDLE section
, DWORD offset
, DWORD ovr_pitch
);
79 extern void DIB_UpdateDIBSection( DC
*dc
, BOOL toDIB
);
80 extern void DIB_DeleteDIBSection( BITMAPOBJ
*bmp
);
81 extern void DIB_SelectDIBSection( DC
*dc
, BITMAPOBJ
*bmp
);
82 extern HGLOBAL
DIB_CreateDIBFromBitmap(HDC hdc
, HBITMAP hBmp
);
84 #endif /* __WINE_BITMAP_H */