Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
TSampledSpectrum.ipp
Go to the documentation of this file.
1#pragma once
2
5
6#include <Common/assertion.h>
7#include <Common/config.h>
8
9#include <type_traits>
10
11namespace ph::math
12{
13
14template<EColorSpace COLOR_SPACE, typename T, CSpectralSampleProps Props>
15template<typename U>
19
20template<EColorSpace COLOR_SPACE, typename T, CSpectralSampleProps Props>
21inline consteval std::size_t TSampledSpectrum<COLOR_SPACE, T, Props>::numSamples() noexcept
22{
23 return Props::NUM_SAMPLES;
24}
25
26template<EColorSpace COLOR_SPACE, typename T, CSpectralSampleProps Props>
27inline consteval std::size_t TSampledSpectrum<COLOR_SPACE, T, Props>::minWavelengthNM() noexcept
28{
29 return Props::MIN_WAVELENGTH_NM;
30}
31
32template<EColorSpace COLOR_SPACE, typename T, CSpectralSampleProps Props>
33inline consteval std::size_t TSampledSpectrum<COLOR_SPACE, T, Props>::maxWavelengthNM() noexcept
34{
35 return Props::MAX_WAVELENGTH_NM;
36}
37
38template<EColorSpace COLOR_SPACE, typename T, CSpectralSampleProps Props>
40-> T
41{
43}
44
45template<EColorSpace COLOR_SPACE, typename T, CSpectralSampleProps Props>
46inline constexpr auto TSampledSpectrum<COLOR_SPACE, T, Props>::wavelengthRangeOf(const std::size_t sampleIndex) noexcept
47-> std::pair<T, T>
48{
49 return wavelength_range_of<T, Props>(sampleIndex);
50}
51
52template<EColorSpace COLOR_SPACE, typename T, CSpectralSampleProps Props>
53template<typename U>
55 const U* const wavelengthsNM,
56 const U* const values,
57 const std::size_t numPoints)
59{
62 wavelengthsNM, values, numPoints));
63}
64
65}// end namespace ph::math
Definition TSampledSpectrum.h:14
static consteval std::size_t minWavelengthNM() noexcept
Definition TSampledSpectrum.ipp:27
static consteval std::size_t numSamples() noexcept
Definition TSampledSpectrum.ipp:21
static TSampledSpectrum makeResampled(const U *wavelengthsNM, const U *values, std::size_t numPoints)
static constexpr T sampleInterval() noexcept
Definition TSampledSpectrum.ipp:39
static constexpr std::pair< T, T > wavelengthRangeOf(std::size_t sampleIndex) noexcept
Definition TSampledSpectrum.ipp:46
static consteval std::size_t maxWavelengthNM() noexcept
Definition TSampledSpectrum.ipp:33
Derived & setColorValues(const TRawColorValues< T, N > &values)
Set and get raw color values directly.
Definition TSpectrumBase.ipp:46
Math functions and utilities.
Definition TransformInfo.h:10
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
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