home *** CD-ROM | disk | FTP | other *** search
/ Cutting-Edge 3D Game Programming with C++ / CE3DC++.ISO / BOOK / CHAP12 / BMP32.HPP < prev    next >
C/C++ Source or Header  |  1996-01-24  |  853b  |  45 lines

  1. //
  2. // File name: BMP32.CPP
  3. //
  4. // Description: A BMP image class implementation
  5. //
  6. // Author: John De Goes
  7. //
  8. // Project: Cutting Edge 3D Game Programming
  9. //
  10.  
  11. #ifndef BMP32HPP
  12. #define BMP32HPP
  13.  
  14. #include <Math.H>
  15. #include <StdIO.H>
  16. #include <Windows.H>
  17.  
  18. class BMPImage {
  19. protected:
  20.   BITMAPFILEHEADER FileHeader;
  21.   BITMAPINFOHEADER InfoHeader;
  22. public:
  23.   RGBQUAD          *Palette;
  24.   BYTE             *Image;
  25.   long Width, Height, ColorCount, BitCount;
  26.  
  27.   enum { OpenErr = 0, Success, MemErr, ReadErr, ResErr, CompErr };
  28.   int Load ( char *FileName );
  29.   int SaveBT ( FILE *OutFile );
  30.   int LoadBT ( FILE *InFile );
  31.  
  32.   int SavePal ( FILE *OutFile );
  33.   int LoadPal ( FILE *InFile );
  34.  
  35.   ~BMPImage ()
  36.      {
  37.      if ( Palette )
  38.         delete [] Palette;
  39.      if ( Image )
  40.         delete [] Image;
  41.      }
  42. };
  43.  
  44. #endif
  45.