20 #ifndef ANTKEEPER_COLOR_RGB_HPP
21 #define ANTKEEPER_COLOR_RGB_HPP
50 r[0], r[1], T{1} - r[0] - r[1],
51 g[0], g[1], T{1} - g[0] - g[1],
52 b[0], b[1], T{1} - b[0] - b[1]
constexpr math::mat3< T > rgb_to_rgb(const rgb_color_space< T > &s0, const rgb_color_space< T > &s1, const math::mat3< T > &cone_response=bradford_cone_response< T >)
Constructs a matrix which transforms a color from one RGB color space to another RGB color space.
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 > rgb_to_xyz(const math::vec2< T > &r, const math::vec2< T > &g, const math::vec2< T > &b, const math::vec2< T > &w)
Constructs a matrix which transforms an RGB color into a CIE XYZ color.
Mathematical functions and data types.
constexpr mat4< T > scale(const vec3< T > &v)
Constructs a scale matrix.
constexpr T dot(const quaternion< T > &a, const quaternion< T > &b) noexcept
Calculates the dot product of two quaternions.
constexpr matrix< T, N, N > inverse(const matrix< T, N, N > &m) noexcept
Calculates the inverse of a square matrix.
const transfer_function_type oetf
Function pointer to the opto-electrical transfer function.
const math::vec2< T > w
CIE xy chromaticity coordinates of the white point.
const math::vec2< T > g
CIE xy chromaticity coordinates of the green primary.
const math::vec3< T > to_y
Vector which gives the luminance of an RGB color via dot product.
const math::vec2< T > r
CIE xy chromaticity coordinates of the red primary.
constexpr T luminance(const math::vec3< T > &x) const noexcept
Measures the luminance of a linear RGB color.
math::vec3< T >(*)(const math::vec3< T > &) transfer_function_type
Transfer function function pointer type.
const transfer_function_type eotf
Function pointer to the electro-optical transfer function.
const math::vec2< T > b
CIE xy chromaticity coordinates of the blue primary.
constexpr rgb_color_space(const math::vec2< T > &r, const math::vec2< T > &g, const math::vec2< T > &b, const math::vec2< T > &w, transfer_function_type eotf, transfer_function_type oetf)
Constructs an RGB color space.
const math::mat3< T > from_xyz
Matrix which transforms a CIE XYZ color to an RGB color.
const math::mat3< T > to_xyz
Matrix which transforms an RGB color to a CIE XYZ color.
n by m column-major matrix.