SourceXtractorPlusPlus
0.15
Please provide a description of the project.
SEFramework
SEFramework
Image
ProcessingImageSource.h
Go to the documentation of this file.
1
17
/*
18
* ProcessingImageSource.h
19
*
20
* Created on: May 2, 2018
21
* Author: mschefer
22
*/
23
24
#ifndef _SEFRAMEWORK_IMAGE_PROCESSINGIMAGESOURCE_H_
25
#define _SEFRAMEWORK_IMAGE_PROCESSINGIMAGESOURCE_H_
26
27
#include "
SEFramework/Image/Image.h
"
28
#include "
SEFramework/Image/ImageSource.h
"
29
30
namespace
SourceXtractor
{
31
32
template
<
typename
T>
33
class
ProcessingImageSource
:
public
ImageSource
,
public
std::enable_shared_from_this
<ImageSource> {
34
public
:
35
36
ProcessingImageSource
(
std::shared_ptr
<
Image<T>
> image) :
m_image
(image) {}
37
38
virtual
~ProcessingImageSource
() =
default
;
39
40
std::shared_ptr<ImageTile>
getImageTile
(
int
x
,
int
y
,
int
width,
int
height)
const override
{
41
auto
tile = std::make_shared<ImageTileWithType<T>>(
42
x
,
y
, width, height, (
const_cast<
ProcessingImageSource
*
>
(
this
))->shared_from_this());
43
44
generateTile
(
m_image
, *tile,
x
,
y
, width, height);
45
46
return
tile;
47
}
48
49
void
saveTile
(
ImageTile
&
/*tile*/
)
override
{
50
assert(
false
);
51
}
52
54
int
getWidth
()
const override
{
55
return
m_image
->getWidth();
56
}
57
59
int
getHeight
()
const override
{
60
return
m_image
->getHeight();
61
}
62
63
ImageTile::ImageType
getType
()
const override
{
64
return
ImageTile::getTypeValue
(T());
65
}
66
67
protected
:
68
virtual
void
generateTile
(
const
std::shared_ptr
<
Image<T>
>& image,
ImageTileWithType<T>
& tile,
int
x
,
int
y
,
int
width,
int
height)
const
= 0;
69
70
std::string
getImageRepr
()
const
{
71
return
m_image
->getRepr();
72
}
73
74
private
:
75
std::shared_ptr<Image<T>
>
m_image
;
76
};
77
78
}
79
80
81
82
#endif
/* _SEFRAMEWORK_IMAGE_PROCESSINGIMAGESOURCE_H_ */
ImageSource.h
Image.h
x
std::shared_ptr< DependentParameter< std::shared_ptr< EngineParameter > > > x
Definition:
MoffatModelFittingTask.cpp:94
y
std::shared_ptr< DependentParameter< std::shared_ptr< EngineParameter > > > y
Definition:
MoffatModelFittingTask.cpp:94
std::string
SourceXtractor::ImageSource
Definition:
ImageSource.h:52
SourceXtractor::ImageTileWithType
Definition:
ImageTile.h:160
SourceXtractor::ImageTile
Definition:
ImageTile.h:34
SourceXtractor::ImageTile::ImageType
ImageType
Definition:
ImageTile.h:37
SourceXtractor::ImageTile::getTypeValue
static ImageType getTypeValue(float)
Definition:
ImageTile.h:99
SourceXtractor::Image
Interface representing an image.
Definition:
Image.h:43
SourceXtractor::ProcessingImageSource
Definition:
ProcessingImageSource.h:33
SourceXtractor::ProcessingImageSource::getWidth
int getWidth() const override
Returns the width of the image in pixels.
Definition:
ProcessingImageSource.h:54
SourceXtractor::ProcessingImageSource::getImageTile
std::shared_ptr< ImageTile > getImageTile(int x, int y, int width, int height) const override
Definition:
ProcessingImageSource.h:40
SourceXtractor::ProcessingImageSource::getType
ImageTile::ImageType getType() const override
Definition:
ProcessingImageSource.h:63
SourceXtractor::ProcessingImageSource::m_image
std::shared_ptr< Image< T > > m_image
Definition:
ProcessingImageSource.h:75
SourceXtractor::ProcessingImageSource::getImageRepr
std::string getImageRepr() const
Definition:
ProcessingImageSource.h:70
SourceXtractor::ProcessingImageSource::saveTile
void saveTile(ImageTile &) override
Definition:
ProcessingImageSource.h:49
SourceXtractor::ProcessingImageSource::~ProcessingImageSource
virtual ~ProcessingImageSource()=default
SourceXtractor::ProcessingImageSource::ProcessingImageSource
ProcessingImageSource(std::shared_ptr< Image< T >> image)
Definition:
ProcessingImageSource.h:36
SourceXtractor::ProcessingImageSource::generateTile
virtual void generateTile(const std::shared_ptr< Image< T >> &image, ImageTileWithType< T > &tile, int x, int y, int width, int height) const =0
SourceXtractor::ProcessingImageSource::getHeight
int getHeight() const override
Returns the height of the image in pixels.
Definition:
ProcessingImageSource.h:59
std::enable_shared_from_this
SourceXtractor
Definition:
Aperture.h:30
std::shared_ptr
Generated by
1.9.1