BMPData.h 891 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #pragma once
  2. #include "ImageData.h"
  3. NS_BF_BEGIN;
  4. struct bmp_palette_element_s
  5. {
  6. unsigned char blue;
  7. unsigned char green;
  8. unsigned char red;
  9. unsigned char reserved; /* alpha ? */
  10. };
  11. typedef struct bmp_palette_element_s bmp_palette_element_t;
  12. class BMPData : public ImageData
  13. {
  14. public:
  15. int mReadPos;
  16. bool mHasTransFollowing;
  17. int Read(void* ptr, int elemSize, int elemCount);
  18. unsigned char ReadC();
  19. bool ReadPixelsRLE8(bmp_palette_element_t* palette);
  20. bool ReadPixelsRLE4(bmp_palette_element_t* palette);
  21. bool ReadPixels32();
  22. bool ReadPixels24();
  23. bool ReadPixels16();
  24. bool ReadPixels8(bmp_palette_element_t* palette);
  25. bool ReadPixels4(bmp_palette_element_t* palette);
  26. bool ReadPixels1(bmp_palette_element_t* palette);
  27. public:
  28. BMPData();
  29. bool ReadData();
  30. bool WriteToFile(const StringImpl& path);
  31. };
  32. NS_BF_END;