Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
ph::math::detail Namespace Reference

Namespaces

namespace  bvh
 
namespace  shuffle
 

Classes

class  Pcg64UInt128
 
struct  TCIEXYZCmfKernel
 
class  TColorSpaceDummy
 
struct  TSmitsSPDBasis
 

Typedefs

template<typename ColorValuesType >
using TColorValuesElementType = decltype(get_any_element_from_color_values(std::declval<ColorValuesType>()))
 

Functions

template<typename T >
auto make_chromaticity_table () -> std::array< TChromaticityValues< T >, static_cast< std::size_t >(EReferenceWhite::NUM)>
 
template<typename ColorValuesType >
constexpr auto get_any_element_from_color_values (const ColorValuesType &colorValues)
 
template<typename T >
TVector2< T > octahedron_diamond_mirror (const TVector2< T > &point)
 

Typedef Documentation

◆ TColorValuesElementType

template<typename ColorValuesType >
using ph::math::detail::TColorValuesElementType = decltype(get_any_element_from_color_values(std::declval<ColorValuesType>()))

Function Documentation

◆ get_any_element_from_color_values()

template<typename ColorValuesType >
auto ph::math::detail::get_any_element_from_color_values ( const ColorValuesType & colorValues)
inlineconstexpr

◆ make_chromaticity_table()

template<typename T >
auto ph::math::detail::make_chromaticity_table ( ) -> std::array<TChromaticityValues<T>, static_cast<std::size_t>(EReferenceWhite::NUM)>
inline

Values are for 2-degree standard observer.

References: [1] https://en.wikipedia.org/wiki/Standard_illuminant

The source code of Colour python library: [2] https://github.com/colour-science/colour/blob/v0.3.16/colour/colorimetry/datasets/illuminants/chromaticity_coordinates.py

Note
The values listed on Bruce's website (http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html) are for 10-degree standard observer. Those values can NOT be used here as we need 2-degree standard observer here.

◆ octahedron_diamond_mirror()

template<typename T >
TVector2< T > ph::math::detail::octahedron_diamond_mirror ( const TVector2< T > & point)
inline

Consider an unwrapped octahedron (onto a square in [-1, 1]), with upper faces form a diamond shape in the middle, and the lower faces fill the remaining triangular areas. The function will map points in a triangle to the other triangle in the same quadrant, mirrored along their common edge.

[1] https://knarkowicz.wordpress.com/2014/04/16/octahedron-normal-vector-encoding/ [2] A Survey of Efficient Representations for Independent Unit Vectors https://jcgt.org/published/0003/02/01/paper.pdf (see supplemental materials for C++ reference implmentation)