SourceXtractorPlusPlus 1.0.3
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
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"
28#include "ElementsKernel/Temporary.h"
29
30namespace SourceXtractor {
31
36public:
37 TemporaryFitsImageSource(const std::string &pattern, int width, int height, ImageTile::ImageType image_type)
38 : m_temp_file(pattern),
39 m_image_source(new FitsImageSource(m_temp_file.path().native(), width, height, image_type)) {
40 }
41
42 TemporaryFitsImageSource(int width, int height, ImageTile::ImageType image_type)
43 : m_temp_file(),
44 m_image_source(new FitsImageSource(m_temp_file.path().native(), width, height, image_type)) {
45 }
46
47 virtual ~TemporaryFitsImageSource() = default;
48
50 return m_temp_file.path().native();
51 }
52
53 std::string getRepr() const override {
54 return getFullPath();
55 }
56
57 std::shared_ptr<ImageTile> getImageTile(int x, int y, int width, int height) const override {
58 return m_image_source->getImageTile(x, y, width, height);
59 }
60
61 void saveTile(ImageTile& tile) override {
62 return m_image_source->saveTile(tile);
63 }
64
65 int getWidth() const override {
66 return m_image_source->getWidth();
67 }
68
69 int getHeight() const override {
70 return m_image_source->getHeight();
71 }
72
73 ImageTile::ImageType getType() const override {
74 return m_image_source->getType();
75 }
76
77private:
80};
81
82}
83
84#endif //_SEFRAMEWORK_IMAGE_TEMPORARYFITSIMAGESOURCE_H_
TemporaryFitsImageSource(const std::string &pattern, int width, int height, ImageTile::ImageType image_type)
int getHeight() const override
Returns the height of the image in pixels.
std::string getRepr() const override
Human readable representation of this source.
TemporaryFitsImageSource(int width, int height, ImageTile::ImageType image_type)
std::shared_ptr< FitsImageSource > m_image_source
std::shared_ptr< ImageTile > getImageTile(int x, int y, int width, int height) const override
int getWidth() const override
Returns the width of the image in pixels.
ImageTile::ImageType getType() const override