00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef _CIvfBmpImage_h_
00026 #define _CIvfBmpImage_h_
00027
00028 #include <ivfimage/IvfFileImage.h>
00029
00030 IvfSmartPointer(CIvfBmpImage);
00031
00038 class IVFEXT_API CIvfBmpImage : public CIvfFileImage {
00039 private:
00040 bool m_alphaChannel;
00041 unsigned char *imageData;
00042 int width_ret;
00043 int height_ret;
00044 int numComponents_ret;
00045
00046
00047
00048 struct bmpheader {
00049 short FileType;
00050 short siz[2];
00051 short Reserved1, Reserved2;
00052 short offset[2];
00053 };
00054
00055 struct BMPInfo {
00056 long width;
00057 long height;
00058 short planes;
00059 short Colorbits;
00060 long compression;
00061 long ImageSize;
00062 long XpixPerMeter;
00063 long YpixPerMeter;
00064 long ColorUsed;
00065 long Important;
00066 long os2stuff[6];
00067 };
00068
00069
00070 void swapbyte(long *i);
00071 void swapbyte(unsigned long *i);
00072 void swapbyte(float *i);
00073 void swapbyte(unsigned short *i);
00074 void swapbyte(short *i);
00075
00076 unsigned char * bmp_load(const char *filename,
00077 int *width_ret,
00078 int *height_ret,
00079 int *numComponents_ret);
00080
00081 public:
00083 CIvfBmpImage();
00084
00086 CIvfBmpImage(const char* name);
00087
00089 virtual ~CIvfBmpImage();
00090
00091 IvfClassInfo("CIvfBmpImage",CIvfFileImage);
00092
00094 virtual bool read();
00095
00102 void setAlphaChannel(bool flag);
00103 };
00104
00105 #endif