64 {red = c.
red; green = c.
green; blue = c.
blue;
return *
this;}
69 {
return red == c.
red && green == c.
green && blue == c.
blue;}
74 {
return red != c.
red || green != c.
green || blue != c.
blue;}
89 std::ostream& operator <<(std::ostream& os, const Rgb<T>& x)
91 return os <<
"(" << x.red <<
"," << x.green <<
","
99 inline std::ostream& operator <<(std::ostream& os, const Rgb<char>& x)
101 return os <<
"(" << (int)(
unsigned char)x.red <<
","
102 << (int)(
unsigned char)x.green <<
","
103 << (int)(
unsigned char)x.blue <<
")";
110 inline std::ostream& operator <<(std::ostream& os, const Rgb<byte>& x)
112 return os <<
"(" <<
static_cast<int>(x.red) <<
","
113 << static_cast<int>(x.green) <<
","
114 <<
static_cast<int>(x.blue) <<
")";
Rgb()
Default constructor. Does nothing.
T blue
The blue component.
Rgb< T > & operator=(const Rgb< T > &c)
T green
The green component.
Rgb< T > & operator=(const Rgb< T2 > &c)
bool operator==(const Rgb< T > &c) const
bool operator!=(const Rgb< T > &c) const