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

Public Member Functions | Public Attributes | List of all members
fsdk::Vector2< T > Struct Template Reference

Generic 2D vector. More...

`#include <Vector2.h>`

## Public Member Functions
| Vector2 () noexcept
| Initializes a vector with zeroes.
| Vector2 (T x_) noexcept
| Initializes all elements with the same value. More...
| Vector2 (T x_, T y_) noexcept
| Initializes elements with given value. More...
template<typename Other >
| Vector2 (const Vector2< Other > &other) noexcept
| Copies another vector. More...
template<typename Other >
Vector2< T > & | operator= (const Vector2< Other > &other) noexcept
| Copies another vector. More...
bool | operator== (const Vector2 &other) const noexcept
| Checks if two vectors are equal. More...
bool | operator!= (const Vector2 &other) const noexcept
| Checks if two vectors are not equal. More...
bool | operator> (const Vector2 &other) const noexcept
| Checks if both coordinates are greater then respective coordinates of another vector. More...
bool | operator>= (const Vector2 &other) const noexcept
| Checks if both coordinates are greater or equal to respective coordinates of another vector. More...
bool | operator< (const Vector2 &other) const noexcept
| Checks if both coordinates are smaller then respective coordinates of another vector. More...
bool | operator<= (const Vector2 &other) const noexcept
| Checks if both coordinates are smaller or equal to respective coordinates of another vector. More...
T & | operator[] (int n) noexcept
| Indexes the vector. More...
const T & | operator[] (int n) const noexcept
| Indexes the vector. More...
Vector2 | operator- (void) const noexcept
| Negates all elements. More...
Vector2 | operator+ (const Vector2 &rhs) const noexcept
| Adds (per-element) two vectors. More...
Vector2 | operator- (const Vector2 &rhs) const noexcept
| Subtracts (per-element) two vectors. More...
Vector2 | operator* (const Vector2 &rhs) const noexcept
| Multiplies (per-element) two vectors. More...
Vector2 | operator/ (const Vector2 &rhs) const noexcept
| Divides (per-element) two vectors. More...
Vector2 & | operator+= (const Vector2 &rhs) noexcept
| Adds (per-element) two vectors. More...
Vector2 & | operator-= (const Vector2 &rhs) noexcept
| Subtracts (per-element) two vectors. More...
Vector2 & | operator*= (const Vector2 &rhs) noexcept
| Multiplies (per-element) two vectors. More...
Vector2 & | operator/= (const Vector2 &rhs) noexcept
| Divides (per-element) two vectors. More...
Vector2 | operator+ (T rhs) const noexcept
| Adds (per-element) a constant to each element of the vector. More...
Vector2 | operator- (T rhs) const noexcept
| Subtracts (per-element) a constant to each element of the vector. More...
Vector2 | operator* (T rhs) const noexcept
| Multiplies (per-element) a constant to each element of the vector. More...
Vector2 | operator/ (T rhs) const noexcept
| Divides (per-element) a constant to each element of the vector. More...
Vector2 & | operator+= (T rhs) noexcept
| Adds (per-element) a constant to each element of the vector. More...
Vector2 & | operator-= (T rhs) noexcept
| Subtracts (per-element) a constant to each element of the vector. More...
Vector2 & | operator*= (T rhs) noexcept
| Multiplies (per-element) a constant to each element of the vector. More...
Vector2 & | operator/= (T rhs) noexcept
| Divides (per-element) a constant to each element of the vector. More...

## Public Attributes
union {
struct {
T x
| x coordinate.
T y
| y coordinate.
} |
| Ordered vector elements structure.
T array [2]
| Array for iteration.
}; |
| Union to make enable iteration through vector elements.

## Detailed Description

### template<typename T>
struct fsdk::Vector2< T >

Generic 2D vector.

Template Parameters

  T | any POD numeric type.

## Constructor & Destructor Documentation

## ◆ Vector2() [1/3]

template<typename T >

fsdk::Vector2< T >::Vector2 | ( | T | x_ | ) |
| inline explicit noexcept

Initializes all elements with the same value.

Parameters

  [in] | x_ | value to initialize with.

## ◆ Vector2() [2/3]

template<typename T >

fsdk::Vector2< T >::Vector2 | ( | T | x_,
|  | T | y_
| ) |  |
| inline noexcept

Initializes elements with given value.

Parameters

  [in] | x_ | x coordinate value.
  [in] | y_ | y coordinate value.

## ◆ Vector2() [3/3]

template<typename T >
template<typename Other >

fsdk::Vector2< T >::Vector2 | ( | const Vector2< Other > & | other | ) |
| inline noexcept

Copies another vector.

Parameters

  [in] | other | another vector.

## Member Function Documentation

## ◆ operator!=()

template<typename T >

bool fsdk::Vector2< T >::operator!= | ( | const Vector2< T > & | other | ) | const
| inline noexcept

Checks if two vectors are not equal.

Parameters

  [in] | other | vector to check against.

Returns
  true if two vectors are not equal.

## ◆ operator*() [1/2]

template<typename T >

Vector2 fsdk::Vector2< T >::operator* | ( | const Vector2< T > & | rhs | ) | const
| inline noexcept

Multiplies (per-element) two vectors.

Parameters

  [in] | rhs | vector to multiply by.

Returns
  resulting vector.

## ◆ operator*() [2/2]

template<typename T >

Vector2 fsdk::Vector2< T >::operator* | ( | T | rhs | ) | const
| inline noexcept

Multiplies (per-element) a constant to each element of the vector.

Parameters

  [in] | rhs | value to multiply by.

Returns
  resulting vector.

## ◆ operator*=() [1/2]

template<typename T >

Vector2& fsdk::Vector2< T >::operator*= | ( | const Vector2< T > & | rhs | ) |
| inline noexcept

Multiplies (per-element) two vectors.

Parameters

  [in] | rhs | vector to multiply by.

Returns
  modified vector.

## ◆ operator*=() [2/2]

template<typename T >

Vector2& fsdk::Vector2< T >::operator*= | ( | T | rhs | ) |
| inline noexcept

Multiplies (per-element) a constant to each element of the vector.

Parameters

  [in] | rhs | value to multiply by.

Returns
  modified vector.

## ◆ operator+() [1/2]

template<typename T >

Vector2 fsdk::Vector2< T >::operator+ | ( | const Vector2< T > & | rhs | ) | const
| inline noexcept

Adds (per-element) two vectors.

Parameters

  [in] | rhs | vector to add.

Returns
  resulting vector.

## ◆ operator+() [2/2]

template<typename T >

Vector2 fsdk::Vector2< T >::operator+ | ( | T | rhs | ) | const
| inline noexcept

Adds (per-element) a constant to each element of the vector.

Parameters

  [in] | rhs | value to add.

Returns
  resulting vector.

## ◆ operator+=() [1/2]

template<typename T >

Vector2& fsdk::Vector2< T >::operator+= | ( | const Vector2< T > & | rhs | ) |
| inline noexcept

Adds (per-element) two vectors.

Parameters

  [in] | rhs | vector to add.

Returns
  modified vector.

## ◆ operator+=() [2/2]

template<typename T >

Vector2& fsdk::Vector2< T >::operator+= | ( | T | rhs | ) |
| inline noexcept

Adds (per-element) a constant to each element of the vector.

Parameters

  [in] | rhs | value to add.

Returns
  modified vector.

## ◆ operator-() [1/3]

template<typename T >

Vector2 fsdk::Vector2< T >::operator- | ( | const Vector2< T > & | rhs | ) | const
| inline noexcept

Subtracts (per-element) two vectors.

Parameters

  [in] | rhs | vector to subtract.

Returns
  resulting vector.

## ◆ operator-() [2/3]

template<typename T >

Vector2 fsdk::Vector2< T >::operator- | ( | T | rhs | ) | const
| inline noexcept

Subtracts (per-element) a constant to each element of the vector.

Parameters

  [in] | rhs | value to subtract.

Returns
  resulting vector.

## ◆ operator-() [3/3]

template<typename T >

Vector2 fsdk::Vector2< T >::operator- | ( | void |  | ) | const
| inline noexcept

Negates all elements.

Returns
  resulting vector.

## ◆ operator-=() [1/2]

template<typename T >

Vector2& fsdk::Vector2< T >::operator-= | ( | const Vector2< T > & | rhs | ) |
| inline noexcept

Subtracts (per-element) two vectors.

Parameters

  [in] | rhs | vector to subtract.

Returns
  modified vector.

## ◆ operator-=() [2/2]

template<typename T >

Vector2& fsdk::Vector2< T >::operator-= | ( | T | rhs | ) |
| inline noexcept

Subtracts (per-element) a constant to each element of the vector.

Parameters

  [in] | rhs | value to subtract.

Returns
  modified vector.

## ◆ operator/() [1/2]

template<typename T >

Vector2 fsdk::Vector2< T >::operator/ | ( | const Vector2< T > & | rhs | ) | const
| inline noexcept

Divides (per-element) two vectors.

Parameters

  [in] | rhs | vector to divide by.

Returns
  resulting vector.

## ◆ operator/() [2/2]

template<typename T >

Vector2 fsdk::Vector2< T >::operator/ | ( | T | rhs | ) | const
| inline noexcept

Divides (per-element) a constant to each element of the vector.

Parameters

  [in] | rhs | value to divide by.

Returns
  resulting vector.

## ◆ operator/=() [1/2]

template<typename T >

Vector2& fsdk::Vector2< T >::operator/= | ( | const Vector2< T > & | rhs | ) |
| inline noexcept

Divides (per-element) two vectors.

Parameters

  [in] | rhs | vector to divide by.

Returns
  modified vector.

## ◆ operator/=() [2/2]

template<typename T >

Vector2& fsdk::Vector2< T >::operator/= | ( | T | rhs | ) |
| inline noexcept

Divides (per-element) a constant to each element of the vector.

Parameters

  [in] | rhs | value to divide by.

Returns
  modified vector.

## ◆ operator<()

template<typename T >

bool fsdk::Vector2< T >::operator< | ( | const Vector2< T > & | other | ) | const
| inline noexcept

Checks if both coordinates are smaller then respective coordinates of another vector.

Parameters

  [in] | other | vector to check against.

Returns
  true if smaller.

## ◆ operator<=()

template<typename T >

bool fsdk::Vector2< T >::operator<= | ( | const Vector2< T > & | other | ) | const
| inline noexcept

Checks if both coordinates are smaller or equal to respective coordinates of another vector.

Parameters

  [in] | other | vector to check against.

Returns
  true if smaller or equal.

## ◆ operator=()

template<typename T >
template<typename Other >

Vector2<T>& fsdk::Vector2< T >::operator= | ( | const Vector2< Other > & | other | ) |
| inline noexcept

Copies another vector.

Parameters

  [in] | other | another vector.

Returns
  reference for call chaining.

## ◆ operator==()

template<typename T >

bool fsdk::Vector2< T >::operator== | ( | const Vector2< T > & | other | ) | const
| inline noexcept

Checks if two vectors are equal.

Parameters

  [in] | other | vector to check against.

Returns
  true if two vectors are equal.

## ◆ operator>()

template<typename T >

bool fsdk::Vector2< T >::operator> | ( | const Vector2< T > & | other | ) | const
| inline noexcept

Checks if both coordinates are greater then respective coordinates of another vector.

Parameters

  [in] | other | vector to check against.

Returns
  true if greater.

## ◆ operator>=()

template<typename T >

bool fsdk::Vector2< T >::operator>= | ( | const Vector2< T > & | other | ) | const
| inline noexcept

Checks if both coordinates are greater or equal to respective coordinates of another vector.

Parameters

  [in] | other | vector to check against.

Returns
  true if greater or equal.

## ◆ operator[]() [1/2]

template<typename T >

const T& fsdk::Vector2< T >::operator[] | ( | int | n | ) | const
| inline noexcept

Indexes the vector.

Parameters

  [in] | n | element index.

Returns
  element const reference.

## ◆ operator[]() [2/2]

template<typename T >

T& fsdk::Vector2< T >::operator[] | ( | int | n | ) |
| inline noexcept

Indexes the vector.

Parameters

  [in] | n | element index.

Returns
  element reference.

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

- fsdk.framework/Headers/Types/Vector2.h