00001 #ifndef GE_BITMAP____H
00002 #define GE_BITMAP____H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include "bitmap.h"
00026 #include "bitmap._h"
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 #define GEBM_VERSION_MAJOR (0x0004)
00037 #define GEBM_VERSION_MINOR (0x0000)
00038
00039 #define MAXMIPLEVELS (8)
00040
00041 #define PALETTE_FORMAT_DEFAULT (GE_PIXELFORMAT_24BIT_RGB)
00042
00043 #define ALPHA_TO_TRANSPARENCY_THRESHOLD (80)
00044
00045 struct geBitmap_Palette
00046 {
00047 int LockCount,RefCount;
00048 gePixelFormat Format;
00049 int Size;
00050 geBoolean HasColorKey;
00051 uint32 ColorKey;
00052 int ColorKeyIndex;
00053
00054
00055
00056 void *Data;
00057 DRV_Driver *Driver;
00058 geRDriver_THandle*DriverHandle;
00059 void *DriverBits;
00060 };
00061
00062 struct geBitmap
00063 {
00064 int RefCount;
00065 geBitmap_Info Info;
00066 void * Data[MAXMIPLEVELS];
00067 geBoolean Modified[MAXMIPLEVELS];
00068
00069
00070 geBitmap * Alpha;
00071
00072 int LockCount;
00073 geBitmap * LockOwner;
00074 geBitmap * DataOwner;
00075
00076 gePixelFormat PreferredFormat;
00077 int SeekMipCount;
00078
00079
00080
00081
00082 geBitmap_Info DriverInfo;
00083 uint32 DriverFlags;
00084 DRV_Driver * Driver;
00085 geRDriver_THandle * DriverHandle;
00086 int DriverMipLock;
00087 geBoolean DriverBitsLocked;
00088 geBoolean DriverDataChanged;
00089 geFloat DriverGamma;
00090 geFloat DriverGammaLast;
00091 geBoolean DriverGammaSet;
00092 };
00093
00094
00095
00096
00097
00098
00099 geBoolean geBitmap_IsValid(const geBitmap *Bmp);
00100 geBoolean geBitmap_Info_IsValid(const geBitmap_Info *Info);
00101 geBoolean geBitmap_Palette_IsValid(const geBitmap_Palette *Pal);
00102
00103 geBoolean geBitmap_BlitMipRect(const geBitmap * Src, int SrcMip, int SrcX,int SrcY,
00104 geBitmap * Dst, int DstMip, int DstX,int DstY,
00105 int SizeX,int SizeY);
00106
00107 geBitmap * geBitmap_CreateLock_CopyInfo(geBitmap *BmpSrc,int LockCnt,int mip);
00108 geBitmap * geBitmap_CreateLockFromMip(geBitmap *Src,int mip,
00109 gePixelFormat Format,geBoolean HasColorKey,uint32 ColorKey,int LockCnt);
00110 geBitmap * geBitmap_CreateLockFromMipSystem(geBitmap *Src,int mip,int LockCnt);
00111 geBitmap * geBitmap_CreateLockFromMipOnDriver(geBitmap *Src,int mip,int LockCnt);
00112
00113 geBoolean geBitmap_UnLock_NoChange(geBitmap *Bmp);
00114 geBoolean geBitmap_UnLockArray_NoChange(geBitmap **Locks,int Size);
00115
00116 geBoolean geBitmap_Update_SystemToDriver(geBitmap *Bmp);
00117 geBoolean geBitmap_Update_DriverToSystem(geBitmap *Bmp);
00118
00119 geBoolean geBitmap_MakeSystemMips(geBitmap *Bmp,int low,int high);
00120 geBoolean geBitmap_UpdateMips_Data( geBitmap_Info * FmInfo,void * FmBits,
00121 geBitmap_Info * ToInfo,void * ToBits);
00122 geBoolean geBitmap_UpdateMips_System(geBitmap *Bmp,int fm,int to);
00123
00124 geBoolean geBitmap_UsesColorKey(const geBitmap * Bmp);
00125
00126 void geBitmap_MakeMipInfo( geBitmap_Info *Src,int mip,geBitmap_Info *Into);
00127 geBoolean geBitmap_MakeDriverLockInfo(geBitmap *Bmp,int mip,geBitmap_Info *Into);
00128
00129
00130
00131 geBoolean geBitmap_AllocSystemMip(geBitmap *Bmp,int mip);
00132 geBoolean geBitmap_AllocPalette(geBitmap *Bmp,gePixelFormat Format,DRV_Driver * Driver);
00133
00134 geBoolean geBitmap_ReadInfo( geBitmap *Bmp,geVFile * F);
00135 geBoolean geBitmap_WriteInfo(const geBitmap *Bmp,geVFile * F);
00136
00137 geBoolean geBitmap_FixDriverFlags(uint32 *pFlags);
00138
00139
00140
00141 #endif