22 Rgba& operator=(
const Rgba&) =
default;
29 inline explicit Rgba(T r, T g, T b, T a)
38 :
red(static_cast<T>(rgba.
red))
52 template <
typename T2>
55 red =
static_cast<T
>(c.
red);
56 green =
static_cast<T
>(c.
green);
57 blue =
static_cast<T
>(c.
blue);
58 alpha =
static_cast<T
>(c.
alpha);
84 std::ostream& operator<<(std::ostream& os, const Rgba<T>& x)
86 return os <<
"(" << x.red <<
"," << x.green <<
"," 87 << x.blue <<
"," << x.alpha <<
")";
94 inline std::ostream& operator<<(std::ostream& os, const Rgba<unsigned char>& x)
96 return os <<
"(" <<
static_cast<unsigned int>(x.red) <<
"," 97 << static_cast<unsigned int>(x.green) <<
"," 98 <<
static_cast<unsigned int>(x.blue) <<
"," 99 << static_cast<unsigned int>(x.alpha) <<
")";
T blue
The blue component.
Definition: rgba.h:47
All classes and functions are within the CVD namespace.
Definition: argb.h:6
T alpha
The alpha component.
Definition: rgba.h:48
bool operator!=(const Rgba< T > &c) const
Logical not-equals operator.
Definition: rgba.h:71
Rgba< T > & operator=(const Rgba< T2 > &c)
Assignment operator between two different storage types, using the standard casts as necessary...
Definition: rgba.h:53
A colour consisting of red, green, blue and alpha components.
Definition: rgba.h:17
bool operator==(const Rgba< T > &c) const
Logical equals operator.
Definition: rgba.h:64
T green
The green component.
Definition: rgba.h:46
Rgba(T r, T g, T b, T a)
Constructs a colour as specified.
Definition: rgba.h:29
T red
The red component.
Definition: rgba.h:45