CVB++ 15.0
Area2D Class Referencefinal

Structure that represents an area of interest in the image. More...

#include <cvb/area_2d.hpp>

Public Member Functions

 Area2D () noexcept=default
 Default constructor for an empty area. More...
 
 Area2D (Point2D< double > p0, Point2D< double > p1, Point2D< double > p2) noexcept
 Constructor for an area. More...
 
 Area2D (Rect< double > rect, AffineMatrix2D affineMatrix) noexcept
 Creates an area from the given rectangle using a transformation. More...
 
 Area2D (double x0, double y0, double x1, double y1, double x2, double y2) noexcept
 Constructor for Area2D. More...
 
 Area2D (Rect< double > rect) noexcept
 Create an area from the given rectangle. More...
 
 Area2D (double radius) noexcept
 Constructor for Area2D. More...
 
Point2D< double > P0 () const noexcept
 Gets P0 of the area (top left corner). More...
 
void SetP0 (Point2D< double > p0) noexcept
 Sets P0 of the area (top left corner). More...
 
Point2D< double > P1 () const noexcept
 Gets P1 of the area (lower left corner). More...
 
void SetP1 (Point2D< double > p1) noexcept
 Sets P1 of the area (lower left corner). More...
 
Point2D< double > P2 () const noexcept
 Gets P2 of the area (top right corner). More...
 
void SetP2 (Point2D< double > p2) noexcept
 Sets P2 of the area (top right corner). More...
 
Point2D< double > P3 () const noexcept
 Gets the calculated P3 of the area (lower right corner). More...
 
Rect< double > BoundingRectangle () const noexcept
 Gets the bounding box of this area. More...
 
Size2D< double > Size () const noexcept
 Size (width and height) of the area of interest. More...
 
double Area () const noexcept
 Size (in pixels) of the area of interest. More...
 
void Transform (Matrix2D matrix) noexcept
 Transform this Area2D using a matrix. More...
 
void Transform (AffineMatrix2D affineMatrix) noexcept
 Transform this Area2D using a AffineMatrix2D. More...
 
void SwapOrientation () noexcept
 Let the vertices P1 and P2 swap their place. More...
 
CoordinateSystemType CoordinateSystem () const noexcept
 Indicates the coordinate system, in which this object is being measured (when used as an area of interest). More...
 
bool operator== (const Area2D &area) const noexcept
 Compares to an other area. More...
 
bool operator!= (const Area2D &area) const noexcept
 Compares to an other area. More...
 

Detailed Description

Structure that represents an area of interest in the image.

The pixels of this type are always specified in image coordinates.

Examples
Minos/QmlMinos, ShapeFinder2/QtShapeFinder2, and ShapeFinder2/QtShapeFinder2Cuda.

Constructor & Destructor Documentation

◆ Area2D() [1/6]

Area2D ( )
defaultnoexcept

Default constructor for an empty area.

Exceptions
Doesnot throw any exception.

◆ Area2D() [2/6]

Area2D ( Point2D< double >  p0,
Point2D< double >  p1,
Point2D< double >  p2 
)
inlinenoexcept

Constructor for an area.

Parameters
[in]p0P0 (top left corner of the area).
[in]p1P1 (top right corner of the area).
[in]p2P2 (bottom left corner of the area).
Exceptions
Doesnot throw any exception.

◆ Area2D() [3/6]

Area2D ( Rect< double >  rect,
AffineMatrix2D  affineMatrix 
)
inlinenoexcept

Creates an area from the given rectangle using a transformation.

Parameters
[in]rectRectangle to convert to image coordinates via the matrix.
[in]affineMatrixAffine matrix to transform pixel coordinates to image.
Exceptions
Doesnot throw any exception.

◆ Area2D() [4/6]

Area2D ( double  x0,
double  y0,
double  x1,
double  y1,
double  x2,
double  y2 
)
inlinenoexcept

Constructor for Area2D.

Parameters
[in]x0X component of P0.
[in]y0Y component of P0.
[in]x1X component of P1.
[in]y1Y component of P1.
[in]x2X component of P2.
[in]y2Y component of P2.
Exceptions
Doesnot throw any exception.

◆ Area2D() [5/6]

Area2D ( Rect< double >  rect)
inlineexplicitnoexcept

Create an area from the given rectangle.

Parameters
[in]rectRectangle to create the Area2D from.
Exceptions
Doesnot throw any exception.

◆ Area2D() [6/6]

Area2D ( double  radius)
inlineexplicitnoexcept

Constructor for Area2D.

Parameters
[in]radiusRadius to construct the area with.
Exceptions
Doesnot throw any exception.

Member Function Documentation

◆ Area()

double Area ( ) const
inlinenoexcept

Size (in pixels) of the area of interest.

Returns
The size in pixels.
Exceptions
Doesnot throw any exception.

As the area is a parallelogram the area (in pixels) is not simply "width * height".

◆ BoundingRectangle()

Rect< double > BoundingRectangle ( ) const
inlinenoexcept

Gets the bounding box of this area.

Returns
The bounding rectangle of this area.
Exceptions
Doesnot throw any exception.

◆ CoordinateSystem()

CoordinateSystemType CoordinateSystem ( ) const
inlinenoexcept

Indicates the coordinate system, in which this object is being measured (when used as an area of interest).

Returns
The coordinate system type.
Exceptions
Doesnot throw any exception.

◆ operator!=()

bool operator!= ( const Area2D area) const
inlinenoexcept

Compares to an other area.

Parameters
[in]areaOther area.
Returns
True if not equal, otherwise false.
Exceptions
Doesnot throw any exception.

◆ operator==()

bool operator== ( const Area2D area) const
inlinenoexcept

Compares to an other area.

Parameters
[in]areaOther area.
Returns
True if equal, otherwise false.
Exceptions
Doesnot throw any exception.

◆ P0()

Point2D< double > P0 ( ) const
inlinenoexcept

Gets P0 of the area (top left corner).

Returns
The point.
Exceptions
Doesnot throw any exception.

◆ P1()

Point2D< double > P1 ( ) const
inlinenoexcept

Gets P1 of the area (lower left corner).

Returns
The point.
Exceptions
Doesnot throw any exception.

◆ P2()

Point2D< double > P2 ( ) const
inlinenoexcept

Gets P2 of the area (top right corner).

Returns
The point.
Exceptions
Doesnot throw any exception.

◆ P3()

Point2D< double > P3 ( ) const
inlinenoexcept

Gets the calculated P3 of the area (lower right corner).

Returns
The point.
Exceptions
Doesnot throw any exception.

◆ SetP0()

void SetP0 ( Point2D< double >  p0)
inlinenoexcept

Sets P0 of the area (top left corner).

Parameters
[in]p0The point.
Exceptions
Doesnot throw any exception.

◆ SetP1()

void SetP1 ( Point2D< double >  p1)
inlinenoexcept

Sets P1 of the area (lower left corner).

Parameters
[in]p1The point.
Exceptions
Doesnot throw any exception.

◆ SetP2()

void SetP2 ( Point2D< double >  p2)
inlinenoexcept

Sets P2 of the area (top right corner).

Parameters
[in]p2The point.
Exceptions
Doesnot throw any exception.

◆ Size()

Size2D< double > Size ( ) const
inlinenoexcept

Size (width and height) of the area of interest.

Returns
The size.
Exceptions
Doesnot throw any exception.

◆ SwapOrientation()

void SwapOrientation ( )
inlinenoexcept

Let the vertices P1 and P2 swap their place.

Exceptions
Doesnot throw any exception.

Effectively altering the scan direction of the AOI without changing the area covered by the AOI.

◆ Transform() [1/2]

void Transform ( AffineMatrix2D  affineMatrix)
inlinenoexcept

Transform this Area2D using a AffineMatrix2D.

Parameters
[in]affineMatrixMatrix to transform this area with.
Exceptions
Doesnot throw any exception.

◆ Transform() [2/2]

void Transform ( Matrix2D  matrix)
inlinenoexcept

Transform this Area2D using a matrix.

Parameters
[in]matrixMatrix to transform this area with.
Exceptions
Doesnot throw any exception.