SourceXtractorPlusPlus
0.15
Please provide a description of the project.
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 <memory>
27
28
#include "
SEUtils/Types.h
"
29
#include "
SEUtils/PixelCoordinate.h
"
30
31
namespace
SourceXtractor
{
32
33
template
<
typename
T>
34
class
ImageChunk;
35
36
42
template
<
typename
T>
43
class
Image
{
44
45
public
:
46
47
using
PixelType
= T;
48
52
virtual
~Image
() =
default
;
53
55
virtual
std::string
getRepr
()
const
= 0;
56
58
virtual
int
getWidth
()
const
= 0;
59
61
virtual
int
getHeight
()
const
= 0;
62
63
virtual
std::shared_ptr<ImageChunk<T>
>
getChunk
(
int
x
,
int
y
,
int
width,
int
height)
const
= 0;
64
65
std::shared_ptr<ImageChunk<T>
>
getChunk
(
const
PixelCoordinate
& start,
66
const
PixelCoordinate
& end)
const
{
67
assert(
isInside
(start.
m_x
, start.
m_y
) &&
isInside
(
end
.m_x,
end
.m_y));
68
return
getChunk
(start.
m_x
, start.
m_y
,
end
.m_x - start.
m_x
+ 1,
end
.m_y - start.
m_y
+ 1);
69
}
70
72
bool
isInside
(
int
x
,
int
y
)
const
{
73
return
x
>= 0 &&
y
>= 0 &&
x
<
getWidth
() &&
y
<
getHeight
();
74
}
75
76
};
/* End of Image class */
77
79
using
DetectionImage
=
Image<SeFloat>
;
80
82
using
MeasurementImage
=
Image<SeFloat>
;
83
85
using
WeightImage
=
Image<SeFloat>
;
86
88
using
FlagImage
=
Image<std::int64_t>
;
89
90
}
/* namespace SourceXtractor */
91
92
#endif
SourceXtractor::PixelCoordinate
A pixel coordinate made of two integers m_x and m_y.
Definition:
PixelCoordinate.h:37
std::string
STL class.
std::shared_ptr
STL class.
SourceXtractor::Image::getWidth
virtual int getWidth() const =0
Returns the width of the image in pixels.
SourceXtractor::Image< M >::PixelType
M PixelType
Definition:
Image.h:47
Types.h
SourceXtractor::Image::getHeight
virtual int getHeight() const =0
Returns the height of the image in pixels.
SourceXtractor::Image::isInside
bool isInside(int x, int y) const
Returns true if the given coordinates are inside the image bounds.
Definition:
Image.h:72
SourceXtractor::Image
Interface representing an image.
Definition:
Image.h:43
SourceXtractor::Image::getRepr
virtual std::string getRepr() const =0
Get a string identifying this image in a human readable manner.
SourceXtractor
Definition:
Aperture.h:30
SourceXtractor::PixelCoordinate::m_x
int m_x
Definition:
PixelCoordinate.h:38
SourceXtractor::Image::~Image
virtual ~Image()=default
Destructor.
SourceXtractor::PixelCoordinate::m_y
int m_y
Definition:
PixelCoordinate.h:38
SourceXtractor::Image::getChunk
virtual std::shared_ptr< ImageChunk< T > > getChunk(int x, int y, int width, int height) const =0
SourceXtractor::Image::getChunk
std::shared_ptr< ImageChunk< T > > getChunk(const PixelCoordinate &start, const PixelCoordinate &end) const
Definition:
Image.h:65
x
std::shared_ptr< DependentParameter< std::shared_ptr< EngineParameter > > > x
Definition:
MoffatModelFittingTask.cpp:94
PixelCoordinate.h
std::end
T end(T... args)
y
std::shared_ptr< DependentParameter< std::shared_ptr< EngineParameter > > > y
Definition:
MoffatModelFittingTask.cpp:94
Generated by
1.8.20