SourceXtractorPlusPlus
0.21
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
SEFramework
SEFramework
Image
Image.h
Go to the documentation of this file.
1
23
#ifndef _SEFRAMEWORK_IMAGE_IMAGE_H
24
#define _SEFRAMEWORK_IMAGE_IMAGE_H
25
26
#include <cstdint>
27
#include <memory>
28
29
#include "
SEUtils/Types.h
"
30
#include "
SEUtils/PixelCoordinate.h
"
31
32
namespace
SourceXtractor
{
33
34
template
<
typename
T>
35
class
ImageChunk;
36
37
43
template
<
typename
T>
44
class
Image
{
45
46
public
:
47
48
using
PixelType
= T;
49
53
virtual
~Image
() =
default
;
54
56
virtual
std::string
getRepr
()
const
= 0;
57
59
virtual
int
getWidth
()
const
= 0;
60
62
virtual
int
getHeight
()
const
= 0;
63
64
virtual
std::shared_ptr<ImageChunk<T>
>
getChunk
(
int
x
,
int
y
,
int
width,
int
height)
const
= 0;
65
66
std::shared_ptr<ImageChunk<T>
>
getChunk
(
const
PixelCoordinate
& start,
67
const
PixelCoordinate
&
end
)
const
{
68
assert
(
isInside
(start.
m_x
, start.
m_y
) &&
isInside
(
end
.m_x,
end
.m_y));
69
return
getChunk
(start.
m_x
, start.
m_y
,
end
.m_x - start.
m_x
+ 1,
end
.m_y - start.
m_y
+ 1);
70
}
71
73
bool
isInside
(
int
x
,
int
y
)
const
{
74
return
x
>= 0 &&
y
>= 0 &&
x
<
getWidth
() &&
y
<
getHeight
();
75
}
76
77
};
/* End of Image class */
78
80
using
DetectionImage
=
Image<SeFloat>
;
81
83
using
MeasurementImage
=
Image<SeFloat>
;
84
86
using
WeightImage
=
Image<SeFloat>
;
87
89
using
FlagImage
=
Image<std::int64_t>
;
90
91
}
/* namespace SourceXtractor */
92
93
#endif
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
PixelCoordinate.h
Types.h
std::string
SourceXtractor::Image
Interface representing an image.
Definition
Image.h:44
SourceXtractor::Image::getChunk
std::shared_ptr< ImageChunk< T > > getChunk(const PixelCoordinate &start, const PixelCoordinate &end) const
Definition
Image.h:66
SourceXtractor::Image::getRepr
virtual std::string getRepr() const =0
Get a string identifying this image in a human readable manner.
SourceXtractor::Image::~Image
virtual ~Image()=default
Destructor.
SourceXtractor::Image::getHeight
virtual int getHeight() const =0
Returns the height of the image in pixels.
SourceXtractor::Image::getWidth
virtual int getWidth() const =0
Returns the width of the image in pixels.
SourceXtractor::Image::getChunk
virtual std::shared_ptr< ImageChunk< T > > getChunk(int x, int y, int width, int height) const =0
SourceXtractor::Image::isInside
bool isInside(int x, int y) const
Returns true if the given coordinates are inside the image bounds.
Definition
Image.h:73
SourceXtractor::Image::PixelType
T PixelType
Definition
Image.h:48
std::end
T end(T... args)
std::function
SourceXtractor
Definition
Aperture.h:30
SourceXtractor::PixelCoordinate
A pixel coordinate made of two integers m_x and m_y.
Definition
PixelCoordinate.h:37
SourceXtractor::PixelCoordinate::m_y
int m_y
Definition
PixelCoordinate.h:38
SourceXtractor::PixelCoordinate::m_x
int m_x
Definition
PixelCoordinate.h:38
Generated by
1.10.0