| Face Engine SDK 5.35.0 A face detection, recognition and tracking engine.

Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
fsdk::BaseRect< Type > Struct Template Reference

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. More...
| BaseRect (const Vector2< Type > &topLeft, const Vector2< Type > &bottomRight) noexcept
| Initializes a rectangle with given values. More...
| BaseRect (const BaseRect &other) noexcept
| Copies another rect. More...
template<typename OtherType >
| BaseRect (const BaseRect< OtherType > &other) noexcept
void | setLeft (Type l) noexcept
| Set rect left. More...
void | setTop (Type t) noexcept
| Set rect top. More...
void | setRight (Type r) noexcept
| Set rect right. More...
void | setBottom (Type b) noexcept
| Set rect bottom. More...
template<typename OtherType >
BaseRect & | operator= (const BaseRect< OtherType > &other) noexcept
| Copies another rect. More...
template<typename OtherType >
bool | operator== (const BaseRect< OtherType > &other) const noexcept
| Checks whether two rects are equal. More...
template<typename OtherType >
bool | operator!= (const BaseRect< OtherType > &other) const noexcept
| Checks whether two rects are not equal. More...
BaseRect | operator & (const BaseRect &other) const noexcept
| Returns rect that is intersection of rects. More...
BaseRect | operator &= (const BaseRect &other) noexcept
| Returns rect that is intersection of rects. More...
BaseRect | operator| (const BaseRect &other) const noexcept
| Returns minimum area rectangle containing both rects. More...
BaseRect | operator|= (const BaseRect &other) noexcept
| Returns minimum area rectangle containing both rects. More...
BaseRect | operator* (float scaleFactor) const noexcept
| Multiplicates Rect scale by specified scale factor. More...
BaseRect | operator/ (float scaleFactor) const noexcept
| Divides Rect scale by specified scale factor. More...
BaseRect | operator+ (Vector2< typename BaseRect::ElementType > vec)
BaseRect | operator- (Vector2< typename BaseRect::ElementType > vec)
Vector2< Type > | size () const noexcept
| Gets rect size (width, height). More...
Vector2< Type > | topLeft () const noexcept
| Gets rect top-left corner coordinates. More...
Vector2< Type > | center () const noexcept
| Gets rect center coordinates. More...
Vector2< Type > | bottomRight () const noexcept
| Gets rect bottom-right corner coordinates. More...
Type | top () const noexcept
| Gets rect top y coordinate. More...
Type | bottom () const noexcept
| Gets rect bottom y coordinate. More...
Type | left () const noexcept
| Gets rect left x coordinate. More...
Type | right () const noexcept
| Gets rect right x coordinate. More...
void | set (const Vector2< Type > &topLeft, const Vector2< Type > &bottomRight) noexcept
| Sets rect corner coordinates. More...
void | adjust (Type dx, Type dy, Type dw, Type dh) noexcept
| Adjusts the rect by given amounts. More...
BaseRect | adjusted (Type dx, Type dy, Type dw, Type dh) const noexcept
| Copies and adjusts the rect by given amounts. More...
Type | getArea () const noexcept
| Computes rect area (width x height). More...
bool | inside (const BaseRect &other) const noexcept
| Checks whether this rect is inside of another rect. More...
bool | isValid () const noexcept
| Checks whether a rect is valid. More...

## Static Public Member Functions
static BaseRect | coords (Type x0, Type y0, Type x1, Type y1) noexcept
| Create new Rect by coordinates. More...
static float | intersectionOverFirstRect (const BaseRect &rect1, const BaseRect &rect2)
| Calculates rects intersection rate over first rect. More...
static float | intersectionOverUnion (const BaseRect &rect1, const BaseRect &rect2)
| Calculates rects intersection rate over union. More...
static float | intersectionOverForeground (const BaseRect &rect1, const BaseRect &rect2)
| Calculates rects intersection rate over foreground. More...

## Public Attributes
Type | x
| Upper left corner x-coordinate.
Type | y
| Upper left corner y-coordinate.
Type | width
| Rectangle width.
Type | height
| Rectangle height.

## Detailed Description

### template<typename Type>
struct fsdk::BaseRect< Type >

Rectangle.

## Constructor & Destructor Documentation

## ◆ BaseRect() [1/3]

template<typename Type>

fsdk::BaseRect< Type >::BaseRect | ( | Type | x_,
|  | Type | y_,
|  | Type | w_,
|  | Type | h_
| ) |  |
| inlinenoexcept

Initializes a rectangle with given values.

Parameters

  [in] | x_ | upper left corner x coordinate.
  [in] | y_ | upper left corner y coordinate.
  [in] | w_ | width.
  [in] | h_ | height.

## ◆ BaseRect() [2/3]

template<typename Type>

fsdk::BaseRect< Type >::BaseRect | ( | const Vector2< Type > & | topLeft,
|  | const Vector2< Type > & | bottomRight
| ) |  |
| inlinenoexcept

Initializes a rectangle with given values.

Parameters

  [in] | topLeft | top-left corner point.
  [in] | bottomRight | bottom-right corner point.

## ◆ BaseRect() [3/3]

template<typename Type>

fsdk::BaseRect< Type >::BaseRect | ( | const BaseRect< Type > & | other | ) |
| inlinenoexcept

Copies another rect.

Parameters

  [in] | other | another rect.

## Member Function Documentation

## ◆ adjust()

template<typename Type>

void fsdk::BaseRect< Type >::adjust | ( | Type | dx,
|  | Type | dy,
|  | Type | dw,
|  | Type | dh
| ) |  |
| inlinenoexcept

Adjusts the rect by given amounts.

Parameters

  [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.

## ◆ adjusted()

template<typename Type>

BaseRect fsdk::BaseRect< Type >::adjusted | ( | Type | dx,
|  | Type | dy,
|  | Type | dw,
|  | Type | dh
| ) |  | const
| inlinenoexcept

Copies and adjusts the rect by given amounts.

Parameters

  [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.

Returns
  adjusted rect.

## ◆ bottom()

template<typename Type>

Type fsdk::BaseRect< Type >::bottom | ( |  | ) | const
| inlinenoexcept

Gets rect bottom y coordinate.

Returns
  coordinate.

## ◆ bottomRight()

template<typename Type>

Vector2<Type> fsdk::BaseRect< Type >::bottomRight | ( |  | ) | const
| inlinenoexcept

Gets rect bottom-right corner coordinates.

Returns
  coordinates vector.

## ◆ center()

template<typename Type>

Vector2<Type> fsdk::BaseRect< Type >::center | ( |  | ) | const
| inlinenoexcept

Gets rect center coordinates.

Returns
  coordinates vector.

## ◆ coords()

template<typename Type>

static BaseRect fsdk::BaseRect< Type >::coords | ( | Type | x0,
|  | Type | y0,
|  | Type | x1,
|  | Type | y1
| ) |  |
| inlinestaticnoexcept

Create new Rect by coordinates.

Parameters

  [in] | left | coord.
  [in] | top | coord.
  [in] | right | coord.
  [in] | bottom | coord.

## ◆ getArea()

template<typename Type>

Type fsdk::BaseRect< Type >::getArea | ( |  | ) | const
| inlinenoexcept

Computes rect area (width x height).

Returns
  rect area.

## ◆ inside()

template<typename Type>

bool fsdk::BaseRect< Type >::inside | ( | const BaseRect< Type > & | other | ) | const
| inlinenoexcept

Checks whether this rect is inside of another rect.

Parameters

  [in] | other | rect to check against.

Returns
  true if this rect is inside of another rect, false otherwise.

## ◆ intersectionOverFirstRect()

template<typename Type>

static float fsdk::BaseRect< Type >::intersectionOverFirstRect | ( | const BaseRect< Type > & | rect1,
|  | const BaseRect< Type > & | rect2
| ) |  |
| inlinestatic

Calculates rects intersection rate over first rect.

Parameters

  [in] | rect1 | first rect
  [in] | rect2 | second rect

Returns
  intersection rate over first rect

## ◆ intersectionOverForeground()

template<typename Type>

static float fsdk::BaseRect< Type >::intersectionOverForeground | ( | const BaseRect< Type > & | rect1,
|  | const BaseRect< Type > & | rect2
| ) |  |
| inlinestatic

Calculates rects intersection rate over foreground.

Parameters

  [in] | rect1 | first rect
  [in] | rect2 | second rect

Returns
  intersection rate over foreground

## ◆ intersectionOverUnion()

template<typename Type>

static float fsdk::BaseRect< Type >::intersectionOverUnion | ( | const BaseRect< Type > & | rect1,
|  | const BaseRect< Type > & | rect2
| ) |  |
| inlinestatic

Calculates rects intersection rate over union.

Parameters

  [in] | rect1 | first rect
  [in] | rect2 | second rect

Returns
  intersection rate over union

## ◆ isValid()

template<typename Type>

bool fsdk::BaseRect< Type >::isValid | ( |  | ) | const
| inlinenoexcept

Checks whether a rect is valid.

A rect is considered valid if it has positive width and weight.

Returns
  true if rect is valid, false otherwise.

## ◆ left()

template<typename Type>

Type fsdk::BaseRect< Type >::left | ( |  | ) | const
| inlinenoexcept

Gets rect left x coordinate.

Returns
  coordinate.

## ◆ operator &()

template<typename Type>

BaseRect fsdk::BaseRect< Type >::operator& | ( | const BaseRect< Type > & | other | ) | const
| inlinenoexcept

Returns rect that is intersection of rects.

Parameters

  [in] | other | rectangle

Returns
  intersection rectangle

## ◆ operator &=()

template<typename Type>

BaseRect fsdk::BaseRect< Type >::operator&= | ( | const BaseRect< Type > & | other | ) |
| inlinenoexcept

Returns rect that is intersection of rects.

Parameters

  [in] | other | rectangle

Returns
  intersection rectangle

## ◆ operator!=()

template<typename Type>
template<typename OtherType >

bool fsdk::BaseRect< Type >::operator!= | ( | const BaseRect< OtherType > & | other | ) | const
| inlinenoexcept

Checks whether two rects are not equal.

Parameters

  [in] | other | another rect.

Returns
  true if rects are not equal, false otherwise.

## ◆ operator*()

template<typename Type>

BaseRect fsdk::BaseRect< Type >::operator* | ( | float | scaleFactor | ) | const
| inlinenoexcept

Multiplicates Rect scale by specified scale factor.

Parameters

  [in] | scaleFactor | to scale rect

Returns
  scaled Rect

## ◆ operator/()

template<typename Type>

BaseRect fsdk::BaseRect< Type >::operator/ | ( | float | scaleFactor | ) | const
| inlinenoexcept

Divides Rect scale by specified scale factor.

Parameters

  [in] | scaleFactor | to scale rect

Returns
  scaled Rect

## ◆ operator=()

template<typename Type>
template<typename OtherType >

BaseRect& fsdk::BaseRect< Type >::operator= | ( | const BaseRect< OtherType > & | other | ) |
| inlinenoexcept

Copies another rect.

Parameters

  [in] | other | another rect.

Returns
  rect reference for call chaining.

## ◆ operator==()

template<typename Type>
template<typename OtherType >

bool fsdk::BaseRect< Type >::operator== | ( | const BaseRect< OtherType > & | other | ) | const
| inlinenoexcept

Checks whether two rects are equal.

Parameters

  [in] | other | another rect.

Returns
  true if rects are equal, false otherwise.

## ◆ operator|()

template<typename Type>

BaseRect fsdk::BaseRect< Type >::operator| | ( | const BaseRect< Type > & | other | ) | const
| inlinenoexcept

Returns minimum area rectangle containing both rects.

Parameters

  [in] | other | rectangle

Returns
  minimum area rectangle

## ◆ operator|=()

template<typename Type>

BaseRect fsdk::BaseRect< Type >::operator|= | ( | const BaseRect< Type > & | other | ) |
| inlinenoexcept

Returns minimum area rectangle containing both rects.

Parameters

  [in] | other | rectangle

Returns
  minimum area rectangle

## ◆ right()

template<typename Type>

Type fsdk::BaseRect< Type >::right | ( |  | ) | const
| inlinenoexcept

Gets rect right x coordinate.

Returns
  coordinate.

## ◆ set()

template<typename Type>

void fsdk::BaseRect< Type >::set | ( | const Vector2< Type > & | topLeft,
|  | const Vector2< Type > & | bottomRight
| ) |  |
| inlinenoexcept

Sets rect corner coordinates.

Parameters

  [in] | topLeft | top-left corner point.
  [in] | bottomRight | bottom-right corner point.

## ◆ setBottom()

template<typename Type>

void fsdk::BaseRect< Type >::setBottom | ( | Type | b | ) |
| inlinenoexcept

Set rect bottom.

Parameters

  b | bottom.

## ◆ setLeft()

template<typename Type>

void fsdk::BaseRect< Type >::setLeft | ( | Type | l | ) |
| inlinenoexcept

Set rect left.

Parameters

  l | left.

## ◆ setRight()

template<typename Type>

void fsdk::BaseRect< Type >::setRight | ( | Type | r | ) |
| inlinenoexcept

Set rect right.

Parameters

  r | right.

## ◆ setTop()

template<typename Type>

void fsdk::BaseRect< Type >::setTop | ( | Type | t | ) |
| inlinenoexcept

Set rect top.

Parameters

  t | top.

## ◆ size()

template<typename Type>

Vector2<Type> fsdk::BaseRect< Type >::size | ( |  | ) | const
| inlinenoexcept

Gets rect size (width, height).

Returns
  rect size.

## ◆ top()

template<typename Type>

Type fsdk::BaseRect< Type >::top | ( |  | ) | const
| inlinenoexcept

Gets rect top y coordinate.

Returns
  coordinate.

## ◆ topLeft()

template<typename Type>

Vector2<Type> fsdk::BaseRect< Type >::topLeft | ( |  | ) | const
| inlinenoexcept

Gets rect top-left corner coordinates.

Returns
  coordinates vector.

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

- include/fsdk/Types/Rect.h