34 explicit Argb(T a, T r, T g, T b)
49 template <
typename T2>
52 red =
static_cast<T
>(c.
red);
53 green =
static_cast<T
>(c.
green);
54 blue =
static_cast<T
>(c.
blue);
55 alpha =
static_cast<T
>(c.
alpha);
81 std::ostream& operator<<(std::ostream& os, const Argb<T>& x)
83 return os <<
"(" << x.alpha <<
"," << x.red <<
"," 84 << x.green <<
"," << x.blue <<
")";
91 inline std::ostream& operator<<(std::ostream& os, const Argb<unsigned char>& x)
93 return os <<
"(" <<
static_cast<unsigned int>(x.alpha) <<
"," 94 << static_cast<unsigned int>(x.red) <<
"," 95 <<
static_cast<unsigned int>(x.green) <<
"," 96 << static_cast<unsigned int>(x.blue) <<
")";
All classes and functions are within the CVD namespace.
Definition: argb.h:6
bool operator==(const Argb< T > &c) const
Logical equals operator.
Definition: argb.h:61
A colour consisting of red, green, blue and alpha components.
Definition: argb.h:17
bool operator!=(const Argb< T > &c) const
Logical not-equals operator.
Definition: argb.h:68
Argb(T a, T r, T g, T b)
Constructs a colour as specified.
Definition: argb.h:34
T blue
The blue component.
Definition: argb.h:42
Argb< T > & operator=(const Argb< T2 > &c)
Assignment operator between two different storage types, using the standard casts as necessary...
Definition: argb.h:50
Argb()
Default constructor. Sets everything to 0.
Definition: argb.h:21
T red
The red component.
Definition: argb.h:44
T green
The green component.
Definition: argb.h:43
T alpha
The alpha component.
Definition: argb.h:45