20 #ifndef ANTKEEPER_COLOR_CAT_HPP
21 #define ANTKEEPER_COLOR_CAT_HPP
40 T{ 0.8951}, T{-0.7502}, T{ 0.0389},
41 T{ 0.2664}, T{ 1.7135}, T{-0.0685},
42 T{-0.1614}, T{ 0.0367}, T{ 1.0296}
53 T{ 0.40024}, T{-0.22630}, T{0.00000},
54 T{ 0.70760}, T{ 1.16532}, T{0.00000},
55 T{-0.08081}, T{ 0.04570}, T{0.91822}
82 const math::vec3<T> w0_xyz = {w0[0] / w0[1], T{1}, (T{1} - w0[0] - w0[1]) / w0[1]};
83 const math::vec3<T> w1_xyz = {w1[0] / w1[1], T{1}, (T{1} - w1[0] - w1[1]) / w1[1]};
86 const math::vec3<T> w0_cone_response = cone_response * w0_xyz;
87 const math::vec3<T> w1_cone_response = cone_response * w1_xyz;
91 w1_cone_response[0] / w0_cone_response[0], T{0}, T{0},
92 T{0}, w1_cone_response[1] / w0_cone_response[1], T{0},
93 T{0}, T{0}, w1_cone_response[2] / w0_cone_response[2],
constexpr math::mat3< T > xyz_scaling_cone_response
XYZ scaling cone response matrix.
constexpr math::mat3< T > bradford_cone_response
Bradford cone response matrix.
constexpr math::mat3< T > cat_matrix(const math::vec2< T > &w0, const math::vec2< T > &w1, const math::mat3< T > &cone_response=bradford_cone_response< T >) noexcept
Constructs a chromatic adaptation transform (CAT) matrix.
constexpr math::mat3< T > von_kries_cone_response
von Kries cone response matrix.
constexpr mat4< T > scale(const vec3< T > &v)
Constructs a scale matrix.
constexpr matrix< T, N, N > inverse(const matrix< T, N, N > &m) noexcept
Calculates the inverse of a square matrix.
n by m column-major matrix.
static constexpr matrix identity() noexcept
Returns an identity matrix, with ones on the main diagonal and zeros elsewhere.