1 #ifndef colors_RGB_Space_H__
2 #define colors_RGB_Space_H__
5 #include "../geo/Vectors.h"
6 #include "../math/utility.h"
38 int const&
rgbMin(
size_t i)
const {
return min(i); }
39 int const&
rMin( )
const {
return min(0); }
40 int const&
gMin( )
const {
return min(1); }
41 int const&
bMin( )
const {
return min(2); }
42 int const&
rgbMax(
size_t i)
const {
return max(i); }
43 int const&
rMax( )
const {
return max(0); }
44 int const&
gMax( )
const {
return max(1); }
45 int const&
bMax( )
const {
return max(2); }
46 int const&
rgb(
size_t i)
const {
return val(i); }
47 int const&
r( )
const {
return rgb(0); }
48 int const&
g( )
const {
return rgb(1); }
49 int const&
b( )
const {
return rgb(2); }
50 int const&
rgb(
size_t i,
int c) {
return val(i, c); }
51 int const&
r(
int c) {
return rgb(0, c); }
52 int const&
g(
int c) {
return rgb(1, c); }
53 int const&
b(
int c) {
return rgb(2, c); }
106 double const&
rMin( )
const {
return min(0); }
107 double const&
gMin( )
const {
return min(1); }
108 double const&
bMin( )
const {
return min(2); }
110 double const&
rMax( )
const {
return max(0); }
111 double const&
gMax( )
const {
return max(1); }
112 double const&
bMax( )
const {
return max(2); }
113 double const&
rgb(
size_t i)
const {
return val(i); }
114 double const&
r( )
const {
return rgb(0); }
115 double const&
g( )
const {
return rgb(1); }
116 double const&
b( )
const {
return rgb(2); }
117 double const&
rgb(
size_t i,
double c) {
return val(i, c); }
118 double const&
r(
double c) {
return rgb(0, c); }
119 double const&
g(
double c) {
return rgb(1, c); }
120 double const&
b(
double c) {
return rgb(2, c); }
164 for (
size_t i = 0; i < 3; ++i) {
174 for (
size_t i = 0; i < 3; ++i) {
182 #endif // colors_RGB_Space_H__
double const & rMin() const
double const & r(double c)
double const & rgb(size_t i, double c)
RGBi_Space(RGBi_Space const &b)
int const & rgb(size_t i) const
以浮點數Red, Green, Blue 三個值所組成的色彩空間
double const & rgbMin(size_t i) const
RGBi_Space operator-(RGBi_Space const &b) const
intconst & min(size_t id) const
Return the minimum of the i -th channel.
RGBf_Space(Vector3D< double > const &v)
double & rgbGet(size_t i)
int & valGet(size_t id)
Get the non-constant reference of value of the i -th channel.
double const & rgb(size_t i) const
RGBi_Space & operator=(RGBi_Space const &b)
void colorTransformate(HSLf_Space const &in, HSLf_Space *out)
HSLf_Space to HSLf_Space
intconst & max(size_t id) const
Return the maximum of the i -th channel.
int const & rgbMin(size_t i) const
RGBi_Space operator+(RGBi_Space const &b) const
RGBi_Space operator*(int c) const
Base class of color space with 3 channels.
double const & gMin() const
int operator*(RGBi_Space const &b) const
double operator*(RGBf_Space const &b) const
以整數 Red, Green, Blue 三個值所組成的色彩空間
RGBf_Space operator-(RGBf_Space const &b) const
double const & bMax() const
double const & rMax() const
double const & b(double c)
RGBf_Space(RGBf_Space const &b)
RGBf_Space operator*(double const &c) const
int const & rgbMax(size_t i) const
RGBi_Space operator/(int c) const
RGBf_Space operator+(RGBf_Space const &b) const
double const & rgbMax(size_t i) const
double const & gMax() const
int const & rgb(size_t i, int c)
double const & bMin() const
Color3_Space< int > & copyFrom(Color3_Space< int > const &b)
Copy method.
double const & g(double c)
RGBf_Space & operator=(RGBf_Space const &b)
RGBf_Space operator/(double const &c) const
intconst & val(size_t id) const
Return the value of the i -th channel.
RGBi_Space(Vector3D< int > const &v)