5#include "affine_matrix_2d.hpp"
6#include "matrix_2d.hpp"
52 CExports::CoordinateMapTransformArea(*
reinterpret_cast<CExports::TArea *
>(&area),
53 *
reinterpret_cast<CExports::TCoordinateMap *
>(&affineMatrix),
54 reinterpret_cast<CExports::TArea &
>(*
this));
67 Area2D(
double x0,
double y0,
double x1,
double y1,
double x2,
double y2) noexcept
67 Area2D(
double x0,
double y0,
double x1,
double y1,
double x2,
double y2) noexcept {
…}
78 :
Area2D(rect.Left(), rect.Top(), rect.Right(), rect.Top(), rect.Left(), rect.Bottom())
87 explicit Area2D(
double radius) noexcept
88 :
Area2D(-radius, -radius, -radius, radius, radius, -radius)
87 explicit Area2D(
double radius) noexcept {
…}
159 return p1_ + p2_ - p0_;
170 ExpandBBByPoint(bb, p1_);
171 ExpandBBByPoint(bb, p2_);
172 ExpandBBByPoint(bb,
P3());
184 auto vP0P2 = p2_ - p0_;
185 auto vP0P1 = p1_ - p0_;
198 auto vP0P2 = p2_ - p0_;
199 auto vP0P1 = p1_ - p0_;
200 return std::abs(vP0P2.X() * vP0P1.Y() - vP0P2.Y() * vP0P1.X());
222 p0_ = affineMatrix * p0_;
223 p1_ = affineMatrix * p1_;
224 p2_ = affineMatrix * p2_;
259 return p0_ == area.p0_ && p1_ == area.p1_ && p2_ == area.p2_;
270 return !(*
this == area);
276 if (p.
X() < bb.
Left())
278 else if (p.
X() > bb.
Right())
280 if (p.
Y() < bb.
Top())
Compacted affine matrix describing the Common Vision Blox coordinate system.
Definition affine_matrix_2d.hpp:17
Point2D< double > P2() const noexcept
Gets P2 of the area (top right corner).
Definition area_2d.hpp:137
void SetP2(Point2D< double > p2) noexcept
Sets P2 of the area (top right corner).
Definition area_2d.hpp:147
Point2D< double > P0() const noexcept
Gets P0 of the area (top left corner).
Definition area_2d.hpp:97
double Area() const noexcept
Size (in pixels) of the area of interest.
Definition area_2d.hpp:196
void Transform(AffineMatrix2D affineMatrix) noexcept
Transform this Area2D using a AffineMatrix2D.
Definition area_2d.hpp:220
Area2D(double radius) noexcept
Constructor for Area2D.
Definition area_2d.hpp:87
void Transform(Matrix2D matrix) noexcept
Transform this Area2D using a matrix.
Definition area_2d.hpp:208
bool operator==(const Area2D &area) const noexcept
Compares to an other area.
Definition area_2d.hpp:257
Point2D< double > P3() const noexcept
Gets the calculated P3 of the area (lower right corner).
Definition area_2d.hpp:157
void SetP1(Point2D< double > p1) noexcept
Sets P1 of the area (lower left corner).
Definition area_2d.hpp:127
bool operator!=(const Area2D &area) const noexcept
Compares to an other area.
Definition area_2d.hpp:268
Area2D(Rect< double > rect, AffineMatrix2D affineMatrix) noexcept
Creates an area from the given rectangle using a transformation.
Definition area_2d.hpp:49
Area2D(double x0, double y0, double x1, double y1, double x2, double y2) noexcept
Constructor for Area2D.
Definition area_2d.hpp:67
Area2D() noexcept=default
Default constructor for an empty area.
void SetP0(Point2D< double > p0) noexcept
Sets P0 of the area (top left corner).
Definition area_2d.hpp:107
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:246
Area2D(Rect< double > rect) noexcept
Create an area from the given rectangle.
Definition area_2d.hpp:77
Rect< double > BoundingRectangle() const noexcept
Gets the bounding box of this area.
Definition area_2d.hpp:167
Size2D< double > Size() const noexcept
Size (width and height) of the area of interest.
Definition area_2d.hpp:182
void SwapOrientation() noexcept
Let the vertices P1 and P2 swap their place.
Definition area_2d.hpp:233
Point2D< double > P1() const noexcept
Gets P1 of the area (lower left corner).
Definition area_2d.hpp:117
Double precision 2x2 matrix class.
Definition matrix_2d.hpp:16
Multi-purpose 2D vector class.
Definition point_2d.hpp:20
T X() const noexcept
Gets the x-component of the point.
Definition point_2d.hpp:84
T Y() const noexcept
Gets the y-component of the point.
Definition point_2d.hpp:104
Rectangle object.
Definition rect.hpp:24
T Bottom() const noexcept
Gets bottom row of the rectangle (still inside the rectangle).
Definition rect.hpp:144
void SetRight(T right) noexcept
Sets rightmost column of the rectangle (still inside the rectangle).
Definition rect.hpp:134
void SetBottom(T bottom) noexcept
Sets bottom row of the rectangle (still inside the rectangle).
Definition rect.hpp:154
void SetLeft(T left) noexcept
Sets first column of the rectangle.
Definition rect.hpp:94
T Top() const noexcept
Gets first row of the rectangle.
Definition rect.hpp:104
T Right() const noexcept
Gets rightmost column of the rectangle (still inside the rectangle).
Definition rect.hpp:124
T Left() const noexcept
Gets first column of the rectangle.
Definition rect.hpp:84
void SetTop(T top) noexcept
Sets first row of the rectangle.
Definition rect.hpp:114
Stores a pair of numbers that represents the width and the height of a subject, typically a rectangle...
Definition size_2d.hpp:20
Root namespace for the Image Manager interface.
Definition c_bayer_to_rgb.h:17
CoordinateSystemType
Enumeration of the different available coordinate systems that an Area of interest may be defined in.
Definition global.hpp:290
@ ImageCoordinates
Definition global.hpp:307