Enrollment 28.2.0
Loading...
Searching...
No Matches

It holds rectangle vertexes, width, height. More...

#include <ImageAttribute.h>

Collaboration diagram for Rectangle:

Public Types

using Dimension = float
 The rectangle dimension.
using Height = Dimension
 Rectangle height.
using Width = Dimension
 Rectangle width.

Public Member Functions

const Point & GetTopLeft () const
 Provides top-left vertex.
const Point & GetTopRight () const
 Provides top-right vertex.
const Point & GetBottomRight () const
 Provides bottom-right vertex.
const Point & GetBottomLeft () const
 Provides bottom-left vertex.
Width GetWidth () const
 Provides width of rectangle The width is distance between top-left and top-right vertexes.
Height GetHeight () const
 Provides height of rectangle The height is distance between bottom-left and top-left vertexes.
Rectangle Resize (Width w, Height h) const
 Resize rectangle to given width and height.
Point CalculateCenter () const
 Calculates the center point of the rectangle.
void WriteTo (Writer &writer) const final
 Write itself into writer.
 Rectangle (Point topLeftPoint, Point topRightPoint, Point bottomRightPoint, Point bottomLeftPoint)
 Constructor store given coordinates.
 Rectangle (Point topLeftPoint, Point topRightPoint, Point bottomRightPoint, Point bottomLeftPoint, std::shared_ptr< ImageExecutor > executor)
 Constructor store given coordinates.

Detailed Description

It holds rectangle vertexes, width, height.

The vertexes may not be rectangular. When SDK need real rectangle for its functionality it will use minimal bounding rectangle around given vertexes.

Member Typedef Documentation

◆ Dimension

using Dimension = float

The rectangle dimension.

It is not integer because rectangle can be rotated.

Constructor & Destructor Documentation

◆ Rectangle() [1/2]

Rectangle ( Point topLeftPoint,
Point topRightPoint,
Point bottomRightPoint,
Point bottomLeftPoint )
inline

Constructor store given coordinates.

The GlobalImageExecutor is used.

Parameters
topLeftPointtop left point
topRightPointtop right point
bottomLeftPointbottom left point
bottomRightPointbottom right point
Exceptions
EnrollmentExceptionwhen rectangle dimensions can not be calculated.

References Rectangle().

Referenced by Rectangle(), and Resize().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Rectangle() [2/2]

Rectangle ( Point topLeftPoint,
Point topRightPoint,
Point bottomRightPoint,
Point bottomLeftPoint,
std::shared_ptr< ImageExecutor > executor )
inline

Constructor store given coordinates.

Parameters
topLeftPointtop left point
topRightPointtop right point
bottomLeftPointbottom left point
bottomRightPointbottom right point
executorImageExecutor to modify rectangle
Exceptions
EnrollmentExceptionwhen rectangle dimensions can not be calculated.
NullArgumentExceptionwhen executor is null

Member Function Documentation

◆ CalculateCenter()

Point CalculateCenter ( ) const
inlinenodiscard

Calculates the center point of the rectangle.

Returns
Point representing the center of the rectangle.

Referenced by Circle::CreateInscribedCircle().

Here is the caller graph for this function:

◆ GetBottomLeft()

const Point & GetBottomLeft ( ) const
inlinenodiscard

Provides bottom-left vertex.

Returns
bottom-left vertex

Referenced by Image::CropAlignedRectangle(), Image::CropRectangle(), and Image::RectangleIntersection().

Here is the caller graph for this function:

◆ GetBottomRight()

const Point & GetBottomRight ( ) const
inlinenodiscard

Provides bottom-right vertex.

Returns
bottom-right vertex

Referenced by Image::CropAlignedRectangle(), Image::CropRectangle(), and Image::RectangleIntersection().

Here is the caller graph for this function:

◆ GetHeight()

Height GetHeight ( ) const
inlinenodiscard

Provides height of rectangle The height is distance between bottom-left and top-left vertexes.

When given vertexes are not rectangular then minimal bounding rectangle is calculated and height of the rectangle is returned.

Returns
height

Referenced by Circle::CreateInscribedCircle(), and Image::CropAlignedRectangle().

Here is the caller graph for this function:

◆ GetTopLeft()

const Point & GetTopLeft ( ) const
inlinenodiscard

Provides top-left vertex.

Returns
top-left vertex

Referenced by Image::CropAlignedRectangle(), Image::CropRectangle(), and Image::RectangleIntersection().

Here is the caller graph for this function:

◆ GetTopRight()

const Point & GetTopRight ( ) const
inlinenodiscard

Provides top-right vertex.

Returns
top-right vertex

Referenced by Image::CropAlignedRectangle(), Image::CropRectangle(), and Image::RectangleIntersection().

Here is the caller graph for this function:

◆ GetWidth()

Width GetWidth ( ) const
inlinenodiscard

Provides width of rectangle The width is distance between top-left and top-right vertexes.

When given vertexes are not rectangular then minimal bounding rectangle is calculated and width of the rectangle is returned.

Returns
width

Referenced by Circle::CreateInscribedCircle(), and Image::CropAlignedRectangle().

Here is the caller graph for this function:

◆ Resize()

Rectangle Resize ( Width w,
Height h ) const
inlinenodiscard

Resize rectangle to given width and height.

Parameters
wwidth of new rectangle
hheight of new rectangle
Returns
new resized rectangle
Exceptions
EnrollmentInvalidArgumentExceptionwhen width is 1 or less
EnrollmentInvalidArgumentExceptionwhen height is 1 or less
EnrollmentExceptionwhen it is not possible to resize rectangle

References Rectangle().

Here is the call graph for this function:

◆ WriteTo()

void WriteTo ( Writer & writer) const
inlinefinalvirtual

Write itself into writer.

Parameters
writerWriter to use to serialize this Serializable

Implements Serializable.


The documentation for this class was generated from the following file: