0001: #ifndef _CBITMAP_H_
0002: #define _CBITMAP_H_
0003: 
0004: #include <stdio.h>
0005: #include <stdlib.h>
0006: 
0007: ///////////////////////////////////////////////////////////////////////////////
0008: //Bitmapファイル
0009: //BitmapHeader構造体
0010: typedef struct _BitmapHeader{
0011:     char    distinct1;
0012:     char    distinct2;
0013:     int     filesize;
0014:     short   reserve1;
0015:     short   reserve2;
0016:     int     offset;
0017: }BitmapHeader;
0018: 
0019: //BitmapInfoHeader構造体
0020: typedef struct _BitmapInfoHeader{
0021:     int     header;
0022:     int     width;
0023:     int     height;
0024:     short   plane;
0025:     short   bits;
0026:     int     compression;
0027:     int     comp_image_size;
0028:     int     x_resolution;
0029:     int     y_resolution;
0030:     int     pallet_num;
0031:     int     important_pallet_num;
0032: }BitmapInfoHeader;
0033: 
0034: 
0035: class CBitmap{
0036: private:
0037:     static int _ReadHeader( BitmapHeader *header, FILE *fp );
0038:     static int _ReadInfoHeader( BitmapInfoHeader *info, FILE *fp );
0039:     static int _CheckHeaders (const BitmapHeader *pBH, const BitmapInfoHeader *pBIH );
0040:     static int _CheckSize(unsigned int pict_size);
0041:     
0042:     static unsigned int _Analize8bit ( const BitmapInfoHeader *pBIH, FILE *fp );
0043:     static unsigned int _Analize24bit( const BitmapInfoHeader *pBIH, FILE *fp );
0044: public:
0045:     static unsigned int Load( const char *filename );
0046: };
0047: 
0048: 
0049: 
0050: 
0051: 
0052: 
0053: #endif _CBITMAP_H_
0054: