SourceXtractorPlusPlus  0.11
Please provide a description of the project.
TemporaryFitsImageSource.h
Go to the documentation of this file.
1 
17 /*
18  * TemporaryFitsImageSource.h
19  *
20  * Created on: May 23, 2018
21  * Author: aalvarez
22  */
23 
24 #ifndef _SEFRAMEWORK_IMAGE_TEMPORARYFITSIMAGESOURCE_H_
25 #define _SEFRAMEWORK_IMAGE_TEMPORARYFITSIMAGESOURCE_H_
26 
27 #include "FitsImageSource.h"
29 
30 namespace SourceXtractor {
31 
35 template <typename T>
36 class TemporaryFitsImageSource : public ImageSource<T>, public std::enable_shared_from_this<ImageSource<T>> {
37 public:
38  TemporaryFitsImageSource(const std::string &pattern, int width, int height)
39  : m_temp_file(pattern),
40  m_image_source(new FitsImageSource<T>(m_temp_file.path().native(), width, height)) {
41  }
42 
43  TemporaryFitsImageSource(int width, int height)
44  : m_temp_file(),
45  m_image_source(new FitsImageSource<T>(m_temp_file.path(), width, height)) {
46  }
47 
48  virtual ~TemporaryFitsImageSource() = default;
49 
51  return m_temp_file.path().native();
52  }
53 
54  virtual std::string getRepr() const override {
55  return getFullPath();
56  }
57 
58  virtual std::shared_ptr<ImageTile<T>> getImageTile(int x, int y, int width, int height) const override {
59  return m_image_source->getImageTile(x, y, width, height);
60  }
61 
62  virtual void saveTile(ImageTile<T>& tile) override {
63  return m_image_source->saveTile(tile);
64  }
65 
66  virtual int getWidth() const override {
67  return m_image_source->getWidth();
68  }
69 
70  virtual int getHeight() const override {
71  return m_image_source->getHeight();
72  }
73 
74 private:
77 };
78 
79 }
80 
81 #endif //_SEFRAMEWORK_IMAGE_TEMPORARYFITSIMAGESOURCE_H_
std::shared_ptr< DependentParameter< std::shared_ptr< EngineParameter > > > x
TemporaryFitsImageSource(const std::string &pattern, int width, int height)
FitsTemporaryImageSource wraps FitsImageSource, generating the filename and acquiring its ownership...
virtual int getHeight() const override
Returns the height of the image in pixels.
std::shared_ptr< DependentParameter< std::shared_ptr< EngineParameter > > > y
STL class.
boost::filesystem::path path() const
boost::filesystem::path path
virtual std::string getRepr() const override
Human readable representation of this source.
virtual int getWidth() const override
Returns the width of the image in pixels.
std::shared_ptr< FitsImageSource< T > > m_image_source
virtual void saveTile(ImageTile< T > &tile) override
virtual std::shared_ptr< ImageTile< T > > getImageTile(int x, int y, int width, int height) const override