FotoSHOCK
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
RootLoadImage.hpp
1 /*
2  * Copyright 2011, 2012 Lukas Jirkovsky
3  *
4  * This file is part of FotoSHOCKcore.
5  *
6  * FotoSHOCKcore 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  * FotoSHOCKcore 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 FotoSHOCKcore. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef ROOTLOADIMAGE_H
20 #define ROOTLOADIMAGE_H
21 
22 #include "ImageOperation.hpp"
23 
24 namespace FotoSHOCKcore {
25 
27 
35  public:
37  RootLoadImageDescriptor(const std::string fileName);
38  RootLoadImageDescriptor(PixelData format, const std::string fileName);
39 
40  virtual const char* name() { return "Root"; }
41  virtual const char* description() { return "An image source."; }
42  virtual ImageOperation* operation();
44  virtual InputProto inputPrototype() { InputProto tmp; return tmp; }
46  OutputProto proto;
48  return proto;
49  }
50  private:
51  bool m_prepared;
52  // defines whether a specific format was requested
53  bool m_userFormat;
54  PixelData m_format;
55  std::string m_fileName;
56 };
57 
58 class RootLoadImage : public ImageOperation {
59  public:
60  RootLoadImage();
61  RootLoadImage(const std::string fileName);
62  RootLoadImage(PixelData format, const std::string fileName);
63 
64  void prepare(const std::string fileName);
65  void prepare(PixelData format, const std::string fileName);
66 
67  virtual void runOperation(const Inputs& sources, const Outputs& dest, vector<UpdateInfo>& ROI, const long int stamp);
68  virtual bool isPrepared();
69  virtual void serialize(XmlSerializer& serializer);
70  virtual void deserialize(XmlSerializer& serializer);
71  private:
72  bool m_prepared;
73  // defines whether a specific format was requested
74  bool m_userFormat;
75  PixelData m_format;
76  std::string m_fileName;
77 };
78 
79 }
80 
81 #endif // ROOTLOADIMAGE_H