-
Notifications
You must be signed in to change notification settings - Fork 0
/
timage.hh
43 lines (36 loc) · 793 Bytes
/
timage.hh
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
#include <cstdint>
#include <string>
#ifndef TCOLORCLASS
#define TCOLORCLASS
class tcolor {
public:
uint8_t b;
uint8_t g;
uint8_t r;
uint8_t a;
tcolor();
tcolor(uint32_t);
tcolor(uint8_t,uint8_t,uint8_t);
tcolor(uint8_t,uint8_t,uint8_t,uint8_t);
tcolor operator*(const float) const;
tcolor& operator*=(const float);
tcolor& operator=(const tcolor&);
};
#endif
#ifndef TIMAGECLASS
#define TIMAGECLASS
class timage {
public:
uint32_t width;
uint32_t height;
tcolor* pixels;
~timage();
timage();
timage(const timage&); //deep copy
timage(uint32_t, uint32_t);
tcolor get(int,int) const;
void set(int,int, tcolor);
timage& operator=(timage&&); //swap
static timage fromFile(std::string);
};
#endif