4#ifndef _SCENEPIC_COLOR_H_
5#define _SCENEPIC_COLOR_H_
18 class Color :
public Eigen::Vector3f
22 Color(
void) : Eigen::Vector3f() {}
25 Color(Eigen::Index rows, Eigen::Index cols) : Eigen::Vector3f(rows, cols) {}
27 typedef Eigen::Vector3f
Base;
31 template<
typename OtherDerived>
32 Color(
const Eigen::MatrixBase<OtherDerived>& other) : Eigen::Vector3f(other)
36 template<
typename OtherDerived>
39 this->Base::operator=(other);
48 Color(
const Scalar& red,
const Scalar& green,
const Scalar& blue);
57 from_bytes(std::uint8_t red, std::uint8_t green, std::uint8_t blue);
70 std::uint8_t
R()
const;
72 std::uint8_t
G()
const;
74 std::uint8_t
B()
const;
Class for representing color values.
Definition: color.h:19
Scalar r() const
The red value [0,1].
static Color from_bytes(std::uint8_t red, std::uint8_t green, std::uint8_t blue)
Construct a color object from byte values.
static const Color None()
Constant value indicating "no color".
Color(const Scalar &red, const Scalar &green, const Scalar &blue)
Constructor.
std::uint8_t G() const
The green value [0,255].
Color(Eigen::Index rows, Eigen::Index cols)
Needed for pybind.
Definition: color.h:25
Scalar & b()
Reference to the blue value [0,1].
Color(void)
Empty constructor.
Definition: color.h:22
Color & operator=(const Eigen::MatrixBase< OtherDerived > &other)
Constructor which allows Eigen assignments to Color.
Definition: color.h:37
Eigen::Vector3f Base
Definition: color.h:27
Scalar g() const
The green value [0,1].
std::uint8_t R() const
The red value [0,255].
bool is_none() const
Whether this is a "no color" instance.
Scalar & g()
Reference to the green value [0,1].
Scalar b() const
The blue value [0,1].
Color(const Eigen::MatrixBase< OtherDerived > &other)
Constructor which allows construction of Colors from Eigen expressions.
Definition: color.h:32
std::string to_string() const
Represent the color as a string.
std::string to_html_hex() const
Convert the color to an HTML hex color string.
std::uint8_t B() const
The blue value [0,255].
Scalar & r()
Reference to the red value [0,1].
const Color Green
Definition: color.h:107
const Color Olive
Definition: color.h:103
const Color Red
Definition: color.h:97
const Color Yellow
Definition: color.h:104
const Color Cyan
Definition: color.h:110
const Color Magenta
Definition: color.h:115
const Color Lime
Definition: color.h:106
const Color Maroon
Definition: color.h:98
const Color Mint
Definition: color.h:108
const Color Gray
Definition: color.h:116
const Color Purple
Definition: color.h:113
const Color White
Definition: color.h:96
const Color Navy
Definition: color.h:111
const Color Blue
Definition: color.h:112
const Color Black
Definition: color.h:95
const Color Orange
Definition: color.h:101
const Color Beige
Definition: color.h:105
const Color Lavender
Definition: color.h:114
const Color Coral
Definition: color.h:102
const Color Pink
Definition: color.h:99
const Color Brown
Definition: color.h:100
const Color Teal
Definition: color.h:109
Definition: audio_track.h:14