kanzi::Rectangle< T > Class Template Reference

2-dimensional integer rectangle. More...

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

Public Member Functions

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

Friends

bool operator== (const Rectangle< T > &lhs, const Rectangle< T > &rhs)
 Equals operator. More...
 
bool operator!= (const Rectangle< T > &lhs, const Rectangle< T > &rhs)
 Not 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

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

Empty constructor.

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

Constructor.

Member Function Documentation

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

Gets X offset.

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

Gets Y offset.

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

Gets width.

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

Gets height.

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

Sets X offset.

Parameters
xNew offset.
template<typename T>
void kanzi::Rectangle< T >::setY ( y)
inline

Sets Y offset.

Parameters
yNew offset.
template<typename T>
void kanzi::Rectangle< T >::setWidth ( width)
inline

Sets width.

Parameters
widthNew width.
template<typename T>
void kanzi::Rectangle< T >::setHeight ( height)
inline

Sets height.

Parameters
heightNew height.

Friends And Related Function Documentation

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

Equals operator.

Parameters
rhsRight-hand-side operand of the comparison.
template<typename T>
bool operator!= ( const Rectangle< T > &  lhs,
const Rectangle< T > &  rhs 
)
friend

Not equals operator.

Parameters
rhsRight-hand-side operand of the comparison.

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