11#include "../geometry/geometry.hpp"
12#include "../macros.hpp"
15hi_export_module(hikogui.color.color_space);
17hi_export
namespace hi {
35[[nodiscard]]
constexpr matrix3
38 auto const w =
vector3{wx, wy, 1.0f - wx - wy};
39 auto const r =
vector3{rx, ry, 1.0f - rx - ry};
40 auto const g =
vector3{gx, gy, 1.0f - gx - gy};
41 auto const b =
vector3{bx, by, 1.0f - bx - by};
44 auto const W =
vector3{1.0f * (w.x() / w.y()), 1.0f, 1.0f * (w.z() / w.y())};
47 auto const C =
matrix3{r, g, b};
50 auto const S =
scale3{~C * W};
constexpr matrix3 color_primaries_to_RGBtoXYZ(float wx, float wy, float rx, float ry, float gx, float gy, float bx, float by) noexcept
Create a color space conversion matrix.
Definition color_space.hpp:36
The HikoGUI namespace.
Definition array_generic.hpp:20
DOXYGEN BUG.
Definition algorithm_misc.hpp:20
A 2D or 3D homogenius matrix for transforming homogenious vectors and points.
Definition matrix3.hpp:36
A high-level geometric vector Part of the high-level vector, point, mat and color types.
Definition vector3.hpp:26