-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathSprDecode.hpp
61 lines (49 loc) · 1.95 KB
/
SprDecode.hpp
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#ifndef SPRDECODE_HPP_INCLUDED
#define SPRDECODE_HPP_INCLUDED
#include "wx/string.h"
#include "wx/image.h"
#include "mydefs.hpp"
#include "FreeImage.h"
class SprDecode
{
public:
enum COLOUR_MODLE{PIC_RGB,PIC_RGBA, PIC_BGRA};
SprDecode();
~SprDecode();
void Init();
SprDecode(const wxString SprFilePath);
void SetSprFile(const wxString SprFilePath);
wxString GetFilePath();
bool ReadSprFile();
bool ReadSprFile(const wxString SprFilePath);
wxString GetVersionInfo();
unsigned long GetFramesCounts();
//unsigned long GetFrameDataLength(const unsigned long index);
long GetGlobleWidth();
long GetGlobleHeight();
//long GetFrameWidth(const unsigned long index);
//long GetFrameHeight(const unsigned long index);
long GetDirection();
unsigned long GetColourCounts();
unsigned long GetInterval();
long GetBottom();
long GetLeft();
//data must be free() if won't use anymore
Palette_Colour GetTransparentColor();
unsigned char* GetDecodedFrameData(const unsigned long index, int* Width = NULL, int* Height = NULL,
COLOUR_MODLE mod = PIC_RGB,bool *isTransparent = NULL,
Palette_Colour *TransparentColor = NULL, unsigned char transmask = 0,
int *offX = NULL, int *offY = NULL);
//transmask - pixel alpha value is less than transmask consider tottle transparent
FILOCRGBQUAD* GetFIDecodedFrameData(const unsigned long index, int &width, int &height, int &offX, int &offY);
wxImage GetFrameImage(const unsigned long index, unsigned char transmask = 0);
Palette PaletteData;
private:
void InitTransparentColor();
Palette_Colour TransparentColor;
SprFileHead FileHead;
wxString FilePath;
unsigned long FrameDataBegPos;
//FrameData* FramesDataBlock;
};
#endif // SPRDECODE_HPP_INCLUDED