Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
spectral_samples.h
Go to the documentation of this file.
1#pragma once
2
5
6#include <Common/assertion.h>
7
8#include <utility>
9#include <cstddef>
10
11namespace ph::math
12{
13
17template<typename T, CSpectralSampleProps SampleProps>
18constexpr T wavelength_interval_of() noexcept;
19
23template<typename T, CSpectralSampleProps SampleProps>
24constexpr std::pair<T, T> wavelength_range_of(std::size_t sampleIndex) noexcept;
25
26template<typename T, CSpectralSampleProps SampleProps = DefaultSpectralSampleProps>
27T estimate_samples_energy(const TSpectralSampleValues<T, SampleProps>& srcSamples);
28
33template<typename T, CSpectralSampleProps SampleProps = DefaultSpectralSampleProps>
34TSpectralSampleValues<T, SampleProps> normalize_samples_energy(const TSpectralSampleValues<T, SampleProps>& srcSamples);
35
36template<typename T, CSpectralSampleProps SampleProps = DefaultSpectralSampleProps>
38
39template<typename T, typename U, CSpectralSampleProps SampleProps = DefaultSpectralSampleProps>
41 const U* wavelengthsNM,
42 const U* values,
43 std::size_t numPoints,
45
52
54template<typename T, CSpectralSampleProps SampleProps = DefaultSpectralSampleProps>
56
59template<typename T, CSpectralSampleProps SampleProps = DefaultSpectralSampleProps>
62
65template<typename T, CSpectralSampleProps SampleProps = DefaultSpectralSampleProps>
66TSpectralSampleValues<T, SampleProps> resample_black_body(T temperatureK);
67
71template<typename T, CSpectralSampleProps SampleProps = DefaultSpectralSampleProps>
72TSpectralSampleValues<T, SampleProps> resample_black_body_radiance(T temperatureK);
73
80template<typename T, CSpectralSampleProps SampleProps = DefaultSpectralSampleProps>
82
88template<typename T, CSpectralSampleProps SampleProps = DefaultSpectralSampleProps, EReferenceWhite NORMALIZER = EReferenceWhite::D65>
89TTristimulusValues<T> spectral_samples_to_CIE_XYZ(const TSpectralSampleValues<T, SampleProps>& srcSamples, EColorUsage usage);
90
91}// end namespace ph::math
92
93#include "Math/Color/spectral_samples.ipp"
if constexpr(IS_ROBUST)
Definition TBvhSimdComputingContext.h:561
Math functions and utilities.
Definition TransformInfo.h:10
constexpr TSpectralSampleValues< T, SampleProps > constant_spectral_samples(T constant)
Definition spectral_samples.ipp:60
TRawColorValues< T, SampleProps::NUM_SAMPLES > TSpectralSampleValues
Definition color_basics.h:54
TSpectralSampleValues< T, SampleProps > resample_illuminant_E()
SPD of standard illuminants. Any light source which statistically has the same relative SPD as a stan...
Definition spectral_samples.ipp:120
TSpectralSampleValues< T, SampleProps > normalize_samples_energy(const TSpectralSampleValues< T, SampleProps > &srcSamples)
Normalize spectral samples as if they carry energy. Normalized spectral samples, together,...
Definition spectral_samples.ipp:46
TTristimulusValues< T > spectral_samples_to_CIE_XYZ(const TSpectralSampleValues< T, SampleProps > &srcSamples, EColorUsage usage)
Converting spectral samples to CIE-XYZ using standard CMFs.
Definition spectral_samples.ipp:270
ESpectralResample
Definition color_enums.h:161
EColorUsage
Definition color_enums.h:140
TSpectralSampleValues< T, SampleProps > resample_spectral_samples(const U *wavelengthsNM, const U *values, std::size_t numPoints, ESpectralResample algorithm=ESpectralResample::Default)
Definition spectral_samples.ipp:68
TRawColorValues< T, 3 > TTristimulusValues
Definition color_basics.h:48
TSpectralSampleValues< T, SampleProps > resample_black_body_radiance(T temperatureK)
SPD of black-body radiation in radiance. If a normalized energy distribution is desired,...
Definition spectral_samples.ipp:150
T estimate_samples_energy(const TSpectralSampleValues< T, SampleProps > &srcSamples)
Definition spectral_samples.ipp:39
TSpectralSampleValues< T, SampleProps > resample_black_body_spectral_radiance(T temperatureK)
SPD of black-body radiation in spectral radiance. Note that this function is not returning radiance b...
Definition spectral_samples.ipp:170
TSpectralSampleValues< T, SampleProps > resample_illuminant_D65()
SPD of standard illuminants D65, with total energy = 1.
Definition spectral_samples.ipp:129
EReferenceWhite
Definition color_enums.h:49
constexpr std::pair< T, T > wavelength_range_of(std::size_t sampleIndex) noexcept
Definition spectral_samples.ipp:26
constexpr T wavelength_interval_of() noexcept
Definition spectral_samples.ipp:19
TSpectralSampleValues< T, SampleProps > resample_black_body(T temperatureK)
SPD of black-body radiation, with total energy = 1.
Definition spectral_samples.ipp:140
Definition TAABB2D.h:96