Antkeeper  0.0.1
Public Types | Public Member Functions | Public Attributes | List of all members
color::rgb_color_space< T > Struct Template Reference

RGB color space. More...

#include <rgb.hpp>

Public Types

using transfer_function_type = math::vec3< T >(*)(const math::vec3< T > &)
 Transfer function function pointer type. More...
 

Public Member Functions

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. More...
 
constexpr T luminance (const math::vec3< T > &x) const noexcept
 Measures the luminance of a linear RGB color. More...
 

Public Attributes

const math::vec2< T > r
 CIE xy chromaticity coordinates of the red primary. More...
 
const math::vec2< T > g
 CIE xy chromaticity coordinates of the green primary. More...
 
const math::vec2< T > b
 CIE xy chromaticity coordinates of the blue primary. More...
 
const math::vec2< T > w
 CIE xy chromaticity coordinates of the white point. More...
 
const transfer_function_type eotf
 Function pointer to the electro-optical transfer function. More...
 
const transfer_function_type oetf
 Function pointer to the opto-electrical transfer function. More...
 
const math::mat3< T > to_xyz
 Matrix which transforms an RGB color to a CIE XYZ color. More...
 
const math::mat3< T > from_xyz
 Matrix which transforms a CIE XYZ color to an RGB color. More...
 
const math::vec3< T > to_y
 Vector which gives the luminance of an RGB color via dot product. More...
 

Detailed Description

template<class T>
struct color::rgb_color_space< T >

RGB color space.

Definition at line 69 of file rgb.hpp.

Member Typedef Documentation

◆ transfer_function_type

template<class T >
using color::rgb_color_space< T >::transfer_function_type = math::vec3<T> (*)(const math::vec3<T>&)

Transfer function function pointer type.

Definition at line 72 of file rgb.hpp.

Constructor & Destructor Documentation

◆ rgb_color_space()

template<class T >
constexpr color::rgb_color_space< T >::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 
)
inlineconstexpr

Constructs an RGB color space.

Parameters
rCIE xy chromaticity coordinates of the red primary.
gCIE xy chromaticity coordinates of the green primary.
bCIE xy chromaticity coordinates of the blue primary.
wCIE xy chromaticity coordinates of the white point.

Definition at line 109 of file rgb.hpp.

Member Function Documentation

◆ luminance()

template<class T >
constexpr T color::rgb_color_space< T >::luminance ( const math::vec3< T > &  x) const
inlineconstexprnoexcept

Measures the luminance of a linear RGB color.

Parameters
xLinear RGB color.
Returns
return Luminance of x.

Definition at line 127 of file rgb.hpp.

Member Data Documentation

◆ b

template<class T >
const math::vec2<T> color::rgb_color_space< T >::b

CIE xy chromaticity coordinates of the blue primary.

Definition at line 81 of file rgb.hpp.

◆ eotf

template<class T >
const transfer_function_type color::rgb_color_space< T >::eotf

Function pointer to the electro-optical transfer function.

Definition at line 87 of file rgb.hpp.

◆ from_xyz

template<class T >
const math::mat3<T> color::rgb_color_space< T >::from_xyz

Matrix which transforms a CIE XYZ color to an RGB color.

Definition at line 96 of file rgb.hpp.

◆ g

template<class T >
const math::vec2<T> color::rgb_color_space< T >::g

CIE xy chromaticity coordinates of the green primary.

Definition at line 78 of file rgb.hpp.

◆ oetf

template<class T >
const transfer_function_type color::rgb_color_space< T >::oetf

Function pointer to the opto-electrical transfer function.

Definition at line 90 of file rgb.hpp.

◆ r

template<class T >
const math::vec2<T> color::rgb_color_space< T >::r

CIE xy chromaticity coordinates of the red primary.

Definition at line 75 of file rgb.hpp.

◆ to_xyz

template<class T >
const math::mat3<T> color::rgb_color_space< T >::to_xyz

Matrix which transforms an RGB color to a CIE XYZ color.

Definition at line 93 of file rgb.hpp.

◆ to_y

template<class T >
const math::vec3<T> color::rgb_color_space< T >::to_y

Vector which gives the luminance of an RGB color via dot product.

Definition at line 99 of file rgb.hpp.

◆ w

template<class T >
const math::vec2<T> color::rgb_color_space< T >::w

CIE xy chromaticity coordinates of the white point.

Definition at line 84 of file rgb.hpp.


The documentation for this struct was generated from the following file: