App

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List
- File Members

TFilter.hpp
Go to the documentation of this file.
1
6 namespace app {
7 template <typename TPIXEL, typename TCHANNEL> class TFilter;
8 }
9
10 #include "../typedefs.hpp"
11 #include "../bitmaps/TBitmap.hpp"
12 #include "../utils/Geometry.hpp"
13
14 #ifndef TFILTER_HPP_
15 #define TFILTER_HPP_
16
17 namespace app {
18
20
23 template <typename TPIXEL, typename TCHANNEL>
24 class TFilter {
25 protected:
26 static const TCHANNEL maxVal;
27 static const unsigned chCount;
28
29 virtual int applyTo_1ch(TBitmap<TPIXEL, TCHANNEL> &bitmap, Rect dstArea);
30 virtual int applyTo_1ch(TBitmap<TPIXEL, TCHANNEL> &bitmap, Rect dstRect, double alpha);
31 virtual int applyTo_1ch(TBitmap<TPIXEL, TCHANNEL> &bitmap, TBitmap<TCHANNEL, TCHANNEL> &msk, Rect mskRect, Point mskOrig);
32 virtual int applyTo_1ch(TBitmap<TPIXEL, TCHANNEL> &bitmap, TBitmap<TCHANNEL, TCHANNEL> &msk, Rect mskRect, Point mskOrig, double alpha);
33
34 virtual int applyTo_4ch(TBitmap<TPIXEL, TCHANNEL> &bitmap, Rect dstRect);
35 virtual int applyTo_4ch(TBitmap<TPIXEL, TCHANNEL> &bitmap, Rect dstRect, double alpha);
36 virtual int applyTo_4ch(TBitmap<TPIXEL, TCHANNEL> &bitmap, TBitmap<TCHANNEL, TCHANNEL> &msk, Rect mskRect, Point mskOrig);
37 virtual int applyTo_4ch(TBitmap<TPIXEL, TCHANNEL> &bitmap, TBitmap<TCHANNEL, TCHANNEL> &msk, Rect mskRect, Point mskOrig, double alpha);
38
39 public:
40 virtual ~TFilter();
41
42 virtual int applyTo(TBitmap<TPIXEL, TCHANNEL> &bitmap, Rect dstRect);
43 virtual int applyTo(TBitmap<TPIXEL, TCHANNEL> &bitmap, Rect dstRect, double alpha);
44 virtual int applyTo(TBitmap<TPIXEL, TCHANNEL> &bitmap, TBitmap<TCHANNEL, TCHANNEL> &msk, Rect mskRect, Point mskOrig);
45 virtual int applyTo(TBitmap<TPIXEL, TCHANNEL> &bitmap, TBitmap<TCHANNEL, TCHANNEL> &msk, Rect mskRect, Point mskOrig, double alpha);
46
47 virtual int isInitOk() = 0;
48
49 };
50
51 template <typename TPIXEL, typename TCHANNEL>
52 const TCHANNEL TFilter<TPIXEL, TCHANNEL>::maxVal = ~0;
53
54 template <typename TPIXEL, typename TCHANNEL>
55 const unsigned TFilter<TPIXEL, TCHANNEL>::chCount = sizeof(TPIXEL) / sizeof(TCHANNEL);
56
57 } /* namespace appdemo */
58 #endif /* TFILTER_HPP_ */