Alexandre Julliard | 8d24ae6 | 1994-04-05 21:42:43 +0000 | [diff] [blame] | 1 | /* |
| 2 | * GDI bitmap definitions |
| 3 | * |
Alexandre Julliard | 3a5816f | 1994-12-27 14:11:53 +0000 | [diff] [blame] | 4 | * Copyright 1993, 1994 Alexandre Julliard |
Alexandre Julliard | 8d24ae6 | 1994-04-05 21:42:43 +0000 | [diff] [blame] | 5 | */ |
| 6 | |
Alexandre Julliard | 7cbe657 | 1995-01-09 18:21:16 +0000 | [diff] [blame] | 7 | #ifndef __WINE_BITMAP_H |
| 8 | #define __WINE_BITMAP_H |
Alexandre Julliard | 8d24ae6 | 1994-04-05 21:42:43 +0000 | [diff] [blame] | 9 | |
Alexandre Julliard | 7cbe657 | 1995-01-09 18:21:16 +0000 | [diff] [blame] | 10 | #include "gdi.h" |
Alexandre Julliard | b1bac32 | 1996-12-15 19:45:59 +0000 | [diff] [blame] | 11 | |
Patrik Stridvall | b87fe2e | 1999-04-01 08:16:08 +0000 | [diff] [blame] | 12 | struct tagGDI_BITMAP_DRIVER; |
Alexandre Julliard | 642d313 | 1998-07-12 19:29:36 +0000 | [diff] [blame] | 13 | |
Huw D M Davies | 87f87bf | 1998-10-28 09:53:53 +0000 | [diff] [blame] | 14 | /* Flags used for BitmapBits. We only use the first two at the moment */ |
| 15 | |
| 16 | #define DDB_SET 1 |
| 17 | #define DDB_GET 2 |
| 18 | #define DDB_COPY 4 |
| 19 | #define DDB_SETWITHFILLER 8 |
| 20 | |
Alexandre Julliard | 7cbe657 | 1995-01-09 18:21:16 +0000 | [diff] [blame] | 21 | /* GDI logical bitmap object */ |
Huw D M Davies | 87f87bf | 1998-10-28 09:53:53 +0000 | [diff] [blame] | 22 | typedef struct tagBITMAPOBJ |
Alexandre Julliard | 7cbe657 | 1995-01-09 18:21:16 +0000 | [diff] [blame] | 23 | { |
| 24 | GDIOBJHDR header; |
Patrik Stridvall | b87fe2e | 1999-04-01 08:16:08 +0000 | [diff] [blame] | 25 | BITMAP bitmap; |
| 26 | SIZE size; /* For SetBitmapDimension() */ |
Alexandre Julliard | a08e2cf | 2000-03-28 13:37:50 +0000 | [diff] [blame] | 27 | const struct tagDC_FUNCS *funcs; /* DC function table */ |
| 28 | void *physBitmap; /* ptr to device specific data */ |
Alexandre Julliard | a845b88 | 1998-06-01 10:44:35 +0000 | [diff] [blame] | 29 | /* For device-independent bitmaps: */ |
Patrik Stridvall | b87fe2e | 1999-04-01 08:16:08 +0000 | [diff] [blame] | 30 | DIBSECTION *dib; |
Alexandre Julliard | 7cbe657 | 1995-01-09 18:21:16 +0000 | [diff] [blame] | 31 | } BITMAPOBJ; |
Alexandre Julliard | 3a5816f | 1994-12-27 14:11:53 +0000 | [diff] [blame] | 32 | |
Patrik Stridvall | b87fe2e | 1999-04-01 08:16:08 +0000 | [diff] [blame] | 33 | typedef struct tagBITMAP_DRIVER |
| 34 | { |
| 35 | INT (*pSetDIBits)(struct tagBITMAPOBJ *,struct tagDC *,UINT,UINT,LPCVOID,const BITMAPINFO *,UINT,HBITMAP); |
| 36 | INT (*pGetDIBits)(struct tagBITMAPOBJ *,struct tagDC *,UINT,UINT,LPVOID,BITMAPINFO *,UINT,HBITMAP); |
| 37 | VOID (*pDeleteDIBSection)(struct tagBITMAPOBJ *); |
| 38 | } BITMAP_DRIVER; |
| 39 | |
| 40 | extern BITMAP_DRIVER *BITMAP_Driver; |
| 41 | |
Alexandre Julliard | 7cbe657 | 1995-01-09 18:21:16 +0000 | [diff] [blame] | 42 | /* objects/bitmap.c */ |
Alexandre Julliard | 77b9918 | 1997-09-14 17:17:23 +0000 | [diff] [blame] | 43 | extern INT16 BITMAP_GetObject16( BITMAPOBJ * bmp, INT16 count, LPVOID buffer ); |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 44 | extern INT BITMAP_GetObject( BITMAPOBJ * bmp, INT count, LPVOID buffer ); |
| 45 | extern BOOL BITMAP_DeleteObject( HBITMAP16 hbitmap, BITMAPOBJ * bitmap ); |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 46 | extern INT BITMAP_GetWidthBytes( INT width, INT depth ); |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 47 | extern HBITMAP BITMAP_CopyBitmap( HBITMAP hbitmap ); |
Alexandre Julliard | 7cbe657 | 1995-01-09 18:21:16 +0000 | [diff] [blame] | 48 | |
| 49 | /* objects/dib.c */ |
Alexandre Julliard | 7ff1c41 | 1997-05-25 13:58:18 +0000 | [diff] [blame] | 50 | extern int DIB_GetDIBWidthBytes( int width, int depth ); |
Huw D M Davies | 608629b | 1999-04-18 12:07:00 +0000 | [diff] [blame] | 51 | extern int DIB_GetDIBImageBytes( int width, int height, int depth ); |
Huw D M Davies | 56166a6 | 1999-04-19 16:45:24 +0000 | [diff] [blame] | 52 | extern int DIB_BitmapInfoSize( const BITMAPINFO * info, WORD coloruse ); |
Huw D M Davies | 87f87bf | 1998-10-28 09:53:53 +0000 | [diff] [blame] | 53 | extern int DIB_GetBitmapInfo( const BITMAPINFOHEADER *header, DWORD *width, |
| 54 | int *height, WORD *bpp, WORD *compr ); |
Ove Kaaven | 8b9f338 | 2000-04-29 16:47:07 +0000 | [diff] [blame] | 55 | extern HBITMAP DIB_CreateDIBSection( HDC hdc, BITMAPINFO *bmi, UINT usage, LPVOID *bits, |
| 56 | HANDLE section, DWORD offset, DWORD ovr_pitch ); |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 57 | extern void DIB_UpdateDIBSection( DC *dc, BOOL toDIB ); |
Alexandre Julliard | 642d313 | 1998-07-12 19:29:36 +0000 | [diff] [blame] | 58 | extern void DIB_DeleteDIBSection( BITMAPOBJ *bmp ); |
| 59 | extern void DIB_SelectDIBSection( DC *dc, BITMAPOBJ *bmp ); |
Noel Borthwick | d05b7be | 1999-09-20 15:42:47 +0000 | [diff] [blame] | 60 | extern HGLOBAL DIB_CreateDIBFromBitmap(HDC hdc, HBITMAP hBmp); |
Alexandre Julliard | 7cbe657 | 1995-01-09 18:21:16 +0000 | [diff] [blame] | 61 | |
| 62 | #endif /* __WINE_BITMAP_H */ |