5 #include "affine_matrix_2d.hpp" 6 #include "matrix_2d.hpp" 7 #include "point_2d.hpp" 27 Area2D() noexcept =
default;
47 CExports::CoordinateMapTransformArea(*reinterpret_cast<CExports::TArea *>(&area),
48 *reinterpret_cast<CExports::TCoordinateMap *>(&affineMatrix),
49 reinterpret_cast<CExports::TArea &>(*
this));
62 Area2D(
double x0,
double y0,
double x1,
double y1,
double x2,
double y2) noexcept
73 :
Area2D(rect.Left(), rect.Top(), rect.Right(), rect.Top(), rect.Left(), rect.Bottom())
82 Area2D(
double radius) noexcept :
Area2D(-radius, -radius, -radius, radius, radius, -radius) {}
141 ExpandBBByPoint(bb, p1_);
142 ExpandBBByPoint(bb, p2_);
143 ExpandBBByPoint(bb,
P3());
155 auto vP0P2 = p2_ - p0_;
156 auto vP0P1 = p1_ - p0_;
169 auto vP0P2 = p2_ - p0_;
170 auto vP0P1 = p1_ - p0_;
171 return abs(vP0P2.X() * vP0P1.Y() - vP0P2.Y() * vP0P1.X());
193 p0_ = affineMatrix * p0_;
194 p1_ = affineMatrix * p1_;
195 p2_ = affineMatrix * p2_;
224 bool operator==(
const Area2D &area)
const noexcept {
return p0_ == area.p0_ && p1_ == area.p1_ && p2_ == area.p2_; }
237 if (p.
X() < bb.
Left())
239 else if (p.
X() > bb.
Right())
241 if (p.
Y() < bb.
Top())
Structure that represents an area of interest in the image.
Definition: area_2d.hpp:20
void SetTop(T top) noexcept
Sets first row of the rectangle.
Definition: rect.hpp:121
T Top() const noexcept
Gets first row of the rectangle.
Definition: rect.hpp:111
void SetBottom(T bottom) noexcept
Sets bottom row of the rectangle (still inside the rectangle).
Definition: rect.hpp:161
Point2D< double > P3() const noexcept
Gets the calculated P3 of the area (lower right corner).
Definition: area_2d.hpp:131
Area2D() noexcept=default
Default constructor for an empty area.
Rectangle object.
Definition: rect.hpp:25
T Bottom() const noexcept
Gets bottom row of the rectangle (still inside the rectangle).
Definition: rect.hpp:151
Compacted affine matrix describing the Common Vision Blox coordinate system.
Definition: affine_matrix_2d.hpp:17
T Left() const noexcept
Gets first column of the rectangle.
Definition: rect.hpp:91
Point2D< double > P2() const noexcept
Gets P2 of the area (top right corner).
Definition: area_2d.hpp:117
Double precision 2x2 matrix class.
Definition: matrix_2d.hpp:15
void Transform(Matrix2D matrix) noexcept
Transform this Area2D using a matrix.
Definition: area_2d.hpp:179
Root namespace for the Image Manager interface.
Definition: version.hpp:11
Area2D(Point2D< double > p0, Point2D< double > p1, Point2D< double > p2) noexcept
Constructor for an area.
Definition: area_2d.hpp:36
T Y() const noexcept
Gets the y-component of the point.
Definition: point_2d.hpp:106
CoordinateSystemType
Enumeration of the different available coordinate systems that an Area of interest may be defined in.
Definition: global.hpp:263
void SetLeft(T left) noexcept
Sets first column of the rectangle.
Definition: rect.hpp:101
T Right() const noexcept
Gets rightmost column of the rectangle (still inside the rectangle).
Definition: rect.hpp:131
Point2D< double > P0() const noexcept
Gets P0 of the area (top left corner).
Definition: area_2d.hpp:89
void SetP1(Point2D< double > p1) noexcept
Sets P1 of the area (lower left corner).
Definition: area_2d.hpp:110
void SetP0(Point2D< double > p0) noexcept
Sets P0 of the area (top left corner).
Definition: area_2d.hpp:96
void SwapOrientation() noexcept
Let the vertices P1 and P2 swap their place.
Definition: area_2d.hpp:204
Area2D(Rect< double > rect, AffineMatrix2D affineMatrix) noexcept
Creates an area from the given rectangle using a transformation.
Definition: area_2d.hpp:44
T X() const noexcept
Gets the x-component of the point.
Definition: point_2d.hpp:86
CoordinateSystemType CoordinateSystem() const noexcept
Indicates the coordinate system, in which this object is being measured (when used as an area of inte...
Definition: area_2d.hpp:216
Point2D< double > P1() const noexcept
Gets P1 of the area (lower left corner).
Definition: area_2d.hpp:103
Rect< double > BoundingRectangle() const noexcept
Gets the bounding box of this area.
Definition: area_2d.hpp:138
double Area() const noexcept
Size (in pixels) of the area of interest.
Definition: area_2d.hpp:167
void SetRight(T right) noexcept
Sets rightmost column of the rectangle (still inside the rectangle).
Definition: rect.hpp:141
bool operator!=(const Area2D &area) const noexcept
Compares to an other area.
Definition: area_2d.hpp:232
Size2D< double > Size() const noexcept
Size (width and height) of the area of interest.
Definition: area_2d.hpp:153
bool operator==(const Area2D &area) const noexcept
Compares to an other area.
Definition: area_2d.hpp:224
Area2D(Rect< double > rect) noexcept
Create an area from the given rectangle.
Definition: area_2d.hpp:72
void Transform(AffineMatrix2D affineMatrix) noexcept
Transform this Area2D using a AffineMatrix2D.
Definition: area_2d.hpp:191
Area2D(double radius) noexcept
Constructor for Area2D.
Definition: area_2d.hpp:82
Area2D(double x0, double y0, double x1, double y1, double x2, double y2) noexcept
Constructor for Area2D.
Definition: area_2d.hpp:62
void SetP2(Point2D< double > p2) noexcept
Sets P2 of the area (top right corner).
Definition: area_2d.hpp:124