-
Notifications
You must be signed in to change notification settings - Fork 0
/
Bitmap.h
71 lines (56 loc) · 1.32 KB
/
Bitmap.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#pragma once
#define MAX_INDEX 1024
//----------------------------------------------------------
//
//----------------------------------------------------------
struct rgb
{
int r;
int g;
int b;
rgb()
{
r = 255;
g = 255;
b = 255;
}
rgb(int r, int g, int b)
{
this->r = r;
this->g = g;
this->b = b;
}
};
//----------------------------------------------------------
// Desc: Just the bitmap data
//----------------------------------------------------------
class BitmapMin
{
public:
rgb **map;
int width = MAX_INDEX;
int height = MAX_INDEX;
BitmapMin();
~BitmapMin();
void shutDown();
};
//----------------------------------------------------------
// Desc: Utility routines applicable to BitmapMin objects
//----------------------------------------------------------
class BitmapUtils
{
public:
BitmapUtils();
~BitmapUtils();
void rgbFill(BitmapMin *input, rgb color);
void rotate90deg(BitmapMin *input);
void flipHorizontal(BitmapMin *input);
void flipVertical(BitmapMin *input);
rgb rectColor = { 234, 235, 66 };
int rectWidth = 3;
void drawRectangle(BitmapMin *input, int sx, int sy, int ex, int ey);
void drawLine(BitmapMin *input, float degrees, float magnitude, int stX, int stY, rgb color);
void resample(BitmapMin *input, int newWidth, int newHeight);
private:
BitmapMin *temporary;
};