blob: 28280afe73dbc903ed1527c795795fa21775efd0 [file] [log] [blame]
Alexandre Julliard8d24ae61994-04-05 21:42:43 +00001/*
2 * GDI bitmap definitions
3 *
Alexandre Julliard3a5816f1994-12-27 14:11:53 +00004 * Copyright 1993, 1994 Alexandre Julliard
Alexandre Julliard0799c1a2002-03-09 23:29:33 +00005 *
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.
10 *
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.
15 *
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
Alexandre Julliard8d24ae61994-04-05 21:42:43 +000019 */
20
Alexandre Julliard7cbe6571995-01-09 18:21:16 +000021#ifndef __WINE_BITMAP_H
22#define __WINE_BITMAP_H
Alexandre Julliard8d24ae61994-04-05 21:42:43 +000023
Alexandre Julliard7cbe6571995-01-09 18:21:16 +000024#include "gdi.h"
Alexandre Julliardb1bac321996-12-15 19:45:59 +000025
Alexandre Julliard447ddfd2000-12-06 20:15:43 +000026/* DIB Section sync state */
27enum { DIB_Status_None, DIB_Status_InSync, DIB_Status_GdiMod, DIB_Status_AppMod, DIB_Status_AuxMod };
28
Alexandre Julliard7cbe6571995-01-09 18:21:16 +000029 /* GDI logical bitmap object */
Huw D M Davies87f87bf1998-10-28 09:53:53 +000030typedef struct tagBITMAPOBJ
Alexandre Julliard7cbe6571995-01-09 18:21:16 +000031{
32 GDIOBJHDR header;
Patrik Stridvallb87fe2e1999-04-01 08:16:08 +000033 BITMAP bitmap;
34 SIZE size; /* For SetBitmapDimension() */
Alexandre Julliarda08e2cf2000-03-28 13:37:50 +000035 const struct tagDC_FUNCS *funcs; /* DC function table */
36 void *physBitmap; /* ptr to device specific data */
Alexandre Julliarda845b881998-06-01 10:44:35 +000037 /* For device-independent bitmaps: */
Patrik Stridvallb87fe2e1999-04-01 08:16:08 +000038 DIBSECTION *dib;
Alexandre Julliard6bbc7452001-07-22 23:13:08 +000039 SEGPTR segptr_bits; /* segptr to DIB bits */
Alexandre Julliard7cbe6571995-01-09 18:21:16 +000040} BITMAPOBJ;
Alexandre Julliard3a5816f1994-12-27 14:11:53 +000041
Alexandre Julliard7cbe6571995-01-09 18:21:16 +000042 /* objects/bitmap.c */
Alexandre Julliarda3960291999-02-26 11:11:13 +000043extern HBITMAP BITMAP_CopyBitmap( HBITMAP hbitmap );
Alexandre Julliardd8a92442002-05-31 18:43:22 +000044extern BOOL BITMAP_SetOwnerDC( HBITMAP hbitmap, DC *dc );
Alexandre Julliard7cbe6571995-01-09 18:21:16 +000045
46 /* objects/dib.c */
Alexandre Julliard7ff1c411997-05-25 13:58:18 +000047extern int DIB_GetDIBWidthBytes( int width, int depth );
Huw D M Davies608629b1999-04-18 12:07:00 +000048extern int DIB_GetDIBImageBytes( int width, int height, int depth );
Huw D M Davies56166a61999-04-19 16:45:24 +000049extern int DIB_BitmapInfoSize( const BITMAPINFO * info, WORD coloruse );
Ove Kaaven8b9f3382000-04-29 16:47:07 +000050extern HBITMAP DIB_CreateDIBSection( HDC hdc, BITMAPINFO *bmi, UINT usage, LPVOID *bits,
51 HANDLE section, DWORD offset, DWORD ovr_pitch );
Alexandre Julliarda3960291999-02-26 11:11:13 +000052extern void DIB_UpdateDIBSection( DC *dc, BOOL toDIB );
Alexandre Julliard642d3131998-07-12 19:29:36 +000053extern void DIB_SelectDIBSection( DC *dc, BITMAPOBJ *bmp );
Noel Borthwickd05b7be1999-09-20 15:42:47 +000054extern HGLOBAL DIB_CreateDIBFromBitmap(HDC hdc, HBITMAP hBmp);
Alexandre Julliard7cbe6571995-01-09 18:21:16 +000055
56#endif /* __WINE_BITMAP_H */