forked from bailli/Johnny
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBMPFile.h
41 lines (33 loc) · 1021 Bytes
/
BMPFile.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef BMPFILE_H
#define BMPFILE_H
#include "BaseFile.h"
namespace SCRANTIC {
class BMPFile : public BaseFile
{
protected:
u_int16_t infBinSize;
u_int16_t magic; //0x8000
u_int32_t infSize;
u_int16_t imageCount;
std::vector<u_int16_t> widthList;
std::vector<u_int16_t> heightList;
u_int32_t binSize;
u_int8_t compressionFlag;
u_int32_t uncompressedSize;
std::vector<u_int8_t> uncompressedData;
std::vector<SDL_Surface *> imageList;
std::vector<SDL_Rect> imageRect;
SDL_Surface *overview;
SDL_Texture *ovTexture;
void createOverview();
public:
BMPFile(std::string name, std::vector<u_int8_t> &data);
~BMPFile();
SDL_Texture *getImage(SDL_Renderer *renderer, u_int16_t num, SDL_Rect &rect);
size_t getImageCount() { return imageList.size(); }
SDL_Texture *getOverviewImage(SDL_Renderer *renderer, SDL_Rect &rect);
void setPalette(SDL_Color color[], u_int16_t count);
SDL_Rect getRect(u_int16_t num);
};
}
#endif // BMPFILE_H