SourceXtractorPlusPlus
0.15
Please provide a description of the project.
SEImplementation
SEImplementation
Plugin
MeasurementFrameGroupRectangle
MeasurementFrameGroupRectangle.h
Go to the documentation of this file.
1
17
/*
18
* MeasurementFrameGroupRectangle.h
19
*
20
* Created on: Sep 5, 2018
21
* Author: Alejandro Alvarez Ayllon
22
*/
23
24
#ifndef _SEIMPLEMENTATION_PLUGIN_MEASUREMENTFRAMEGROUPRECTANGLE_MEASUREMENTFRAMEGROUPRECTANGLE_H_
25
#define _SEIMPLEMENTATION_PLUGIN_MEASUREMENTFRAMEGROUPRECTANGLE_MEASUREMENTFRAMEGROUPRECTANGLE_H_
26
27
28
#include "
SEFramework/Property/Property.h
"
29
#include "
SEFramework/Image/Image.h
"
30
31
namespace
SourceXtractor
{
32
33
class
MeasurementFrameGroupRectangle
:
public
Property
{
34
public
:
35
virtual
~MeasurementFrameGroupRectangle
() =
default
;
36
37
MeasurementFrameGroupRectangle
():
38
m_min_coord
{-1, -1},
m_max_coord
{-1, -1} {}
39
40
MeasurementFrameGroupRectangle
(
PixelCoordinate
min_coord,
PixelCoordinate
max_coord):
41
m_min_coord
{min_coord},
m_max_coord
(max_coord) {
42
assert(min_coord.
m_x
<= max_coord.
m_x
&& min_coord.
m_y
<= max_coord.
m_y
);
43
}
44
45
PixelCoordinate
getTopLeft
()
const
{
46
assert(
m_max_coord
.
m_x
>= 0);
47
return
m_min_coord
;
48
}
49
50
PixelCoordinate
getBottomRight
()
const
{
51
assert(
m_max_coord
.
m_x
>= 0);
52
return
m_max_coord
;
53
}
54
55
int
getWidth
()
const
{
56
if
(
m_max_coord
.
m_x
< 0)
57
return
0;
58
return
m_max_coord
.
m_x
-
m_min_coord
.
m_x
+ 1;
59
}
60
61
int
getHeight
()
const
{
62
if
(
m_max_coord
.
m_x
< 0)
63
return
0;
64
return
m_max_coord
.
m_y
-
m_min_coord
.
m_y
+ 1;
65
}
66
67
bool
isOutsideOfFrame
()
const
{
68
return
m_min_coord
.
m_x
< 0;
69
}
70
71
private
:
72
PixelCoordinate
m_min_coord
,
m_max_coord
;
73
};
74
75
}
// end SourceXtractor
76
77
#endif
// _SEIMPLEMENTATION_PLUGIN_MEASUREMENTFRAMEGROUPRECTANGLE_MEASUREMENTFRAMEGROUPRECTANGLE_H_
Image.h
Property.h
SourceXtractor::MeasurementFrameGroupRectangle
Definition:
MeasurementFrameGroupRectangle.h:33
SourceXtractor::MeasurementFrameGroupRectangle::m_min_coord
PixelCoordinate m_min_coord
Definition:
MeasurementFrameGroupRectangle.h:72
SourceXtractor::MeasurementFrameGroupRectangle::~MeasurementFrameGroupRectangle
virtual ~MeasurementFrameGroupRectangle()=default
SourceXtractor::MeasurementFrameGroupRectangle::m_max_coord
PixelCoordinate m_max_coord
Definition:
MeasurementFrameGroupRectangle.h:72
SourceXtractor::MeasurementFrameGroupRectangle::getBottomRight
PixelCoordinate getBottomRight() const
Definition:
MeasurementFrameGroupRectangle.h:50
SourceXtractor::MeasurementFrameGroupRectangle::isOutsideOfFrame
bool isOutsideOfFrame() const
Definition:
MeasurementFrameGroupRectangle.h:67
SourceXtractor::MeasurementFrameGroupRectangle::getHeight
int getHeight() const
Definition:
MeasurementFrameGroupRectangle.h:61
SourceXtractor::MeasurementFrameGroupRectangle::getTopLeft
PixelCoordinate getTopLeft() const
Definition:
MeasurementFrameGroupRectangle.h:45
SourceXtractor::MeasurementFrameGroupRectangle::getWidth
int getWidth() const
Definition:
MeasurementFrameGroupRectangle.h:55
SourceXtractor::MeasurementFrameGroupRectangle::MeasurementFrameGroupRectangle
MeasurementFrameGroupRectangle(PixelCoordinate min_coord, PixelCoordinate max_coord)
Definition:
MeasurementFrameGroupRectangle.h:40
SourceXtractor::MeasurementFrameGroupRectangle::MeasurementFrameGroupRectangle
MeasurementFrameGroupRectangle()
Definition:
MeasurementFrameGroupRectangle.h:37
SourceXtractor::Property
Base class for all Properties. (has no actual content)
Definition:
Property.h:33
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.9.1