App
TFInterpolator.hpp
Go to the documentation of this file.
1 namespace app {
2 template<typename TPIXEL, typename TCHANNEL> class TFInterpolator;
3 }
4 
5 #ifndef TFINTERPOLATOR_HPP_
6 #define TFINTERPOLATOR_HPP_
7 
8 #include <cstdlib>
9 #include "../typedefs.hpp"
10 #include "../bitmaps/TBitmap.hpp"
11 #include "../filters/TGaussianBlur.hpp"
12 
13 namespace app {
14 
15 typedef enum {
18  LINEAR = 2,
19  CUBIC = 3
21 
22 
23 template<typename TPIXEL, typename TCHANNEL>
25 protected:
26 
27  virtual int resampleTo_4ch(TBitmap<TPIXEL, TCHANNEL> &dst) const = 0;
28  virtual int resampleTo_1ch(TBitmap<TPIXEL, TCHANNEL> &dst) const = 0;
29 
31 
32 public:
33  static const unsigned chCount;
34  static const TCHANNEL maxVal;
35 
37  }
38  virtual ~TFInterpolator();
39 
40  // Neni dobre reseni, ale vyzaduje mene prepisovani a komplikaci nez pristup pres this-> v kazde odvozene tride, navic pristup pres pointer by mohl byt pomalejsi.
41  virtual TPIXEL * getSrcData() const = 0;
42  virtual unsigned getSrcWidth() const = 0;
43  virtual unsigned getSrcHeight() const = 0;
44 
45  virtual int isInitOk() const = 0;
46 
47  virtual int resampleTo(TBitmap<TPIXEL, TCHANNEL> &dst) const;
48  virtual int resampleTo_aliased(TBitmap<TPIXEL, TCHANNEL> &dst, double force = 1) const;
49 
50 };
51 
52 template<typename TPIXEL, typename TCHANNEL>
53 const unsigned TFInterpolator<TPIXEL, TCHANNEL>::chCount = sizeof(TPIXEL) / sizeof(TCHANNEL);
54 
55 template<typename TPIXEL, typename TCHANNEL>
57 
58 } /* namespace app */
59 #endif /* TFINTERPOLATOR_HPP_ */