29 rgb_color(std::uint8_t nr, std::uint8_t ng, std::uint8_t nb) :
30 r(nr),
g(ng),
b(nb) { }
51 rgba_color(std::uint8_t nr, std::uint8_t ng, std::uint8_t nb, std::uint8_t na = 255) :
52 r(nr),
g(ng),
b(nb),
a(na) { }
63 bool is_null() const noexcept {
return (
a == 0); }
76 ycbcr_color(std::uint8_t ny, std::uint8_t ncr, std::uint8_t ncb) :
77 y(ny),
cr(ncr),
cb(ncb) { }
93 template<
typename Output,
typename Input>
111 return color_convert<rgba_color>(color_convert<rgb_color>(in));
std::uint8_t g
Definition: color.h:37
ycbcr_color(std::uint8_t ny, std::uint8_t ncr, std::uint8_t ncb)
Definition: color.h:76
static const rgb_color white
Definition: color.h:41
rgb_color(std::uint8_t nr, std::uint8_t ng, std::uint8_t nb)
Definition: color.h:29
std::uint8_t a
Definition: color.h:60
ycbcr_color & operator=(const ycbcr_color &)=default
YCbCr color, 8 bit.
Definition: color.h:74
std::uint8_t r
Definition: color.h:36
static rgba_color null() noexcept
Definition: color.h:62
bool operator!=(const mono_color &a, const mono_color &b)
Definition: color.cc:37
mono_color(std::uint8_t nint)
Definition: color.h:12
std::uint8_t b
Definition: color.h:38
static const mono_color black
Definition: color.h:19
static const rgba_color white
Definition: color.h:66
rgb_color & operator=(const rgb_color &)=default
Monochrome color, 8 bit.
Definition: color.h:10
Elem traits base class with the required members.
Definition: elem.h:14
static const rgb_color black
Definition: color.h:40
std::uint8_t cr
Definition: color.h:83
rgba_color & operator=(const rgba_color &)=default
RGBA color, 8 bit.
Definition: color.h:49
std::uint8_t r
Definition: color.h:57
std::uint8_t b
Definition: color.h:59
std::uint8_t intensity
Definition: color.h:17
rgb_color color_convert(const ycbcr_color &in)
Definition: color.cc:19
mono_color & operator=(const mono_color &)=default
static const rgba_color black
Definition: color.h:65
Default elem traits, using Elem as standard layout scalar type.
Definition: elem.h:30
static const mono_color white
Definition: color.h:20
std::uint8_t y
Definition: color.h:82
RGB color, 8 bit.
Definition: color.h:27
std::uint8_t g
Definition: color.h:58
bool operator==(const mono_color &a, const mono_color &b)
Definition: color.cc:33
rgba_color(std::uint8_t nr, std::uint8_t ng, std::uint8_t nb, std::uint8_t na=255)
Definition: color.h:51
std::uint8_t cb
Definition: color.h:84
bool is_null() const noexcept
Definition: color.h:63