SourceXtractorPlusPlus  0.12
Please provide a description of the project.
MirrorImage.h
Go to the documentation of this file.
1 
17 /*
18  * @file SEFramework/Image/ReflectImage.h
19  * @date 11/09/18
20  * @author Alejandro Alvarez Ayllon
21  */
22 
23 #ifndef _SEFRAMEWORK_IMAGE_MIRRORIMAGE_H
24 #define _SEFRAMEWORK_IMAGE_MIRRORIMAGE_H
25 
27 
28 namespace SourceXtractor {
29 
34 template <typename T>
35 class MirrorImage: public ImageBase<T> {
36 protected:
38  }
39 
40 public:
41  template<typename... Args>
42  static std::shared_ptr<MirrorImage<T>> create(Args &&... args) {
43  return std::shared_ptr<MirrorImage<T>>(new MirrorImage{std::forward<Args>(args)...});
44  }
45 
46  std::string getRepr() const override {
47  return "MirrorImage(" + m_img->getRepr() + ")";
48  }
49 
50  int getWidth() const override {
51  return m_img->getWidth();
52  }
53 
54  int getHeight() const override {
55  return m_img->getHeight();
56  }
57 
58  T getValue(int x, int y) const override {
59  x = m_img->getWidth() - x - 1;
60  y = m_img->getHeight() - y - 1;
61  return m_img->getValue(x, y);
62  }
63 
64 private:
66 };
67 
68 } // end SourceXtractor
69 
70 #endif // _SEFRAMEWORK_IMAGE_MIRRORIMAGE_H
Mirrors an image in both X and Y axes.
Definition: MirrorImage.h:35
static std::shared_ptr< MirrorImage< T > > create(Args &&... args)
Definition: MirrorImage.h:42
std::shared_ptr< DependentParameter< std::shared_ptr< EngineParameter > > > x
T getValue(int x, int y) const override
Returns the value of the pixel with the coordinates (x,y)
Definition: MirrorImage.h:58
std::shared_ptr< DependentParameter< std::shared_ptr< EngineParameter > > > y
STL class.
std::string getRepr() const override
Get a string identifying this image in a human readable manner.
Definition: MirrorImage.h:46
int getHeight() const override
Returns the height of the image in pixels.
Definition: MirrorImage.h:54
MirrorImage(std::shared_ptr< const Image< T >> img)
Definition: MirrorImage.h:37
Interface representing an image.
Definition: Image.h:43
std::shared_ptr< const Image< T > > m_img
Definition: MirrorImage.h:65
int getWidth() const override
Returns the width of the image in pixels.
Definition: MirrorImage.h:50