Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
TSampledSpectrum.h
Go to the documentation of this file.
1#pragma once
2
5
6#include <cstddef>
7
8namespace ph::math
9{
10
11template<EColorSpace COLOR_SPACE, typename T, CSpectralSampleProps Props>
12class TSampledSpectrum final :
13 public TSpectrumBase<TSampledSpectrum<COLOR_SPACE, T, Props>, COLOR_SPACE, T, Props::NUM_SAMPLES>
14{
15private:
16 using Base = TSpectrumBase<TSampledSpectrum<COLOR_SPACE, T, Props>, COLOR_SPACE, T, Props::NUM_SAMPLES>;
17
18protected:
19 using Base::m;
20
21public:
22 inline TSampledSpectrum() = default;
23 inline TSampledSpectrum(const TSampledSpectrum& other) = default;
24 inline TSampledSpectrum(TSampledSpectrum&& other) = default;
25 inline TSampledSpectrum& operator = (const TSampledSpectrum& rhs) = default;
27 inline ~TSampledSpectrum() = default;
28
29 using Base::Base;
30
31 template<typename U>
33
34 static consteval std::size_t numSamples() noexcept;
35 static consteval std::size_t minWavelengthNM() noexcept;
36 static consteval std::size_t maxWavelengthNM() noexcept;
37 static constexpr T sampleInterval() noexcept;
38 static constexpr std::pair<T, T> wavelengthRangeOf(std::size_t sampleIndex) noexcept;
39
40 template<typename U>
42 const U* wavelengthsNM,
43 const U* values,
44 std::size_t numPoints);
45};
46
47}// end namespace ph::math
48
49#include "Math/Color/TSampledSpectrum.ipp"
if constexpr(IS_ROBUST)
Definition TBvhSimdComputingContext.h:561
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
TSampledSpectrum(TSampledSpectrum &&other)=default
static TSampledSpectrum makeResampled(const U *wavelengthsNM, const U *values, std::size_t numPoints)
static constexpr T sampleInterval() noexcept
Definition TSampledSpectrum.ipp:39
TSampledSpectrum & operator=(const TSampledSpectrum &rhs)=default
TSampledSpectrum(const TSampledSpectrum &other)=default
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
Base for spectrum implementations.
Definition TSpectrumBase.h:28
Math functions and utilities.
Definition TransformInfo.h:10
Definition TAABB2D.h:96