From 2dd0c78719fde2d1b69fdbd61ddbda604b973b82 Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Sun, 4 May 2014 15:12:27 +0200 Subject: [PATCH] TSpectrum: added absolute value function --- include/mitsuba/core/spectrum.h | 8 ++++++++ src/libpython/core.cpp | 3 +++ 2 files changed, 11 insertions(+) diff --git a/include/mitsuba/core/spectrum.h b/include/mitsuba/core/spectrum.h index fded918c..6d245261 100644 --- a/include/mitsuba/core/spectrum.h +++ b/include/mitsuba/core/spectrum.h @@ -485,6 +485,14 @@ public: return result * (1.0f / N); } + /// Component-wise absolute value + inline TSpectrum abs() const { + TSpectrum value; + for (int i=0; i