-
Notifications
You must be signed in to change notification settings - Fork 0
/
window.hpp
80 lines (55 loc) · 1.3 KB
/
window.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#ifndef WINDOW_H
#define WINDOW_H
#include <iostream>
#include <vector>
#include <string>
#include "matrix.hpp"
class Color
{
private:
int red;
int green;
int blue;
int scale;
bool clamp;
public:
Color(int red, int green, int blue, int scale = 255, bool clamp = true);
void set(int red, int green, int blue);
void setScale(int scale);
void disableClamp();
void enableClamp();
int getRed() const;
int getGreen() const;
int getBlue() const;
void print() const;
Color operator+(const Color &c);
Color operator+(const Point &p);
Color operator*(const Color &c);
Color operator*(const Point &p);
Color operator*(double v);
Color operator/(double v);
};
class Window
{
private:
const int xDimension;
const int yDimension;
bool xInverted;
bool yInverted;
int colorScale;
std::string output;
std::vector<std::vector<Color>> window;
public:
Window(int xDimension, int yDimension);
void draw(const std::string &file, bool binary = true);
void display();
void dither();
int getXDimension() const;
int getYDimension() const;
void invertX();
void invertY();
void setColorScale(int colorScale);
int getColorScale() const;
std::vector<Color> &operator[](int i);
};
#endif