OpenPose  1.7.0
The first real-time multi-person system to jointly detect human body, hand, facial, and foot keypoints
op::Rectangle< T > Struct Template Reference

#include <rectangle.hpp>

Public Member Functions

 Rectangle (const T x=0, const T y=0, const T width=0, const T height=0)
 
 Rectangle (const Rectangle< T > &rectangle)
 
Rectangle< T > & operator= (const Rectangle< T > &rectangle)
 
 Rectangle (Rectangle< T > &&rectangle)
 
Rectangle< T > & operator= (Rectangle< T > &&rectangle)
 
Point< T > center () const
 
Point< T > topLeft () const
 
Point< T > bottomRight () const
 
area () const
 
void recenter (const T newWidth, const T newHeight)
 
std::string toString () const
 
Rectangle< T > & operator*= (const T value)
 
Rectangle< T > operator* (const T value) const
 
Rectangle< T > & operator/= (const T value)
 
Rectangle< T > operator/ (const T value) const
 

Public Attributes

x
 
y
 
width
 
height
 

Detailed Description

template<typename T>
struct op::Rectangle< T >

Definition at line 11 of file rectangle.hpp.

Constructor & Destructor Documentation

◆ Rectangle() [1/3]

template<typename T >
op::Rectangle< T >::Rectangle ( const T  x = 0,
const T  y = 0,
const T  width = 0,
const T  height = 0 
)

◆ Rectangle() [2/3]

template<typename T >
op::Rectangle< T >::Rectangle ( const Rectangle< T > &  rectangle)

Copy constructor. It performs fast copy: For performance purpose, copying a Rectangle<T> or Datum or cv::Mat just copies the reference, it still shares the same internal data. Modifying the copied element will modify the original one. Use clone() for a slower but real copy, similarly to cv::Mat and Rectangle<T>.

Parameters
rectangleRectangle to be copied.

◆ Rectangle() [3/3]

template<typename T >
op::Rectangle< T >::Rectangle ( Rectangle< T > &&  rectangle)

Move constructor. It destroys the original Rectangle to be moved.

Parameters
rectangleRectangle to be moved.

Member Function Documentation

◆ area()

template<typename T >
T op::Rectangle< T >::area ( ) const
inline

Definition at line 62 of file rectangle.hpp.

◆ bottomRight()

template<typename T >
Point<T> op::Rectangle< T >::bottomRight ( ) const

◆ center()

template<typename T >
Point<T> op::Rectangle< T >::center ( ) const

◆ operator*()

template<typename T >
Rectangle<T> op::Rectangle< T >::operator* ( const T  value) const

◆ operator*=()

template<typename T >
Rectangle<T>& op::Rectangle< T >::operator*= ( const T  value)

◆ operator/()

template<typename T >
Rectangle<T> op::Rectangle< T >::operator/ ( const T  value) const

◆ operator/=()

template<typename T >
Rectangle<T>& op::Rectangle< T >::operator/= ( const T  value)

◆ operator=() [1/2]

template<typename T >
Rectangle<T>& op::Rectangle< T >::operator= ( const Rectangle< T > &  rectangle)

Copy assignment. Similar to Rectangle<T>(const Rectangle<T>& rectangle).

Parameters
rectangleRectangle to be copied.
Returns
The resulting Rectangle.

◆ operator=() [2/2]

template<typename T >
Rectangle<T>& op::Rectangle< T >::operator= ( Rectangle< T > &&  rectangle)

Move assignment. Similar to Rectangle<T>(Rectangle<T>&& rectangle).

Parameters
rectangleRectangle to be moved.
Returns
The resulting Rectangle.

◆ recenter()

template<typename T >
void op::Rectangle< T >::recenter ( const T  newWidth,
const T  newHeight 
)

◆ topLeft()

template<typename T >
Point<T> op::Rectangle< T >::topLeft ( ) const
inline

Definition at line 55 of file rectangle.hpp.

◆ toString()

template<typename T >
std::string op::Rectangle< T >::toString ( ) const

It returns a string with the whole Rectangle<T> data. Useful for debugging. The format is: [x, y, width, height]

Returns
A string with the Rectangle<T> values in the above format.

Member Data Documentation

◆ height

template<typename T >
T op::Rectangle< T >::height

Definition at line 16 of file rectangle.hpp.

◆ width

template<typename T >
T op::Rectangle< T >::width

Definition at line 15 of file rectangle.hpp.

◆ x

template<typename T >
T op::Rectangle< T >::x

Definition at line 13 of file rectangle.hpp.

◆ y

template<typename T >
T op::Rectangle< T >::y

Definition at line 14 of file rectangle.hpp.


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