SourceXtractorPlusPlus
1.0.3
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
SEFramework
SEFramework
FITS
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
30
namespace
SourceXtractor
{
31
35
class
TemporaryFitsImageSource
:
public
ImageSource
,
public
std::enable_shared_from_this
<ImageSource> {
36
public
:
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
49
std::string
getFullPath
()
const
{
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
77
private
:
78
Elements::TempFile
m_temp_file
;
79
std::shared_ptr<FitsImageSource>
m_image_source
;
80
};
81
82
}
83
84
#endif
//_SEFRAMEWORK_IMAGE_TEMPORARYFITSIMAGESOURCE_H_
FitsImageSource.h
std::string
Elements::TempFile
SourceXtractor::FitsImageSource
Definition
FitsImageSource.h:46
SourceXtractor::ImageSource::ImageSource
ImageSource()
Definition
ImageSource.h:58
SourceXtractor::ImageTile
Definition
ImageTile.h:34
SourceXtractor::ImageTile::ImageType
ImageType
Definition
ImageTile.h:37
SourceXtractor::TemporaryFitsImageSource::TemporaryFitsImageSource
TemporaryFitsImageSource(const std::string &pattern, int width, int height, ImageTile::ImageType image_type)
Definition
TemporaryFitsImageSource.h:37
SourceXtractor::TemporaryFitsImageSource::getHeight
int getHeight() const override
Returns the height of the image in pixels.
Definition
TemporaryFitsImageSource.h:69
SourceXtractor::TemporaryFitsImageSource::getRepr
std::string getRepr() const override
Human readable representation of this source.
Definition
TemporaryFitsImageSource.h:53
SourceXtractor::TemporaryFitsImageSource::getFullPath
std::string getFullPath() const
Definition
TemporaryFitsImageSource.h:49
SourceXtractor::TemporaryFitsImageSource::TemporaryFitsImageSource
TemporaryFitsImageSource(int width, int height, ImageTile::ImageType image_type)
Definition
TemporaryFitsImageSource.h:42
SourceXtractor::TemporaryFitsImageSource::~TemporaryFitsImageSource
virtual ~TemporaryFitsImageSource()=default
SourceXtractor::TemporaryFitsImageSource::saveTile
void saveTile(ImageTile &tile) override
Definition
TemporaryFitsImageSource.h:61
SourceXtractor::TemporaryFitsImageSource::m_image_source
std::shared_ptr< FitsImageSource > m_image_source
Definition
TemporaryFitsImageSource.h:79
SourceXtractor::TemporaryFitsImageSource::getImageTile
std::shared_ptr< ImageTile > getImageTile(int x, int y, int width, int height) const override
Definition
TemporaryFitsImageSource.h:57
SourceXtractor::TemporaryFitsImageSource::getWidth
int getWidth() const override
Returns the width of the image in pixels.
Definition
TemporaryFitsImageSource.h:65
SourceXtractor::TemporaryFitsImageSource::m_temp_file
Elements::TempFile m_temp_file
Definition
TemporaryFitsImageSource.h:78
SourceXtractor::TemporaryFitsImageSource::getType
ImageTile::ImageType getType() const override
Definition
TemporaryFitsImageSource.h:73
std::enable_shared_from_this
SourceXtractor
Definition
Aperture.h:30
std::shared_ptr
Generated by
1.15.0