Beispiel #1
0
 inline RgbSpectrum operator/(float a, const RgbSpectrum& s) {
   return RgbSpectrum(a / s.rgb);
 }
Beispiel #2
0
 inline RgbSpectrum operator/(const RgbSpectrum& s1, const RgbSpectrum& s2) {
   return RgbSpectrum(s1.rgb / s2.rgb);
 }
Beispiel #3
0
 inline RgbSpectrum operator/(const RgbSpectrum& s, float a) {
   return RgbSpectrum(s.rgb / a);
 }
Beispiel #4
0
 static RgbSpectrum from_rgb(float r, float g, float b) {
   return RgbSpectrum(r, g, b);
 }
Beispiel #5
0
 RgbSpectrum clamp() const
 {
     return RgbSpectrum(std::max(0.f, x()), std::max(0.f, y()), std::max(0.f, z()));
 }
Beispiel #6
0
 static RgbSpectrum to_rgb(PixelRgbFloat pix) {
   return RgbSpectrum(pix.r, pix.g, pix.b);
 }
Beispiel #7
0
 static RgbSpectrum to_rgb(PixelRgb8 pix) {
   auto map = [](uint8_t chan) {
     return mul_power_of_two(float(chan), -8);
   };
   return RgbSpectrum(map(pix.r), map(pix.g), map(pix.b));
 }