1 /* 2 * imagesource_bmp.h 3 * 24-bit RGB and 8-bit Greyscale BMP scanline-based Loader 4 * Supports Random Access 5 * 6 * Copyright (c) 2004 by Alastair M. Robinson 7 * Distributed under the terms of the GNU General Public License - 8 * see the file named "COPYING" for more details. 9 * 10 */ 11 12 #ifndef IMAGESOURCE_BMP_H 13 #define IMAGESOURCE_BMP_H 14 15 #include "imagesource.h" 16 #include <fstream> 17 18 using namespace std; 19 20 class IS_BMPStrip; 21 22 class ImageSource_BMP : public ImageSource 23 { 24 public: 25 ImageSource_BMP(const char *filename); 26 ~ImageSource_BMP(); 27 ISDataType *GetRow(int row); 28 private: 29 IS_BMPStrip *GetStrip(int row); 30 unsigned long GetValue(char *c,int l); 31 int resunit; 32 fstream file; 33 int cmapbytes; 34 int cmapentries; 35 int bytesperrow; 36 int imagestart; 37 int bitsperpixel; 38 int palette[256][3]; 39 IS_BMPStrip *strips; 40 friend class IS_BMPStrip; 41 }; 42 43 #endif 44