polaroid-pp

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

Cartridge.h (1144B)


      1 // File       : Cartridge.h
      2 // Date       : Wed Apr 27 21:17:10 2016
      3 // Author     : Fabian Wermelinger
      4 // Description: Simple Transmission Cartridge Module for Polaroid Camera
      5 // Copyright 2016 ETH Zurich. All Rights Reserved.
      6 #ifndef CARTRIDGE_H_IRUVKOCT
      7 #define CARTRIDGE_H_IRUVKOCT
      8 
      9 #include <cmath>
     10 #include "ArgumentParser.h"
     11 #include "Types.h"
     12 #include "PhotoPaper.h"
     13 
     14 class Cartridge
     15 {
     16 protected:
     17     ArgumentParser& m_parser;
     18     bool m_bComputed;
     19 
     20     Real m_dataMin;
     21     Real m_dataMax;
     22 
     23 public:
     24     Cartridge(ArgumentParser& parser) : m_parser(parser), m_bComputed(false), m_dataMin(HUGE_VAL), m_dataMax(-HUGE_VAL) {}
     25     virtual ~Cartridge() {}
     26 
     27     virtual void capture(PhotoPaper& photo, Slice& data) = 0;
     28     virtual void compute(Slice& data) = 0;
     29     virtual void reset()
     30     {
     31         m_bComputed = false;
     32         m_dataMin = HUGE_VAL;
     33         m_dataMax = -HUGE_VAL;
     34     }
     35 
     36     inline Real min() const { return m_dataMin; }
     37     inline Real max() const { return m_dataMax; }
     38     inline void set_min(const Real v) { m_dataMin = v; }
     39     inline void set_max(const Real v) { m_dataMax = v; }
     40 };
     41 
     42 #endif /* CARTRIDGE_H_IRUVKOCT */