Face Engine SDK
5.25.0
A face detection, recognition and tracking engine.
|
Rectangle. More...
#include <Rect.h>
Public Types | |
typedef Type | ElementType |
Public Member Functions | |
BaseRect () noexcept | |
Initializes a default invalid rectangle. | |
BaseRect (Type x_, Type y_, Type w_, Type h_) noexcept | |
Initializes a rectangle with given values. | |
BaseRect (const Vector2< Type > &topLeft, const Vector2< Type > &bottomRight) noexcept | |
Initializes a rectangle with given values. | |
BaseRect (const BaseRect &other) noexcept | |
Copies another rect. | |
template<typename OtherType > | |
BaseRect (const BaseRect< OtherType > &other) noexcept | |
void | setLeft (Type l) noexcept |
Set rect left. | |
void | setTop (Type t) noexcept |
Set rect top. | |
void | setRight (Type r) noexcept |
Set rect right. | |
void | setBottom (Type b) noexcept |
Set rect bottom. | |
template<typename OtherType > | |
BaseRect & | operator= (const BaseRect< OtherType > &other) noexcept |
Copies another rect. | |
template<typename OtherType > | |
bool | operator== (const BaseRect< OtherType > &other) const noexcept |
Checks whether two rects are equal. | |
template<typename OtherType > | |
bool | operator!= (const BaseRect< OtherType > &other) const noexcept |
Checks whether two rects are not equal. | |
BaseRect | operator& (const BaseRect &other) const noexcept |
Returns rect that is intersection of rects. | |
BaseRect | operator&= (const BaseRect &other) noexcept |
Returns rect that is intersection of rects. | |
BaseRect | operator| (const BaseRect &other) const noexcept |
Returns minimum area rectangle containing both rects. | |
BaseRect | operator|= (const BaseRect &other) noexcept |
Returns minimum area rectangle containing both rects. | |
BaseRect | operator* (float scaleFactor) const noexcept |
Multiplicates Rect scale by specified scale factor. | |
BaseRect | operator/ (float scaleFactor) const noexcept |
Divides Rect scale by specified scale factor. | |
BaseRect | operator+ (Vector2< typename BaseRect::ElementType > vec) |
BaseRect | operator- (Vector2< typename BaseRect::ElementType > vec) |
Vector2< Type > | size () const noexcept |
Gets rect size (width, height). | |
Vector2< Type > | topLeft () const noexcept |
Gets rect top-left corner coordinates. | |
Vector2< Type > | center () const noexcept |
Gets rect center coordinates. | |
Vector2< Type > | bottomRight () const noexcept |
Gets rect bottom-right corner coordinates. | |
Type | top () const noexcept |
Gets rect top y coordinate. | |
Type | bottom () const noexcept |
Gets rect bottom y coordinate. | |
Type | left () const noexcept |
Gets rect left x coordinate. | |
Type | right () const noexcept |
Gets rect right x coordinate. | |
void | set (const Vector2< Type > &topLeft, const Vector2< Type > &bottomRight) noexcept |
Sets rect corner coordinates. | |
void | adjust (Type dx, Type dy, Type dw, Type dh) noexcept |
Adjusts the rect by given amounts. | |
BaseRect | adjusted (Type dx, Type dy, Type dw, Type dh) const noexcept |
Copies and adjusts the rect by given amounts. | |
Type | getArea () const noexcept |
Computes rect area (width x height). | |
bool | inside (const BaseRect &other) const noexcept |
Checks whether this rect is inside of another rect. | |
bool | isValid () const noexcept |
Checks whether a rect is valid. | |
Static Public Member Functions | |
static BaseRect | coords (Type x0, Type y0, Type x1, Type y1) noexcept |
Create new Rect by coordinates. | |
static float | intersectionOverFirstRect (const BaseRect &rect1, const BaseRect &rect2) |
Calculates rects intersection rate over first rect. | |
static float | intersectionOverUnion (const BaseRect &rect1, const BaseRect &rect2) |
Calculates rects intersection rate over union. | |
static float | intersectionOverForeground (const BaseRect &rect1, const BaseRect &rect2) |
Calculates rects intersection rate over foreground. | |
Public Attributes | |
Type | x |
Upper left corner x-coordinate. | |
Type | y |
Upper left corner y-coordinate. | |
Type | width |
Rectangle width. | |
Type | height |
Rectangle height. |
Rectangle.
fsdk::BaseRect< Type >::BaseRect | ( | Type | x_, |
Type | y_, | ||
Type | w_, | ||
Type | h_ | ||
) | [inline] |
Initializes a rectangle with given values.
[in] | x_ | upper left corner x coordinate. |
[in] | y_ | upper left corner y coordinate. |
[in] | w_ | width. |
[in] | h_ | height. |
fsdk::BaseRect< Type >::BaseRect | ( | const Vector2< Type > & | topLeft, |
const Vector2< Type > & | bottomRight | ||
) | [inline] |
Initializes a rectangle with given values.
[in] | topLeft | top-left corner point. |
[in] | bottomRight | bottom-right corner point. |
fsdk::BaseRect< Type >::BaseRect | ( | const BaseRect< Type > & | other | ) | [inline] |
Copies another rect.
[in] | other | another rect. |
void fsdk::BaseRect< Type >::adjust | ( | Type | dx, |
Type | dy, | ||
Type | dw, | ||
Type | dh | ||
) | [inline] |
Adjusts the rect by given amounts.
[in] | dx | adjustment for upper left corner x coordinate. |
[in] | dy | adjustment for upper left corner y coordinate. |
[in] | dw | adjustment for width. |
[in] | dh | adjustment for height. |
BaseRect fsdk::BaseRect< Type >::adjusted | ( | Type | dx, |
Type | dy, | ||
Type | dw, | ||
Type | dh | ||
) | const [inline] |
Copies and adjusts the rect by given amounts.
[in] | dx | adjustment for upper left corner x coordinate. |
[in] | dy | adjustment for upper left corner y coordinate. |
[in] | dw | adjustment for width. |
[in] | dh | adjustment for height. |
Type fsdk::BaseRect< Type >::bottom | ( | ) | const [inline] |
Gets rect bottom y coordinate.
Vector2<Type> fsdk::BaseRect< Type >::bottomRight | ( | ) | const [inline] |
Gets rect bottom-right corner coordinates.
Vector2<Type> fsdk::BaseRect< Type >::center | ( | ) | const [inline] |
Gets rect center coordinates.
static BaseRect fsdk::BaseRect< Type >::coords | ( | Type | x0, |
Type | y0, | ||
Type | x1, | ||
Type | y1 | ||
) | [inline, static] |
Create new Rect by coordinates.
[in] | left | coord. |
[in] | top | coord. |
[in] | right | coord. |
[in] | bottom | coord. |
Type fsdk::BaseRect< Type >::getArea | ( | ) | const [inline] |
Computes rect area (width x height).
bool fsdk::BaseRect< Type >::inside | ( | const BaseRect< Type > & | other | ) | const [inline] |
Checks whether this rect is inside of another rect.
[in] | other | rect to check against. |
static float fsdk::BaseRect< Type >::intersectionOverFirstRect | ( | const BaseRect< Type > & | rect1, |
const BaseRect< Type > & | rect2 | ||
) | [inline, static] |
Calculates rects intersection rate over first rect.
[in] | rect1 | first rect |
[in] | rect2 | second rect |
static float fsdk::BaseRect< Type >::intersectionOverForeground | ( | const BaseRect< Type > & | rect1, |
const BaseRect< Type > & | rect2 | ||
) | [inline, static] |
Calculates rects intersection rate over foreground.
[in] | rect1 | first rect |
[in] | rect2 | second rect |
static float fsdk::BaseRect< Type >::intersectionOverUnion | ( | const BaseRect< Type > & | rect1, |
const BaseRect< Type > & | rect2 | ||
) | [inline, static] |
Calculates rects intersection rate over union.
[in] | rect1 | first rect |
[in] | rect2 | second rect |
bool fsdk::BaseRect< Type >::isValid | ( | ) | const [inline] |
Checks whether a rect is valid.
A rect is considered valid if it has positive width and weight.
Type fsdk::BaseRect< Type >::left | ( | ) | const [inline] |
Gets rect left x coordinate.
bool fsdk::BaseRect< Type >::operator!= | ( | const BaseRect< OtherType > & | other | ) | const [inline] |
Checks whether two rects are not equal.
[in] | other | another rect. |
BaseRect fsdk::BaseRect< Type >::operator& | ( | const BaseRect< Type > & | other | ) | const [inline] |
Returns rect that is intersection of rects.
[in] | other | rectangle |
BaseRect fsdk::BaseRect< Type >::operator&= | ( | const BaseRect< Type > & | other | ) | [inline] |
Returns rect that is intersection of rects.
[in] | other | rectangle |
BaseRect fsdk::BaseRect< Type >::operator* | ( | float | scaleFactor | ) | const [inline] |
Multiplicates Rect scale by specified scale factor.
[in] | scaleFactor | to scale rect |
BaseRect fsdk::BaseRect< Type >::operator/ | ( | float | scaleFactor | ) | const [inline] |
Divides Rect scale by specified scale factor.
[in] | scaleFactor | to scale rect |
BaseRect& fsdk::BaseRect< Type >::operator= | ( | const BaseRect< OtherType > & | other | ) | [inline] |
Copies another rect.
[in] | other | another rect. |
bool fsdk::BaseRect< Type >::operator== | ( | const BaseRect< OtherType > & | other | ) | const [inline] |
Checks whether two rects are equal.
[in] | other | another rect. |
BaseRect fsdk::BaseRect< Type >::operator| | ( | const BaseRect< Type > & | other | ) | const [inline] |
Returns minimum area rectangle containing both rects.
[in] | other | rectangle |
BaseRect fsdk::BaseRect< Type >::operator|= | ( | const BaseRect< Type > & | other | ) | [inline] |
Returns minimum area rectangle containing both rects.
[in] | other | rectangle |
Type fsdk::BaseRect< Type >::right | ( | ) | const [inline] |
Gets rect right x coordinate.
void fsdk::BaseRect< Type >::set | ( | const Vector2< Type > & | topLeft, |
const Vector2< Type > & | bottomRight | ||
) | [inline] |
Sets rect corner coordinates.
[in] | topLeft | top-left corner point. |
[in] | bottomRight | bottom-right corner point. |
void fsdk::BaseRect< Type >::setBottom | ( | Type | b | ) | [inline] |
Set rect bottom.
b | bottom. |
void fsdk::BaseRect< Type >::setLeft | ( | Type | l | ) | [inline] |
Set rect left.
l | left. |
void fsdk::BaseRect< Type >::setRight | ( | Type | r | ) | [inline] |
Set rect right.
r | right. |
void fsdk::BaseRect< Type >::setTop | ( | Type | t | ) | [inline] |
Set rect top.
t | top. |
Vector2<Type> fsdk::BaseRect< Type >::size | ( | ) | const [inline] |
Gets rect size (width, height).
Type fsdk::BaseRect< Type >::top | ( | ) | const [inline] |
Gets rect top y coordinate.
Vector2<Type> fsdk::BaseRect< Type >::topLeft | ( | ) | const [inline] |
Gets rect top-left corner coordinates.