SourceXtractorPlusPlus
0.15
Please provide a description of the project.
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
virtual
std::string
getRepr
()
const override
{
54
return
getFullPath
();
55
}
56
57
virtual
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
virtual
void
saveTile
(
ImageTile
& tile)
override
{
62
return
m_image_source
->saveTile(tile);
63
}
64
65
virtual
int
getWidth
()
const override
{
66
return
m_image_source
->getWidth();
67
}
68
69
virtual
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_
SourceXtractor::FitsImageSource
Definition:
FitsImageSource.h:45
SourceXtractor::TemporaryFitsImageSource::getWidth
virtual int getWidth() const override
Returns the width of the image in pixels.
Definition:
TemporaryFitsImageSource.h:65
SourceXtractor::TemporaryFitsImageSource::getHeight
virtual int getHeight() const override
Returns the height of the image in pixels.
Definition:
TemporaryFitsImageSource.h:69
std::string
STL class.
std::shared_ptr
STL class.
Temporary.h
SourceXtractor::TemporaryFitsImageSource::m_temp_file
Elements::TempFile m_temp_file
Definition:
TemporaryFitsImageSource.h:78
Elements::TempPath::path
Path::Item path() const
SourceXtractor::TemporaryFitsImageSource::getRepr
virtual std::string getRepr() const override
Human readable representation of this source.
Definition:
TemporaryFitsImageSource.h:53
SourceXtractor::TemporaryFitsImageSource::getImageTile
virtual std::shared_ptr< ImageTile > getImageTile(int x, int y, int width, int height) const override
Definition:
TemporaryFitsImageSource.h:57
SourceXtractor::TemporaryFitsImageSource
FitsTemporaryImageSource wraps FitsImageSource, generating the filename and acquiring its ownership.
Definition:
TemporaryFitsImageSource.h:35
SourceXtractor::ImageTile
Definition:
ImageTile.h:34
SourceXtractor::TemporaryFitsImageSource::m_image_source
std::shared_ptr< FitsImageSource > m_image_source
Definition:
TemporaryFitsImageSource.h:79
SourceXtractor
Definition:
Aperture.h:30
Elements::TempFile
SourceXtractor::TemporaryFitsImageSource::TemporaryFitsImageSource
TemporaryFitsImageSource(int width, int height, ImageTile::ImageType image_type)
Definition:
TemporaryFitsImageSource.h:42
SourceXtractor::TemporaryFitsImageSource::getType
ImageTile::ImageType getType() const override
Definition:
TemporaryFitsImageSource.h:73
std::enable_shared_from_this
SourceXtractor::TemporaryFitsImageSource::~TemporaryFitsImageSource
virtual ~TemporaryFitsImageSource()=default
SourceXtractor::ImageSource
Definition:
ImageSource.h:52
SourceXtractor::TemporaryFitsImageSource::getFullPath
std::string getFullPath() const
Definition:
TemporaryFitsImageSource.h:49
x
std::shared_ptr< DependentParameter< std::shared_ptr< EngineParameter > > > x
Definition:
MoffatModelFittingTask.cpp:94
SourceXtractor::TemporaryFitsImageSource::TemporaryFitsImageSource
TemporaryFitsImageSource(const std::string &pattern, int width, int height, ImageTile::ImageType image_type)
Definition:
TemporaryFitsImageSource.h:37
path
Elements::Path::Item path
y
std::shared_ptr< DependentParameter< std::shared_ptr< EngineParameter > > > y
Definition:
MoffatModelFittingTask.cpp:94
FitsImageSource.h
SourceXtractor::ImageTile::ImageType
ImageType
Definition:
ImageTile.h:37
SourceXtractor::TemporaryFitsImageSource::saveTile
virtual void saveTile(ImageTile &tile) override
Definition:
TemporaryFitsImageSource.h:61
Generated by
1.8.20