FotoSHOCK
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
CurveOperation.h
1 /*
2  * Copyright 2011, 2012 Lukas Jirkovsky
3  *
4  * This file is part of FotoSHOCK.
5  *
6  * FotoSHOCK is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, version 3 of the License.
9  *
10  * FotoSHOCK is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with FotoSHOCK. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef CURVEOPERATION_H
20 #define CURVEOPERATION_H
21 
22 #include "FotoSHOCKOperation.h"
23 
24 using namespace FotoSHOCKcore;
25 
26 class HermiteCurve;
27 
29  public:
31  virtual ~CurveOperation();
32 
33  virtual void initialize();
34  virtual void runOperation(const Inputs& sources, const Outputs& dest, std::vector<UpdateInfo>& ROI, const long stamp);
35  virtual QDialog* getUI(QWidget* parent = 0);
36  private:
37  HermiteCurve* curves;
38  std::size_t curvesSize;
39  std::size_t curvesResolution;
40  // lokup table, is initialized for the current image format
41  void** LUT;
42 
43  template <ValueType::Enum PixelType>
44  void applyCurvesInteger(MipMap* src, MipMap* dest, vector<UpdateInfo>& ROI, const long stamp);
45  template <ValueType::Enum PixelType>
46  void applyCurvesFloat(MipMap* src, MipMap* dest, vector<UpdateInfo>& ROI, const long stamp);
47 };
48 
50  public:
51  virtual const char* name() {return "Curves";}
52  virtual const char* description() {return "Adjust color curves.";}
53  virtual ImageOperation* operation() {return new CurveOperation;}
54 };
55 
56 #endif // CURVEOPERATION_H