polaroid-pp

Schlieren and contour plot tool
git clone https://git.0xfab.ch/polaroid-pp.git
Log | Files | Refs | Submodules | README | LICENSE

commit ed4f8fe990d4cf78c2c8e082386a76020d2eaaeb
parent fdf9c3291016ea6857af590e00b5e08ef19bb8b1
Author: Fabian Wermelinger <fabianw@mavt.ethz.ch>
Date:   Sun,  1 May 2016 23:34:58 +0200

added gamma correction filter

Diffstat:
Aapps/polaroidCamera/GammaCorrection.h | 28++++++++++++++++++++++++++++
1 file changed, 28 insertions(+), 0 deletions(-)

diff --git a/apps/polaroidCamera/GammaCorrection.h b/apps/polaroidCamera/GammaCorrection.h @@ -0,0 +1,28 @@ +// File : GammaCorrection.h +// Date : Sun 01 May 2016 11:22:38 PM CEST +// Author : Fabian Wermelinger +// Description: Gamma Correction Filter +// Copyright 2016 ETH Zurich. All Rights Reserved. +#ifndef GAMMACORRECTION_H_4SYE23BR +#define GAMMACORRECTION_H_4SYE23BR + +#include <cmath> +#include "ArgumentParser.h" + +class GammaCorrection +{ +private: + ArgumentParser& m_parser; + +public: + GammaCorrection(ArgumentParser& parser) : m_parser(parser) {} + + inline Real operator()(const Real v) const + { + const Real gamma = m_parser("-gamma").asDouble(1.0); + const Real A = m_parser("-gammaA").asDouble(1.0); + return A*std::pow(v, gamma); + } +}; + +#endif /* GAMMACORRECTION_H_4SYE23BR */