Skip to content

Commit

Permalink
Fix compilation when spectral support is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
mororo250 authored Jun 22, 2020
1 parent 229d8ea commit 964c5a9
Showing 1 changed file with 28 additions and 7 deletions.
35 changes: 28 additions & 7 deletions src/appleseed/renderer/utility/rgbspectrum.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,20 @@ class RGBSpectrum
const ValueType& operator[](const size_t i) const;

// Convert the spectrum to a linear RGB color.
foundation::Color<ValueType, 3> to_rgb(
const foundation::LightingConditions& lighting_conditions) const;
foundation::Color<ValueType, 3> reflectance_to_rgb(
const foundation::LightingConditions& lighting_conditions) const;

// Use in emissive samples.
foundation::Color<ValueType, 3> illuminance_to_rgb(
const foundation::LightingConditions& lighting_conditions) const;

// Convert the spectrum to a CIE XYZ color.
foundation::Color<ValueType, 3> to_ciexyz(
const foundation::LightingConditions& lighting_conditions) const;
foundation::Color<ValueType, 3> reflectance_to_ciexyz(
const foundation::LightingConditions& lighting_conditions) const;

// Use in emissive samples.
foundation::Color<ValueType, 3> illuminance_to_ciexyz(
const foundation::LightingConditions& lighting_conditions) const;

private:
APPLESEED_SIMD4_ALIGN ValueType m_samples[StoredSamples];
Expand Down Expand Up @@ -400,7 +408,7 @@ void RGBSpectrum<T>::set(
{
reinterpret_cast<foundation::Color<T, 3>&>(m_samples[0]) =
foundation::ciexyz_to_linear_rgb(
foundation::spectral_illuminance_to_ciexyz<T>(spectrum));
foundation::spectral_illuminance_to_ciexyz<T>(lighting_conditions, spectrum));
}
}

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

template <typename T>
inline foundation::Color<T, 3> RGBSpectrum<T>::to_rgb(
inline foundation::Color<T, 3> RGBSpectrum<T>::reflectance_to_rgb(
const foundation::LightingConditions& lighting_conditions) const
{
return foundation::Color<T, 3>(m_samples[0], m_samples[1], m_samples[2]);
}

template<typename T>
inline foundation::Color<T, 3> RGBSpectrum<T>::illuminance_to_rgb(const foundation::LightingConditions& lighting_conditions) const
{
return reflectance_to_rgb(lighting_conditions);
}

template <typename T>
inline foundation::Color<T, 3> RGBSpectrum<T>::to_ciexyz(
inline foundation::Color<T, 3> RGBSpectrum<T>::reflectance_to_ciexyz(
const foundation::LightingConditions& lighting_conditions) const
{
return
linear_rgb_to_ciexyz(
foundation::Color<T, 3>(m_samples[0], m_samples[1], m_samples[2]));
}

template <typename T>
inline foundation::Color<T, 3> RGBSpectrum<T>::illuminance_to_ciexyz(
const foundation::LightingConditions& lighting_conditions) const
{
return reflectance_to_ciexyz(lighting_conditions);
}

template <typename T>
inline bool operator!=(const RGBSpectrum<T>& lhs, const RGBSpectrum<T>& rhs)
{
Expand Down

0 comments on commit 964c5a9

Please sign in to comment.