SourceXtractorPlusPlus  0.19
SourceXtractor++, the next generation SExtractor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ImageSource.h
Go to the documentation of this file.
1 
18 /*
19  * ImageSource.h
20  *
21  * Created on: Feb 14, 2018
22  * Author: mschefer
23  */
24 
25 #ifndef _SEFRAMEWORK_IMAGE_IMAGESOURCE_H_
26 #define _SEFRAMEWORK_IMAGE_IMAGESOURCE_H_
27 
28 #include <boost/variant.hpp>
29 
32 
33 namespace SourceXtractor {
34 
40 struct MetadataEntry {
41  typedef boost::variant<bool, char, int64_t, double, std::string> value_t;
42 
44 
47 };
48 
53 class ImageSource {
54 public:
55 
57 
58  virtual ~ImageSource() = default;
59 
61  virtual std::string getRepr() const = 0;
62 
63  virtual void saveTile(ImageTile& tile) = 0;
64  virtual std::shared_ptr<ImageTile> getImageTile(int x, int y, int width, int height) const = 0;
65 
66 
68  virtual int getWidth() const = 0;
69 
71  virtual int getHeight() const = 0;
72 
73  virtual ImageTile::ImageType getType() const = 0;
74 
78  virtual const std::map<std::string, MetadataEntry>& getMetadata() const { return m_metadata; }
79 
80  virtual void setMetadata(const std::string& key, const MetadataEntry& value) {
81  m_metadata[key] = value;
82  }
83 
84 private:
86 };
87 
88 } // namespace SourceXtractor
89 
90 #endif /* _SEFRAMEWORK_IMAGE_IMAGESOURCE_H_ */
virtual std::string getRepr() const =0
Human readable representation of this source.
std::shared_ptr< DependentParameter< std::shared_ptr< EngineParameter > > > x
boost::variant< bool, char, int64_t, double, std::string > value_t
Definition: ImageSource.h:41
virtual std::shared_ptr< ImageTile > getImageTile(int x, int y, int width, int height) const =0
std::map< std::string, std::string > m_extra
Additional metadata about the entry: i.e. comments.
Definition: ImageSource.h:46
std::shared_ptr< DependentParameter< std::shared_ptr< EngineParameter > > > y
STL class.
virtual int getHeight() const =0
Returns the height of the image in pixels.
virtual const std::map< std::string, MetadataEntry > & getMetadata() const
Definition: ImageSource.h:78
std::map< std::string, MetadataEntry > m_metadata
Definition: ImageSource.h:85
virtual ~ImageSource()=default
virtual int getWidth() const =0
Returns the width of the image in pixels.
virtual void setMetadata(const std::string &key, const MetadataEntry &value)
Definition: ImageSource.h:80
virtual ImageTile::ImageType getType() const =0
virtual void saveTile(ImageTile &tile)=0