SourceXtractorPlusPlus
0.10
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
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
50
std::string
getFullPath
()
const
{
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
:
75
Elements::TempFile
m_temp_file
;
76
std::shared_ptr<FitsImageSource<T>
>
m_image_source
;
77
};
78
79
}
80
81
#endif //_SEFRAMEWORK_IMAGE_TEMPORARYFITSIMAGESOURCE_H_
std::shared_ptr
STL class.
SourceXtractor::TemporaryFitsImageSource::~TemporaryFitsImageSource
virtual ~TemporaryFitsImageSource()=default
Temporary.h
x
std::shared_ptr< DependentParameter< std::shared_ptr< EngineParameter > > > x
Definition:
MoffatModelFittingTask.cpp:93
SourceXtractor::TemporaryFitsImageSource::TemporaryFitsImageSource
TemporaryFitsImageSource(const std::string &pattern, int width, int height)
Definition:
TemporaryFitsImageSource.h:38
SourceXtractor::TemporaryFitsImageSource
FitsTemporaryImageSource wraps FitsImageSource, generating the filename and acquiring its ownership.
Definition:
TemporaryFitsImageSource.h:36
SourceXtractor::TemporaryFitsImageSource::getHeight
virtual int getHeight() const override
Returns the height of the image in pixels.
Definition:
TemporaryFitsImageSource.h:70
y
std::shared_ptr< DependentParameter< std::shared_ptr< EngineParameter > > > y
Definition:
MoffatModelFittingTask.cpp:93
std::string
STL class.
FitsImageSource.h
SourceXtractor::TemporaryFitsImageSource::m_temp_file
Elements::TempFile m_temp_file
Definition:
TemporaryFitsImageSource.h:75
Elements::TempPath::path
boost::filesystem::path path() const
SourceXtractor
Definition:
Aperture.h:30
SourceXtractor::ImageTile
Definition:
ImageTile.h:57
path
boost::filesystem::path path
SourceXtractor::TemporaryFitsImageSource::getRepr
virtual std::string getRepr() const override
Human readable representation of this source.
Definition:
TemporaryFitsImageSource.h:54
SourceXtractor::TemporaryFitsImageSource::getWidth
virtual int getWidth() const override
Returns the width of the image in pixels.
Definition:
TemporaryFitsImageSource.h:66
std::enable_shared_from_this
SourceXtractor::ImageSource
Definition:
ImageSource.h:41
SourceXtractor::TemporaryFitsImageSource::m_image_source
std::shared_ptr< FitsImageSource< T > > m_image_source
Definition:
TemporaryFitsImageSource.h:76
SourceXtractor::TemporaryFitsImageSource::saveTile
virtual void saveTile(ImageTile< T > &tile) override
Definition:
TemporaryFitsImageSource.h:62
Elements::TempFile
SourceXtractor::FitsImageSource
Definition:
FitsImageSource.h:38
SourceXtractor::TemporaryFitsImageSource::getImageTile
virtual std::shared_ptr< ImageTile< T > > getImageTile(int x, int y, int width, int height) const override
Definition:
TemporaryFitsImageSource.h:58
SourceXtractor::TemporaryFitsImageSource::getFullPath
std::string getFullPath() const
Definition:
TemporaryFitsImageSource.h:50
SourceXtractor::TemporaryFitsImageSource::TemporaryFitsImageSource
TemporaryFitsImageSource(int width, int height)
Definition:
TemporaryFitsImageSource.h:43
Generated by
1.8.15