|
| TSampledSpectrum ()=default |
|
| TSampledSpectrum (const TSampledSpectrum &other)=default |
|
| TSampledSpectrum (TSampledSpectrum &&other)=default |
|
TSampledSpectrum & | operator= (const TSampledSpectrum &rhs)=default |
|
TSampledSpectrum & | operator= (TSampledSpectrum &&rhs)=default |
|
| ~TSampledSpectrum ()=default |
|
template<typename U > |
| TSampledSpectrum (const TSampledSpectrum< COLOR_SPACE, U, Props > &other) |
|
template<typename U > |
auto | makeResampled (const U *const wavelengthsNM, const U *const values, const std::size_t numPoints) -> TSampledSpectrum |
|
| TSpectrumBase (const TRawColorValues< U, N > &values) |
| Set color values directly. Calling setColorValues() has the same effect. This is the most general form that allows type conversion. Basically, all other overloads with value inputs is equivalent to calling setColorValues() , too (unless otherwise noted).
|
|
std::size_t | minComponent () const |
|
std::size_t | maxComponent () const |
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | setTransformed (const auto &srcColorValues, EColorUsage usage) |
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | setTransformed (const ImplType &srcColorValues, EColorUsage usage) |
|
auto | setTransformed (const auto &srcColorValues, const EColorUsage usage) -> TSampledSpectrum< COLOR_SPACE, T, Props > & |
|
auto | setTransformed (const ImplType &srcColorValues, const EColorUsage usage) -> TSampledSpectrum< COLOR_SPACE, T, Props > & |
|
auto | toTransformed (EColorUsage usage) const |
|
void | transformFrom (const auto &srcColorValues, EColorSpace srcColorSpace, EColorUsage usage) |
|
void | transformTo (auto *out_dstColorValues, EColorSpace dstColorSpace, EColorUsage usage) const |
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | setSpectral (const TSpectralSampleValues< T > &sampleValues, EColorUsage usage) |
| Helper for setting spectral values to this spectrum.
|
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | setSpectral (const ImplType &sampleValues, EColorUsage usage) |
| Helper for setting spectral values to this spectrum.
|
|
auto | setSpectral (const TSpectralSampleValues< T > &sampleValues, const EColorUsage usage) -> TSampledSpectrum< COLOR_SPACE, T, Props > & |
|
auto | setSpectral (const ImplType &sampleValues, const EColorUsage usage) -> TSampledSpectrum< COLOR_SPACE, T, Props > & |
|
TSpectralSampleValues< T > | toSpectral (EColorUsage usage) const |
| Helper for getting spectral values from this spectrum.
|
|
T | relativeLuminance (EColorUsage usage=EColorUsage::EMR) const |
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | setLinearSRGB (const TRawColorValues< T, 3 > &linearSRGB, EColorUsage usage) |
| Helper for setting linear-sRGB color to this spectrum.
|
|
TRawColorValues< T, 3 > | toLinearSRGB (EColorUsage usage) const |
| Helper for converting this spectrum to linear-sRGB color.
|
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | putEnergy (T energyLevel) |
|
TSampledSpectrum< COLOR_SPACE, T, Props > | add (const TSampledSpectrum< COLOR_SPACE, T, Props > &rhs) const |
|
TSampledSpectrum< COLOR_SPACE, T, Props > | add (T rhs) const |
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | addLocal (const TSampledSpectrum< COLOR_SPACE, T, Props > &rhs) |
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | addLocal (T rhs) |
|
TSampledSpectrum< COLOR_SPACE, T, Props > | sub (const TSampledSpectrum< COLOR_SPACE, T, Props > &rhs) const |
|
TSampledSpectrum< COLOR_SPACE, T, Props > | sub (T rhs) const |
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | subLocal (const TSampledSpectrum< COLOR_SPACE, T, Props > &rhs) |
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | subLocal (T rhs) |
|
TSampledSpectrum< COLOR_SPACE, T, Props > | mul (const TSampledSpectrum< COLOR_SPACE, T, Props > &rhs) const |
|
TSampledSpectrum< COLOR_SPACE, T, Props > | mul (T rhs) const |
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | mulLocal (const TSampledSpectrum< COLOR_SPACE, T, Props > &rhs) |
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | mulLocal (T rhs) |
|
TSampledSpectrum< COLOR_SPACE, T, Props > | div (const TSampledSpectrum< COLOR_SPACE, T, Props > &rhs) const |
|
TSampledSpectrum< COLOR_SPACE, T, Props > | div (T rhs) const |
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | divLocal (const TSampledSpectrum< COLOR_SPACE, T, Props > &rhs) |
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | divLocal (T rhs) |
|
TSampledSpectrum< COLOR_SPACE, T, Props > | pow (U exponent) const |
|
TSampledSpectrum< COLOR_SPACE, T, Props > | pow (const TSampledSpectrum< COLOR_SPACE, T, Props > &exponent) const |
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | powLocal (U exponent) |
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | powLocal (const TSampledSpectrum< COLOR_SPACE, T, Props > &exponent) |
|
TSampledSpectrum< COLOR_SPACE, T, Props > | exp (U exponent) const |
| Sets the array to \( e^exponent \).
|
|
TSampledSpectrum< COLOR_SPACE, T, Props > | exp (const TSampledSpectrum< COLOR_SPACE, T, Props > &exponent) const |
| Sets the array to \( e^{exponent_i} \).
|
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | expLocal (U exponent) |
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | expLocal (const TSampledSpectrum< COLOR_SPACE, T, Props > &exponent) |
|
TSampledSpectrum< COLOR_SPACE, T, Props > | sqrt () const |
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | sqrtLocal () |
|
TSampledSpectrum< COLOR_SPACE, T, Props > | clamp (T lowerBound, T upperBound) const |
| Clamps current array's elements to specific range. None of value , lowerBound and upperBound can be NaN, or the method's behavior is undefined.
|
|
TSampledSpectrum< COLOR_SPACE, T, Props > | clamp (const TSampledSpectrum< COLOR_SPACE, T, Props > &lowerBound, const TSampledSpectrum< COLOR_SPACE, T, Props > &upperBound) const |
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | clampLocal (T lowerBound, T upperBound) |
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | clampLocal (const TSampledSpectrum< COLOR_SPACE, T, Props > &lowerBound, const TSampledSpectrum< COLOR_SPACE, T, Props > &upperBound) |
|
TSampledSpectrum< COLOR_SPACE, T, Props > | safeClamp (T lowerBound, T upperBound) const |
| Clamps current array's elements to specific range. If a floating-point value is non-finite (e.g., being Inf, NaN), its value is clamped to lowerBound . Neither lowerBound nor upperBound can be NaN, or the method's behavior is undefined.
|
|
TSampledSpectrum< COLOR_SPACE, T, Props > | safeClamp (const TSampledSpectrum< COLOR_SPACE, T, Props > &lowerBound, const TSampledSpectrum< COLOR_SPACE, T, Props > &upperBound) const |
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | safeClampLocal (T lowerBound, T upperBound) |
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | safeClampLocal (const TSampledSpectrum< COLOR_SPACE, T, Props > &lowerBound, const TSampledSpectrum< COLOR_SPACE, T, Props > &upperBound) |
|
TSampledSpectrum< COLOR_SPACE, T, Props > | abs () const |
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | absLocal () |
|
TSampledSpectrum< COLOR_SPACE, T, Props > | rcp () const |
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | rcpLocal () |
|
TSampledSpectrum< COLOR_SPACE, T, Props > | complement () const |
| Complements the array's elements. Effectively performing 1 - (*this)[i] for each element.
|
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | complementLocal () |
|
TSampledSpectrum< COLOR_SPACE, T, Props > | negate () const |
| Applies a negative sign to the array's elements. These methods is only defined for signed element types.
|
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | negateLocal () |
|
T | sum () const |
|
T | avg () const |
|
T | min () const |
|
TSampledSpectrum< COLOR_SPACE, T, Props > | min (const TSampledSpectrum< COLOR_SPACE, T, Props > &other) const |
|
T | max () const |
|
TSampledSpectrum< COLOR_SPACE, T, Props > | max (const TSampledSpectrum< COLOR_SPACE, T, Props > &other) const |
|
TSampledSpectrum< COLOR_SPACE, T, Props > | ceil () const |
|
TSampledSpectrum< COLOR_SPACE, T, Props > | floor () const |
|
T | product () const |
|
TSampledSpectrum< COLOR_SPACE, T, Props > | lerp (const TSampledSpectrum< COLOR_SPACE, T, Props > &rhs, U factor) const |
|
bool | isZero () const |
|
bool | isNonNegative () const |
|
bool | isFinite () const |
|
auto | begin () noexcept -> typename std::array< T, N >::iterator |
|
auto | begin () const noexcept -> typename std::array< T, N >::const_iterator |
|
auto | end () noexcept -> typename std::array< T, N >::iterator |
|
auto | end () const noexcept -> typename std::array< T, N >::const_iterator |
|
bool | isEqual (const TSampledSpectrum< COLOR_SPACE, T, Props > &other) const |
|
bool | isNear (const TSampledSpectrum< COLOR_SPACE, T, Props > &other, T margin) const |
|
std::string | toString () const |
|
std::vector< T > | toVector () const |
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | setColorValues (const TRawColorValues< T, N > &values) |
| Set and get raw color values directly.
|
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | setColorValues (T rawColorValue) |
|
const TRawColorValues< T, N > & | getColorValues () const |
|
| TArithmeticArrayBase (T value) |
|
| TArithmeticArrayBase (Elements values) |
|
auto | pow (const U exponent) const -> TSampledSpectrum< COLOR_SPACE, T, Props > |
|
auto | powLocal (const U exponent) -> TSampledSpectrum< COLOR_SPACE, T, Props > & |
|
auto | exp (const U exponent) const -> TSampledSpectrum< COLOR_SPACE, T, Props > |
|
auto | expLocal (const U exponent) -> TSampledSpectrum< COLOR_SPACE, T, Props > & |
|
auto | lerp (const TSampledSpectrum< COLOR_SPACE, T, Props > &rhs, const U factor) const -> TSampledSpectrum< COLOR_SPACE, T, Props > |
|
|
using | Elements |
|
static constexpr auto | NUM_VALUES |
|
| PH_DEFINE_INLINE_RULE_OF_5_MEMBERS (TSpectrumBase) |
|
| PH_DEFINE_INLINE_RULE_OF_5_MEMBERS (TArithmeticArrayBase) |
|
constexpr std::size_t | size () const noexcept |
| Number of elements of the array.
|
|
TSampledSpectrum< COLOR_SPACE, T, Props > | add (const TSampledSpectrum< COLOR_SPACE, T, Props > &rhs) const |
|
TSampledSpectrum< COLOR_SPACE, T, Props > | add (T rhs) const |
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | addLocal (const TSampledSpectrum< COLOR_SPACE, T, Props > &rhs) |
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | addLocal (T rhs) |
|
TSampledSpectrum< COLOR_SPACE, T, Props > | sub (const TSampledSpectrum< COLOR_SPACE, T, Props > &rhs) const |
|
TSampledSpectrum< COLOR_SPACE, T, Props > | sub (T rhs) const |
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | subLocal (const TSampledSpectrum< COLOR_SPACE, T, Props > &rhs) |
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | subLocal (T rhs) |
|
TSampledSpectrum< COLOR_SPACE, T, Props > | mul (const TSampledSpectrum< COLOR_SPACE, T, Props > &rhs) const |
|
TSampledSpectrum< COLOR_SPACE, T, Props > | mul (T rhs) const |
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | mulLocal (const TSampledSpectrum< COLOR_SPACE, T, Props > &rhs) |
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | mulLocal (T rhs) |
|
TSampledSpectrum< COLOR_SPACE, T, Props > | div (const TSampledSpectrum< COLOR_SPACE, T, Props > &rhs) const |
|
TSampledSpectrum< COLOR_SPACE, T, Props > | div (T rhs) const |
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | divLocal (const TSampledSpectrum< COLOR_SPACE, T, Props > &rhs) |
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | divLocal (T rhs) |
|
TSampledSpectrum< COLOR_SPACE, T, Props > | pow (U exponent) const |
|
TSampledSpectrum< COLOR_SPACE, T, Props > | pow (const TSampledSpectrum< COLOR_SPACE, T, Props > &exponent) const |
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | powLocal (U exponent) |
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | powLocal (const TSampledSpectrum< COLOR_SPACE, T, Props > &exponent) |
|
TSampledSpectrum< COLOR_SPACE, T, Props > | sqrt () const |
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | sqrtLocal () |
|
TSampledSpectrum< COLOR_SPACE, T, Props > | abs () const |
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | absLocal () |
|
TSampledSpectrum< COLOR_SPACE, T, Props > | rcp () const |
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | rcpLocal () |
|
T | sum () const |
|
T | avg () const |
|
T | product () const |
|
T | min () const |
|
TSampledSpectrum< COLOR_SPACE, T, Props > | min (const TSampledSpectrum< COLOR_SPACE, T, Props > &other) const |
|
std::size_t | minIndex () const |
|
T | max () const |
|
TSampledSpectrum< COLOR_SPACE, T, Props > | max (const TSampledSpectrum< COLOR_SPACE, T, Props > &other) const |
|
std::size_t | maxIndex () const |
|
TSampledSpectrum< COLOR_SPACE, T, Props > | ceil () const |
|
TSampledSpectrum< COLOR_SPACE, T, Props > | floor () const |
|
TSampledSpectrum< COLOR_SPACE, T, Props > | lerp (const TSampledSpectrum< COLOR_SPACE, T, Props > &rhs, U factor) const |
|
bool | isZero () const |
|
bool | isNonNegative () const |
|
bool | isFinite () const |
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | set (T value) |
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | set (std::size_t index, T value) |
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | set (const std::array< T, N > &values) |
|
T & | operator[] (std::size_t index) |
|
const T & | operator[] (std::size_t index) const |
|
bool | isEqual (const TSampledSpectrum< COLOR_SPACE, T, Props > &other) const |
|
bool | isNear (const TSampledSpectrum< COLOR_SPACE, T, Props > &other, T margin) const |
|
bool | operator== (const TSampledSpectrum< COLOR_SPACE, T, Props > &other) const |
|
bool | operator!= (const TSampledSpectrum< COLOR_SPACE, T, Props > &other) const |
|
TSampledSpectrum< COLOR_SPACE, T, Props > | operator+ (const TSampledSpectrum< COLOR_SPACE, T, Props > &rhs) const |
|
TSampledSpectrum< COLOR_SPACE, T, Props > | operator+ (T rhs) const |
|
TSampledSpectrum< COLOR_SPACE, T, Props > | operator- (const TSampledSpectrum< COLOR_SPACE, T, Props > &rhs) const |
|
TSampledSpectrum< COLOR_SPACE, T, Props > | operator- (T rhs) const |
|
TSampledSpectrum< COLOR_SPACE, T, Props > | operator- () const |
|
TSampledSpectrum< COLOR_SPACE, T, Props > | operator* (const TSampledSpectrum< COLOR_SPACE, T, Props > &rhs) const |
|
TSampledSpectrum< COLOR_SPACE, T, Props > | operator* (T rhs) const |
|
TSampledSpectrum< COLOR_SPACE, T, Props > | operator/ (const TSampledSpectrum< COLOR_SPACE, T, Props > &rhs) const |
|
TSampledSpectrum< COLOR_SPACE, T, Props > | operator/ (T rhs) const |
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | operator+= (const TSampledSpectrum< COLOR_SPACE, T, Props > &rhs) |
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | operator+= (T rhs) |
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | operator-= (const TSampledSpectrum< COLOR_SPACE, T, Props > &rhs) |
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | operator-= (T rhs) |
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | operator*= (const TSampledSpectrum< COLOR_SPACE, T, Props > &rhs) |
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | operator*= (T rhs) |
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | operator/= (const TSampledSpectrum< COLOR_SPACE, T, Props > &rhs) |
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | operator/= (T rhs) |
|
auto | begin () noexcept -> typename std::array< T, N >::iterator |
|
auto | begin () const noexcept -> typename std::array< T, N >::const_iterator |
|
auto | end () noexcept -> typename std::array< T, N >::iterator |
|
auto | end () const noexcept -> typename std::array< T, N >::const_iterator |
|
std::string | toString () const |
|
std::vector< T > | toVector () const |
|
std::array< T, N > | toArray () const |
|
TSpan< T, N > | toSpan () |
|
TSpanView< T, N > | toView () const |
|
TSampledSpectrum< COLOR_SPACE, T, Props > | exp (U exponent) const |
| Sets the array to \( e^exponent \).
|
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | expLocal (U exponent) |
|
TSampledSpectrum< COLOR_SPACE, T, Props > | exp (const TSampledSpectrum< COLOR_SPACE, T, Props > &exponent) const |
| Sets the array to \( e^{exponent_i} \).
|
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | expLocal (const TSampledSpectrum< COLOR_SPACE, T, Props > &exponent) |
|
TSampledSpectrum< COLOR_SPACE, T, Props > | clamp (T lowerBound, T upperBound) const |
| Clamps current array's elements to specific range. None of value , lowerBound and upperBound can be NaN, or the method's behavior is undefined.
|
|
TSampledSpectrum< COLOR_SPACE, T, Props > | clamp (const TSampledSpectrum< COLOR_SPACE, T, Props > &lowerBound, const TSampledSpectrum< COLOR_SPACE, T, Props > &upperBound) const |
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | clampLocal (T lowerBound, T upperBound) |
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | clampLocal (const TSampledSpectrum< COLOR_SPACE, T, Props > &lowerBound, const TSampledSpectrum< COLOR_SPACE, T, Props > &upperBound) |
|
TSampledSpectrum< COLOR_SPACE, T, Props > | safeClamp (T lowerBound, T upperBound) const |
| Clamps current array's elements to specific range. If a floating-point value is non-finite (e.g., being Inf, NaN), its value is clamped to lowerBound . Neither lowerBound nor upperBound can be NaN, or the method's behavior is undefined.
|
|
TSampledSpectrum< COLOR_SPACE, T, Props > | safeClamp (const TSampledSpectrum< COLOR_SPACE, T, Props > &lowerBound, const TSampledSpectrum< COLOR_SPACE, T, Props > &upperBound) const |
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | safeClampLocal (T lowerBound, T upperBound) |
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | safeClampLocal (const TSampledSpectrum< COLOR_SPACE, T, Props > &lowerBound, const TSampledSpectrum< COLOR_SPACE, T, Props > &upperBound) |
|
TSampledSpectrum< COLOR_SPACE, T, Props > | complement () const |
| Complements the array's elements. Effectively performing 1 - (*this)[i] for each element.
|
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | complementLocal () |
|
TSampledSpectrum< COLOR_SPACE, T, Props > | negate () const |
| Applies a negative sign to the array's elements. These methods is only defined for signed element types.
|
|
TSampledSpectrum< COLOR_SPACE, T, Props > & | negateLocal () |
|
std::array< T, N > | m |
|
std::array< T, N > | m |
|
static constexpr auto | NUM_ELEMENTS |
|