Base Framework
Public Member Functions | Protected Attributes | List of all members
Dimension Class Reference

Dimension. More...

#include <base/Dimension.h>

Public Member Functions

 Dimension () noexcept
 
 Dimension (unsigned int width, unsigned int height) noexcept
 
 Dimension (const Dimension &copy) noexcept
 
Dimensionoperator= (const Dimension &assign) noexcept
 
void assign (unsigned int width, unsigned int height) noexcept
 
void reduce (const Dimension &dimension) noexcept
 
void expand (const Dimension &dimension) noexcept
 
bool operator== (const Dimension &dimension) const noexcept
 
bool operator!= (const Dimension &dimension) const noexcept
 
bool isProper () const noexcept
 
unsigned int getWidth () const noexcept
 
unsigned int getHeight () const noexcept
 
unsigned long long getSize () const noexcept
 
void setWidth (unsigned int value) noexcept
 
void setHeight (unsigned int value) noexcept
 

Protected Attributes

unsigned int width = 0
 
unsigned int height = 0
 

Detailed Description

Dimension.

Dimension represented by width and height.

Version
1.2

Constructor & Destructor Documentation

◆ Dimension() [1/3]

Dimension::Dimension ( )
inlinenoexcept

Initializes object with width and height set to zero.

◆ Dimension() [2/3]

Dimension::Dimension ( unsigned int  width,
unsigned int  height 
)
inlinenoexcept

Initializes object with the specified width and height.

Parameters
widthThe desired width.
heightThe desired height.

◆ Dimension() [3/3]

Dimension::Dimension ( const Dimension copy)
inlinenoexcept

Initializes object with the dimension copied from the specified dimension.

Parameters
dimensionThe desired dimension.

Member Function Documentation

◆ assign()

void Dimension::assign ( unsigned int  width,
unsigned int  height 
)
inlinenoexcept

Sets the width and the height.

Parameters
widthThe desired width.
heightThe desired height.

◆ expand()

void Dimension::expand ( const Dimension dimension)
inlinenoexcept

Expands the width and height to the maximum value of this and the specified dimension.

Parameters
dimensionThe other dimension.

◆ getHeight()

unsigned int Dimension::getHeight ( ) const
inlinenoexcept

Returns the height.

◆ getSize()

unsigned long long Dimension::getSize ( ) const
inlinenoexcept

Returns the size (width * height).

◆ getWidth()

unsigned int Dimension::getWidth ( ) const
inlinenoexcept

Returns the width.

◆ isProper()

bool Dimension::isProper ( ) const
inlinenoexcept

Returns true if the dimension is proper (i.e. both the width and height are non-zero).

◆ operator!=()

bool Dimension::operator!= ( const Dimension dimension) const
inlinenoexcept

Returns true if the dimensions are different.

Parameters
dimensionThe dimension to be compared.

◆ operator=()

Dimension& Dimension::operator= ( const Dimension assign)
inlinenoexcept

Assigns the dimension.

Parameters
dimensionThe desired dimension.

◆ operator==()

bool Dimension::operator== ( const Dimension dimension) const
inlinenoexcept

Returns true if the dimensions are equal.

Parameters
dimensionThe dimension to be compared.

◆ reduce()

void Dimension::reduce ( const Dimension dimension)
inlinenoexcept

Reduces the width and height to the minimum values of this and the specified dimension.

Parameters
dimensionThe other dimension.

◆ setHeight()

void Dimension::setHeight ( unsigned int  value)
inlinenoexcept

Sets the height.

Parameters
valueThe desired height.

◆ setWidth()

void Dimension::setWidth ( unsigned int  value)
inlinenoexcept

Sets the width.

Parameters
widthThe desired width.

Member Data Documentation

◆ height

unsigned int Dimension::height = 0
protected

The height.

◆ width

unsigned int Dimension::width = 0
protected

The width.