SourceXtractorPlusPlus
0.19
SourceXtractor++, the next generation SExtractor
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
SEImplementation
SEImplementation
Plugin
MeasurementFrameRectangle
MeasurementFrameRectangle.h
Go to the documentation of this file.
1
17
/*
18
* MeasurementFrameRectangle.h
19
*
20
* Created on: Sep 24, 2018
21
* Author: Alejandro Alvarez Ayllon
22
*/
23
24
#ifndef _SEIMPLEMENTATION_PLUGIN_MEASUREMENTFRAMERECTANGLE_MEASUREMENTFRAMERECTANGLE_H_
25
#define _SEIMPLEMENTATION_PLUGIN_MEASUREMENTFRAMERECTANGLE_MEASUREMENTFRAMERECTANGLE_H_
26
27
#include "
SEUtils/PixelRectangle.h
"
28
29
#include "
SEFramework/Property/Property.h
"
30
#include "
SEFramework/Image/Image.h
"
31
32
namespace
SourceXtractor {
33
34
class
MeasurementFrameRectangle
:
public
Property
{
35
public
:
36
virtual
~MeasurementFrameRectangle
() =
default
;
37
38
explicit
MeasurementFrameRectangle
(
bool
bad_projection):
39
m_min_coord
{-1, -1},
m_max_coord
{-1, -1},
m_bad_projection
{bad_projection}{}
40
41
MeasurementFrameRectangle
(
PixelCoordinate
min_coord,
PixelCoordinate
max_coord):
42
m_min_coord
{min_coord},
m_max_coord
{max_coord},
m_bad_projection
{
false
} {
43
assert(min_coord.m_x <= max_coord.m_x && min_coord.m_y <= max_coord.m_y);
44
}
45
46
PixelCoordinate
getTopLeft
()
const
{
47
assert(
m_max_coord
.
m_x
>= 0);
48
return
m_min_coord
;
49
}
50
51
PixelCoordinate
getBottomRight
()
const
{
52
assert(
m_max_coord
.
m_x
>= 0);
53
return
m_max_coord
;
54
}
55
56
int
getWidth
()
const
{
57
if
(
m_max_coord
.
m_x
< 0)
58
return
0;
59
return
m_max_coord
.
m_x
-
m_min_coord
.
m_x
+ 1;
60
}
61
62
int
getHeight
()
const
{
63
if
(
m_max_coord
.
m_x
< 0)
64
return
0;
65
return
m_max_coord
.
m_y
-
m_min_coord
.
m_y
+ 1;
66
}
67
68
PixelRectangle
getRect
()
const
{
69
return
PixelRectangle
(
m_min_coord
,
m_max_coord
);
70
}
71
72
bool
badProjection
()
const
{
73
return
m_bad_projection
;
74
}
75
76
private
:
77
PixelCoordinate
m_min_coord
,
m_max_coord
;
78
bool
m_bad_projection
;
79
};
80
81
}
// end SourceXtractor
82
83
#endif // _SEIMPLEMENTATION_PLUGIN_MEASUREMENTFRAMERECTANGLE_MEASUREMENTFRAMERECTANGLE_H_
SourceXtractor::PixelCoordinate::m_y
int m_y
Definition:
PixelCoordinate.h:38
PixelRectangle.h
SourceXtractor::MeasurementFrameRectangle::getHeight
int getHeight() const
Definition:
MeasurementFrameRectangle.h:62
SourceXtractor::MeasurementFrameRectangle::m_min_coord
PixelCoordinate m_min_coord
Definition:
MeasurementFrameRectangle.h:77
SourceXtractor::MeasurementFrameRectangle::getWidth
int getWidth() const
Definition:
MeasurementFrameRectangle.h:56
Property.h
SourceXtractor::MeasurementFrameRectangle
Definition:
MeasurementFrameRectangle.h:34
SourceXtractor::MeasurementFrameRectangle::badProjection
bool badProjection() const
Definition:
MeasurementFrameRectangle.h:72
SourceXtractor::Property
Base class for all Properties. (has no actual content)
Definition:
Property.h:33
Image.h
SourceXtractor::MeasurementFrameRectangle::~MeasurementFrameRectangle
virtual ~MeasurementFrameRectangle()=default
SourceXtractor::MeasurementFrameRectangle::getTopLeft
PixelCoordinate getTopLeft() const
Definition:
MeasurementFrameRectangle.h:46
SourceXtractor::PixelCoordinate
A pixel coordinate made of two integers m_x and m_y.
Definition:
PixelCoordinate.h:37
SourceXtractor::MeasurementFrameRectangle::getBottomRight
PixelCoordinate getBottomRight() const
Definition:
MeasurementFrameRectangle.h:51
SourceXtractor::MeasurementFrameRectangle::MeasurementFrameRectangle
MeasurementFrameRectangle(bool bad_projection)
Definition:
MeasurementFrameRectangle.h:38
SourceXtractor::PixelRectangle
Definition:
PixelRectangle.h:15
SourceXtractor::MeasurementFrameRectangle::m_bad_projection
bool m_bad_projection
Definition:
MeasurementFrameRectangle.h:78
SourceXtractor::MeasurementFrameRectangle::MeasurementFrameRectangle
MeasurementFrameRectangle(PixelCoordinate min_coord, PixelCoordinate max_coord)
Definition:
MeasurementFrameRectangle.h:41
SourceXtractor::MeasurementFrameRectangle::getRect
PixelRectangle getRect() const
Definition:
MeasurementFrameRectangle.h:68
SourceXtractor::MeasurementFrameRectangle::m_max_coord
PixelCoordinate m_max_coord
Definition:
MeasurementFrameRectangle.h:77
SourceXtractor::PixelCoordinate::m_x
int m_x
Definition:
PixelCoordinate.h:38
Generated by
1.8.5