Skip to content

Commit 964c5a9

Browse files
authored
Fix compilation when spectral support is disabled
1 parent 229d8ea commit 964c5a9

File tree

1 file changed

+28
-7
lines changed

1 file changed

+28
-7
lines changed

src/appleseed/renderer/utility/rgbspectrum.h

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,20 @@ class RGBSpectrum
134134
const ValueType& operator[](const size_t i) const;
135135

136136
// Convert the spectrum to a linear RGB color.
137-
foundation::Color<ValueType, 3> to_rgb(
138-
const foundation::LightingConditions& lighting_conditions) const;
137+
foundation::Color<ValueType, 3> reflectance_to_rgb(
138+
const foundation::LightingConditions& lighting_conditions) const;
139+
140+
// Use in emissive samples.
141+
foundation::Color<ValueType, 3> illuminance_to_rgb(
142+
const foundation::LightingConditions& lighting_conditions) const;
139143

140144
// Convert the spectrum to a CIE XYZ color.
141-
foundation::Color<ValueType, 3> to_ciexyz(
142-
const foundation::LightingConditions& lighting_conditions) const;
145+
foundation::Color<ValueType, 3> reflectance_to_ciexyz(
146+
const foundation::LightingConditions& lighting_conditions) const;
147+
148+
// Use in emissive samples.
149+
foundation::Color<ValueType, 3> illuminance_to_ciexyz(
150+
const foundation::LightingConditions& lighting_conditions) const;
143151

144152
private:
145153
APPLESEED_SIMD4_ALIGN ValueType m_samples[StoredSamples];
@@ -400,7 +408,7 @@ void RGBSpectrum<T>::set(
400408
{
401409
reinterpret_cast<foundation::Color<T, 3>&>(m_samples[0]) =
402410
foundation::ciexyz_to_linear_rgb(
403-
foundation::spectral_illuminance_to_ciexyz<T>(spectrum));
411+
foundation::spectral_illuminance_to_ciexyz<T>(lighting_conditions, spectrum));
404412
}
405413
}
406414

@@ -419,21 +427,34 @@ inline const T& RGBSpectrum<T>::operator[](const size_t i) const
419427
}
420428

421429
template <typename T>
422-
inline foundation::Color<T, 3> RGBSpectrum<T>::to_rgb(
430+
inline foundation::Color<T, 3> RGBSpectrum<T>::reflectance_to_rgb(
423431
const foundation::LightingConditions& lighting_conditions) const
424432
{
425433
return foundation::Color<T, 3>(m_samples[0], m_samples[1], m_samples[2]);
426434
}
427435

436+
template<typename T>
437+
inline foundation::Color<T, 3> RGBSpectrum<T>::illuminance_to_rgb(const foundation::LightingConditions& lighting_conditions) const
438+
{
439+
return reflectance_to_rgb(lighting_conditions);
440+
}
441+
428442
template <typename T>
429-
inline foundation::Color<T, 3> RGBSpectrum<T>::to_ciexyz(
443+
inline foundation::Color<T, 3> RGBSpectrum<T>::reflectance_to_ciexyz(
430444
const foundation::LightingConditions& lighting_conditions) const
431445
{
432446
return
433447
linear_rgb_to_ciexyz(
434448
foundation::Color<T, 3>(m_samples[0], m_samples[1], m_samples[2]));
435449
}
436450

451+
template <typename T>
452+
inline foundation::Color<T, 3> RGBSpectrum<T>::illuminance_to_ciexyz(
453+
const foundation::LightingConditions& lighting_conditions) const
454+
{
455+
return reflectance_to_ciexyz(lighting_conditions);
456+
}
457+
437458
template <typename T>
438459
inline bool operator!=(const RGBSpectrum<T>& lhs, const RGBSpectrum<T>& rhs)
439460
{

0 commit comments

Comments
 (0)