|
std::ostream & | operator<< (std::ostream &os, const Color &c) |
|
bool | operator== (const Color &lhs, const Color &rhs) |
|
bool | operator!= (const Color &lhs, const Color &rhs) |
|
template<typename Int , std::enable_if_t< std::is_integral_v< Int >, int > = 0> |
uint8_t | to_byte (Int value) |
| Convert an integral type to a byte in [0, 255]. More...
|
|
template<typename Float , std::enable_if_t< std::is_floating_point_v< Float >, int > = 0> |
uint8_t | to_byte (Float value) |
| Convert a floating point type to a byte in [0, 255]. More...
|
|
template<typename Int , std::enable_if_t< std::is_integral_v< Int >, int > = 0> |
float | to_float (Int value) |
| Convert an integral point type to a float in [0.0, 1.0]. More...
|
|
template<typename Float , std::enable_if_t< std::is_floating_point_v< Float >, int > = 0> |
float | to_float (Float value) |
| Convert a floating pont type to a float in [0.0, 1.0]. More...
|
|
template<typename Scalar , int Rows, int Cols> |
Eigen::Matrix< int, Rows, Cols > | to_byte (Eigen::Matrix< Scalar, Rows, Cols > vector) |
|
template<typename Scalar , int Rows, int Cols> |
Eigen::Matrix< float, Rows, Cols > | to_float (Eigen::Matrix< Scalar, Rows, Cols > vector) |
|
Eigen::Vector3f | rgb_to_hsv (const Eigen::Vector3f &rgb) |
| Convert an RGB color to HSV. More...
|
|
Eigen::Vector3f | hsv_to_rgb (const Eigen::Vector3f &hsv) |
| Convert an HSV color to RGB. More...
|
|
Color | linear_hsv (float t, const Color &lhs, const Color &rhs) |
| Interpolate linearly in HSV space. (lhs and rhs are expected to be RGB.) More...
|
|
void | to_json (nlohmann::json &j, const Color &color) |
|
void | from_json (const nlohmann::json &j, Color &color) |
|
Eigen::Vector3f simox::color::rgb_to_hsv |
( |
const Eigen::Vector3f & |
rgb | ) |
|
Convert an RGB color to HSV.
Hue is measured in degrees, i.e. [0, 360]. All other channels (saturation, value, red, green, blue) are in the interval [0, 1].
- Parameters
-
rgb | The RGB color with all channels in range [0, 1]. |
- Returns
- The HSV color in [0, 360] x [0, 1] x [0, 1].