App
TLinearFilter.hpp
Go to the documentation of this file.
1 
6 namespace app {
7  template <typename TPIXEL, typename TCHANNEL> class TLinearFilter;
8 }
9 
10 #ifndef TLINEARFILTER_HPP_
11 #define TLINEARFILTER_HPP_
12 
13 #include <cstdlib>
14 
15 #include "TFilter.hpp"
16 
17 #include "../typedefs.hpp"
18 #include "../bitmaps/TBitmap.hpp"
19 #include "../utils/MirroredReindexer.hpp"
20 #include "../blending/Blender.hpp"
21 
22 namespace app {
24 
30 template <typename TPIXEL, typename TCHANNEL>
31 class TLinearFilter : public TFilter<TPIXEL, TCHANNEL> {
32 protected:
33  double * kernel;
38  int initOk;
39 
40 // static double LaPlaceSharpen[9]; /// SMAZAT
41 
44  kernel = NULL;
45  initOk = 0;
46  }
47 
49 
50  virtual int applyTo_1ch(TBitmap<TPIXEL, TCHANNEL> &bitmap, Rect dstArea);
51 
52  virtual int applyTo_4ch(TBitmap<TPIXEL, TCHANNEL> &bitmap, Rect dstRect);
53  virtual int applyTo_4ch(TBitmap<TPIXEL, TCHANNEL> &bitmap, Rect dstRect, double alpha);
54  virtual int applyTo_4ch(TBitmap<TPIXEL, TCHANNEL> &bitmap, TBitmap<TCHANNEL, TCHANNEL> &msk, Rect mskRect, Point mskOrig);
55  virtual int applyTo_4ch(TBitmap<TPIXEL, TCHANNEL> &bitmap, TBitmap<TCHANNEL, TCHANNEL> &msk, Rect mskRect, Point mskOrig, double alpha);
56 
57 public:
58 
60  virtual ~TLinearFilter();
61 
63  double* getKernel() const {
64  return kernel;
65  }
66 
68  int getKernelHCenter() const {
69  return kernelHCenter;
70  }
71 
73  int getKernelHeight() const {
74  return kernelHeight;
75  }
76 
78  int getKernelWCenter() const {
79  return kernelWCenter;
80  }
81 
83  int getKernelWidth() const {
84  return kernelWidth;
85  }
86 
87  virtual int isInitOk() {
88  return initOk;
89  }
90 
91 };
92 
93 } /* namespace app */
94 #endif /* TLINEARFILTER_HPP_ */