1 #ifndef CVD_INCLUDE_BGRX_H 2 #define CVD_INCLUDE_BGRX_H 32 explicit Bgrx(T b, T g, T r)
47 template <
typename T2>
50 blue =
static_cast<T
>(c.
blue);
51 green =
static_cast<T
>(c.
green);
52 red =
static_cast<T
>(c.
red);
60 return red == c.
red && green == c.
green && blue == c.
blue;
67 return red != c.
red || green != c.
green || blue != c.
blue;
78 std::ostream& operator<<(std::ostream& os, const Bgrx<T>& x)
80 return os <<
"(" << x.blue <<
"," 81 << x.green <<
"," << x.red <<
")";
88 inline std::ostream& operator<<(std::ostream& os, const Bgrx<unsigned char>& x)
91 <<
static_cast<unsigned int>(x.blue) <<
")" 92 << static_cast<unsigned int>(x.green) <<
"," 93 <<
static_cast<unsigned int>(x.red) <<
",";
Bgrx(T b, T g, T r)
Constructs a colour as specified.
Definition: bgrx.h:32
T dummy
The dummy.
Definition: bgrx.h:43
All classes and functions are within the CVD namespace.
Definition: argb.h:6
A colour consisting of red, green, blue and dummy components, in the order bgr dummy in memory...
Definition: bgrx.h:16
T blue
The blue component.
Definition: bgrx.h:40
bool operator!=(const Bgrx< T > &c) const
Logical not-equals operator.
Definition: bgrx.h:65
T red
The red component.
Definition: bgrx.h:42
Bgrx< T > & operator=(const Bgrx< T2 > &c)
Assignment operator between two different storage types, using the standard casts as necessary...
Definition: bgrx.h:48
Bgrx()
Default constructor. Sets everything to 0.
Definition: bgrx.h:20
T green
The green component.
Definition: bgrx.h:41
bool operator==(const Bgrx< T > &c) const
Logical equals operator.
Definition: bgrx.h:58