Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
color_spaces.h File Reference
#include "Math/Color/color_enums.h"
#include "Math/Color/color_basics.h"
#include <concepts>
#include <type_traits>
#include "Math/Color/color_spaces.ipp"

Go to the source code of this file.

Classes

class  ph::math::TColorSpaceDefinition< COLOR_SPACE, T >
 Sinkhole for color spaces without definition. Specialize this class to provide definitions for color space. Must satisfy CTristimulusColorSpaceDefinition or CSpectralColorSpaceDefinition. More...
 

Namespaces

namespace  ph
 The root for all renderer implementations.
 
namespace  ph::math
 Math functions and utilities.
 

Concepts

concept  ph::math::CHasColorSpaceProperties
 Basic requirements for a color space definition.
 
concept  ph::math::CSupportsTristimulusConversions
 Basic requirements a tristimulus color space definition must satisfy in addition to CHasColorSpaceProperties.
 
concept  ph::math::CSupportsSpectralConversions
 Basic requirements a spectral color space definition must satisfy in addition to CHasColorSpaceProperties. Bound tristimulus color space: A spectral color space must choose a tristimulus color space as its binding space, which will be used by color space operations that cannot operate in the spectral space. The chosen color space is often referred to as "bound space" for simplicity.
 
concept  ph::math::CTristimulusColorSpaceDefinition
 
concept  ph::math::CSpectralColorSpaceDefinition
 
concept  ph::math::CColorSpaceDefinition
 

Typedefs

template<EColorSpace COLOR_SPACE>
using ph::math::TColorSpaceDef = TColorSpaceDefinition<COLOR_SPACE, ColorValue>
 Helper alias for TColorSpaceDefinition which uses the ColorValue type.
 

Functions

bool ph::math::is_tristimulus (EColorSpace colorSpace)
 Check whether colorSpace is a tristimulus color space. This is a runtime check. For compile-time check, use TColorSpaceDef<?>::isTristimulus().
 
template<typename InColorValuesType , EColorSpace COLOR_SPACE>
constexpr bool ph::math::is_compatible ()
 Check whether InColorValuesType is suitable to represent values in COLOR_SPACE.
 
template<EColorSpace SRC_COLOR_SPACE, EColorSpace DST_COLOR_SPACE, typename T , EChromaticAdaptation ALGORITHM = EChromaticAdaptation::Default>
auto ph::math::transform_color (const auto &srcColorValues, EColorUsage usage)
 
template<EColorSpace SRC_COLOR_SPACE, typename T , EChromaticAdaptation ALGORITHM = EChromaticAdaptation::Default>
ph::math::relative_luminance (const auto &srcColorValues, EColorUsage usage=EColorUsage::EMR)
 
template<EColorSpace SRC_COLOR_SPACE, typename T , EColorSpace SPECTRAL_COLOR_SPACE = EColorSpace::Spectral, EChromaticAdaptation ALGORITHM = EChromaticAdaptation::Default>
ph::math::estimate_color_energy (const auto &srcColorValues)
 
template<EColorSpace SRC_COLOR_SPACE, typename T , EColorSpace SPECTRAL_COLOR_SPACE = EColorSpace::Spectral, EChromaticAdaptation ALGORITHM = EChromaticAdaptation::Default>
auto ph::math::normalize_color_energy (const auto &srcColorValues)
 
template<EColorSpace SRC_COLOR_SPACE, typename T , EColorSpace SPECTRAL_COLOR_SPACE = EColorSpace::Spectral, EChromaticAdaptation ALGORITHM = EChromaticAdaptation::Default>
auto ph::math::put_color_energy (const auto &srcColorValues, T energyLevel)
 
template<typename T >
TTristimulusValues< T > ph::math::sRGB_nonlinear_to_linear (const TTristimulusValues< T > &nonlinearSRGB)
 Helper for converting from sRGB to linear-sRGB.
 
template<typename T >
TTristimulusValues< T > ph::math::sRGB_linear_to_nonlinear (const TTristimulusValues< T > &linearSRGB)
 Helper for converting from linear-sRGB to sRGB.
 
template<EColorSpace DST_COLOR_SPACE, typename T >
auto ph::math::transform_from_sRGB (const TTristimulusValues< T > &nonlinearSRGB, EColorUsage usage)
 Helper for converting from sRGB to any color space.
 
template<EColorSpace DST_COLOR_SPACE, typename T >
auto ph::math::transform_from_linear_sRGB (const TTristimulusValues< T > &linearSRGB, EColorUsage usage)
 Helper for converting from linear-sRGB to any color space.
 
template<EColorSpace SRC_COLOR_SPACE, typename T >
TTristimulusValues< T > ph::math::transform_to_sRGB (const auto &srcColorValues, EColorUsage usage)
 Helper for converting any color space to sRGB.
 
template<EColorSpace SRC_COLOR_SPACE, typename T >
TTristimulusValues< T > ph::math::transform_to_linear_sRGB (const auto &srcColorValues, EColorUsage usage)
 Helper for converting any color space to linear-sRGB.