Added trgb struct

This commit is contained in:
Bob Polis
2023-08-08 12:34:47 +02:00
parent d6d7e3d4cd
commit 969984213d
2 changed files with 36 additions and 6 deletions

View File

@ -54,17 +54,17 @@ namespace sc {
};
struct rgbf {
int _r;
int _g;
int _b;
int _r; // 0 .. 5
int _g; // 0 .. 5
int _b; // 0 .. 5
rgbf(int r, int g, int b);
};
struct rgbb {
int _r;
int _g;
int _b;
int _r; // 0 .. 5
int _g; // 0 .. 5
int _b; // 0 .. 5
rgbb(int r, int g, int b);
};
@ -73,6 +73,24 @@ namespace sc {
std::ostream& operator<<(std::ostream& out, const grayb& obj);
std::ostream& operator<<(std::ostream& out, const rgbf& obj);
std::ostream& operator<<(std::ostream& out, const rgbb& obj);
struct trgb {
double _r; // 0.0 .. 1.0
double _g; // 0.0 .. 1.0
double _b; // 0.0 .. 1.0
trgb(double r, double g, double b);
operator rgbf();
};
const trgb black {0.0, 0.0, 0.0};
const trgb red {1.0, 0.0, 0.0};
const trgb green {0.0, 1.0, 0.0};
const trgb yellow {1.0, 1.0, 0.0};
const trgb blue {0.0, 0.0, 1.0};
const trgb magenta {1.0, 0.0, 1.0};
const trgb cyan {0.0, 1.0, 1.0};
const trgb white {1.0, 1.0, 1.0};
}
}