-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathBitmap.h
More file actions
45 lines (33 loc) · 1.06 KB
/
Bitmap.h
File metadata and controls
45 lines (33 loc) · 1.06 KB
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
// Bitmap.h: interface for the CBitmap class.
//
//////////////////////////////////////////////////////////////////////
#ifndef __BITMAP_H__
#define __BITMAP_H__
#include <string>
using std::string;
class CBitmap
{
public:
CBitmap(unsigned char* data,int xsize,int ysize);
CBitmap(string const& filename);
CBitmap();
CBitmap(const CBitmap& old);
CBitmap& operator=(const CBitmap& bm);
virtual ~CBitmap();
void Load(string const& filename, unsigned char defaultAlpha=255);
void Save(string const& filename);
unsigned int CreateTexture(bool mipmaps=false);
unsigned int CreateDDSTexture();
void CreateAlpha(unsigned char red,unsigned char green,unsigned char blue);
void SetTransparent(unsigned char red, unsigned char green, unsigned char blue);
CBitmap GetRegion(int startx, int starty, int width, int height);
CBitmap CreateMipmapLevel(void);
unsigned char* mem;
int xsize;
int ysize;
public:
CBitmap CreateRescaled(int newx, int newy);
void ReverseYAxis(void);
void CreateFromDXT1(unsigned char* buf, int xsize, int ysize);
};
#endif // __BITMAP_H__