FotoSHOCK
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
BWconversion_direct.hpp
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 it
7  * under the terms of the GNU Lesser 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 Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with FotoSHOCK. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
25 #ifndef BWCONVERSIONDIRECT_H
26 #define BWCONVERSIONDIRECT_H
27 
28 #include <ImageOperation.hpp>
29 #include <ImageBuffer.hpp>
30 
31 using namespace FotoSHOCKcore;
32 
33 class BWconversion : public ImageOperation {
34  public:
35  virtual void runOperation (const Inputs& sources, const Outputs& dest, vector<UpdateInfo>& ROI, const long stamp);
36  private:
37  template <ValueType::Enum PixelFormat>
38  void convert(MipMap* src, MipMap* dest, vector<UpdateInfo>& ROIlist, const long stamp);
39 };
40 
42  public:
43  virtual const char* name() {return "B/W Conversion.";}
44  virtual const char* description() {return "Converts an image to grayscale.";}
45  virtual ImageOperation* operation() {return new BWconversion;}
46 };
47 
48 #endif