-
Notifications
You must be signed in to change notification settings - Fork 0
/
color.h
51 lines (41 loc) · 1.04 KB
/
color.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
#ifndef COLOR_H_
#define COLOR_H_
#include <iostream>
typedef double F64;
namespace color
{
class rgbColor
{
bool mode_; //true - color is on unit interval; false - color is from 0 to 255
F64 r_;
F64 g_;
F64 b_;
public:
rgbColor(F64 _r, F64 _g, F64 _b, bool isZeroOne);
void changeMode(bool newMode);
inline F64 mode() const { return mode_; }
inline F64 r() const { return r_; }
inline F64 g() const { return g_; }
inline F64 b() const { return b_; }
void setR(F64 _r);
void setG(F64 _g);
void setB(F64 _b);
void normalize();
rgbColor operator+(const rgbColor c1) const;
rgbColor operator*(const rgbColor c1) const;
};
rgbColor operator*(F64 mult, rgbColor rhs);
rgbColor operator*(rgbColor lhs, F64 mult);
void pc(rgbColor c);
/*class rgbaColor : public rgbColor
{
F64 a_;
public:
rgbaColor(F64 _r, F64 _g, F64 _b, F64 _a, bool isZeroOne);
F64 a() { return a_; }
void setA(F64 _a);
rgbaColor operator+(const rgbaColor c1) const;
rgbaColor operator*(const rgbaColor c1) const;
};*/
}
#endif