Kanzi 3.9.10
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.
 
T getWidth () const
 Gets width.
 
T getX () const
 Gets X offset.
 
T getY () const
 Gets Y offset.
 
 Rectangle ()
 Empty constructor.
 
 Rectangle (T x, T y, T width, T height)
 Constructor.
 
void setHeight (T height)
 Sets height.
 
void setWidth (T width)
 Sets width.
 
void setX (T x)
 Sets X offset.
 
void setY (T y)
 Sets Y offset.
 

Friends

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

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 Symbol 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: