App

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

- File List
- File Members

TLUTGenerator.hpp
Go to the documentation of this file.
1
2 namespace app {
3 template<typename TPIXEL, typename TCHANNEL> class TLUTGenerator;
4 }
5
6 #ifndef TLUTGENERATOR_HPP_
7 #define TLUTGENERATOR_HPP_
8
9 #include <cstdlib>
10 #include <cmath>
11
12 #include "../typedefs.hpp"
13
14 #include "TLUT.hpp"
15 #include "CubicSpline.hpp"
16
17 namespace app {
18
19 template<typename TPIXEL, typename TCHANNEL>
20 class TLUTGenerator {
21 protected:
23
29 virtual int prepareChannelLUT(TCHANNEL * ch, CubicSpline *sp);
30
32
39 virtual int prepareChannelLUT(TCHANNEL * ch, CubicSpline *sp1, CubicSpline *sp2);
40
41 public:
42 static const TCHANNEL maxVal;
43 static const TCHANNEL halfVal;
44 static const unsigned chCount;
45
46 TLUTGenerator() {}
47 virtual ~TLUTGenerator();
48
49 int fillBrightnessLUT_4ch(TLUT<TPIXEL, TCHANNEL> & dst, double bias);
50
51 int fillContrastLUT_4ch(TLUT<TPIXEL, TCHANNEL> & dst, double bias);
52
53 int fillGammaLUT_4ch(TLUT<TPIXEL, TCHANNEL> & dst, double gamma);
54
55 int fillCurvesLUT_4ch(TLUT<TPIXEL, TCHANNEL> & dst,
56 double* xM, double* yM, unsigned cM,
57 double* xR, double* yR, unsigned cR,
58 double* xG, double* yG, unsigned cG,
59 double* xB, double* yB, unsigned cB,
60 double* xA, double* yA, unsigned cA);
61
62 virtual TLUT<TPIXEL, TCHANNEL> * createBrightnessLUT_4ch(double bias);
63
64 virtual TLUT<TPIXEL, TCHANNEL> * createContrastLUT_4ch(double bias);
65
66 virtual TLUT<TPIXEL, TCHANNEL> * createGammaLUT_4ch(double gamma);
67
68 virtual TLUT<TPIXEL, TCHANNEL> * createCurvesLUT_4ch(
69 double* xM, double* yM, unsigned cM,
70 double* xR, double* yR, unsigned cR,
71 double* xG, double* yG, unsigned cG,
72 double* xB, double* yB, unsigned cB,
73 double* xA, double* yA, unsigned cA);
74
75 };
76
77 template <typename TPIXEL, typename TCHANNEL>
78 const TCHANNEL TLUTGenerator<TPIXEL, TCHANNEL>::maxVal = ~0;
79
80 template <typename TPIXEL, typename TCHANNEL>
81 const TCHANNEL TLUTGenerator<TPIXEL, TCHANNEL>::halfVal = maxVal / 2;
82
83 template <typename TPIXEL, typename TCHANNEL>
84 const unsigned TLUTGenerator<TPIXEL, TCHANNEL>::chCount = sizeof(TPIXEL) / sizeof(TCHANNEL);
85
86 } /* namespace app */
87 #endif /* TLUTGENERATOR_HPP_ */