Kanzi  3.9.4
Kanzi Engine API
kanzi::Rectangle< T > Class Template Reference

2-dimensional integer rectangle. More...

#include <kanzi/core/math/rectangle.hpp>

Public Member Functions

T getHeight () const
 Gets height. More...
 
T getWidth () const
 Gets width. More...
 
T getX () const
 Gets X offset. More...
 
T getY () const
 Gets Y offset. More...
 
 Rectangle ()
 Empty constructor. More...
 
 Rectangle (T x, T y, T width, T height)
 Constructor. More...
 
void setHeight (T height)
 Sets height. More...
 
void setWidth (T width)
 Sets width. More...
 
void setX (T x)
 Sets X offset. More...
 
void setY (T y)
 Sets Y offset. More...
 

Friends

bool operator!= (const Rectangle< T > &lhs, const Rectangle< T > &rhs)
 Not equals operator. More...
 
bool operator== (const Rectangle< T > &lhs, const Rectangle< T > &rhs)
 Equals operator. More...
 

Detailed Description

template<typename T>
class kanzi::Rectangle< T >

2-dimensional integer rectangle.

The rectangle sizes remain non-negative for all operations as long as the input sizes are non-negative.

Constructor & Destructor Documentation

◆ Rectangle() [1/2]

template<typename T>
kanzi::Rectangle< T >::Rectangle ( )
inlineexplicit

Empty constructor.

◆ Rectangle() [2/2]

template<typename T>
kanzi::Rectangle< T >::Rectangle ( T  x,
T  y,
T  width,
T  height 
)
inlineexplicit

Constructor.

Member Function Documentation

◆ getX()

template<typename T>
T kanzi::Rectangle< T >::getX ( ) const
inline

Gets X offset.

◆ getY()

template<typename T>
T kanzi::Rectangle< T >::getY ( ) const
inline

Gets Y offset.

◆ getWidth()

template<typename T>
T kanzi::Rectangle< T >::getWidth ( ) const
inline

Gets width.

◆ getHeight()

template<typename T>
T kanzi::Rectangle< T >::getHeight ( ) const
inline

Gets height.

◆ setX()

template<typename T>
void kanzi::Rectangle< T >::setX ( T  x)
inline

Sets X offset.

Parameters
xNew offset.

◆ setY()

template<typename T>
void kanzi::Rectangle< T >::setY ( T  y)
inline

Sets Y offset.

Parameters
yNew offset.

◆ setWidth()

template<typename T>
void kanzi::Rectangle< T >::setWidth ( T  width)
inline

Sets width.

Parameters
widthNew width.

◆ setHeight()

template<typename T>
void kanzi::Rectangle< T >::setHeight ( T  height)
inline

Sets height.

Parameters
heightNew height.

Friends And Related Function Documentation

◆ operator==

template<typename T>
bool operator== ( const Rectangle< T > &  lhs,
const Rectangle< T > &  rhs 
)
friend

Equals operator.

Parameters
lhsLeft-hand-side operand of the comparison.
rhsRight-hand-side operand of the comparison.

◆ operator!=

template<typename T>
bool operator!= ( const Rectangle< T > &  lhs,
const Rectangle< T > &  rhs 
)
friend

Not equals operator.

Parameters
lhsLeft-hand-side operand of the comparison.
rhsRight-hand-side operand of the comparison.

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