Jet  v1.3.3
Public Member Functions | Public Attributes | List of all members
jet::Size2 Class Reference

2-D size class. More...

#include <jet/size2.h>

Public Member Functions

constexpr Size2 ()
 Constructs default size (0, 0). More...
 
constexpr Size2 (size_t x_, size_t y_)
 Constructs size with given parameters x_ and y_. More...
 
template<typename U >
 Size2 (const std::initializer_list< U > &lst)
 Constructs size with initializer list. More...
 
constexpr Size2 (const Size2 &v)
 Copy constructor. More...
 
void set (size_t s)
 Set both x and y components to s. More...
 
void set (size_t x, size_t y)
 Set x and y components with given parameters. More...
 
template<typename U >
void set (const std::initializer_list< U > &lst)
 Set x and y components with given initializer list. More...
 
void set (const Size2 &pt)
 Set x and y with other size pt. More...
 
void setZero ()
 Set both x and y to zero. More...
 
Size2 add (size_t v) const
 Computes this + (v, v). More...
 
Size2 add (const Size2 &v) const
 Computes this + (v.x, v.y). More...
 
Size2 sub (size_t v) const
 Computes this - (v, v). More...
 
Size2 sub (const Size2 &v) const
 Computes this - (v.x, v.y). More...
 
Size2 mul (size_t v) const
 Computes this * (v, v). More...
 
Size2 mul (const Size2 &v) const
 Computes this * (v.x, v.y). More...
 
Size2 div (size_t v) const
 Computes this / (v, v). More...
 
Size2 div (const Size2 &v) const
 Computes this / (v.x, v.y). More...
 
Size2 rsub (size_t v) const
 Computes (v, v) - this. More...
 
Size2 rsub (const Size2 &v) const
 Computes (v.x, v.y) - this. More...
 
Size2 rdiv (size_t v) const
 Computes (v, v) / this. More...
 
Size2 rdiv (const Size2 &v) const
 Computes (v.x, v.y) / this. More...
 
void iadd (size_t v)
 Computes this += (v, v). More...
 
void iadd (const Size2 &v)
 Computes this += (v.x, v.y). More...
 
void isub (size_t v)
 Computes this -= (v, v). More...
 
void isub (const Size2 &v)
 Computes this -= (v.x, v.y). More...
 
void imul (size_t v)
 Computes this *= (v, v). More...
 
void imul (const Size2 &v)
 Computes this *= (v.x, v.y). More...
 
void idiv (size_t v)
 Computes this /= (v, v). More...
 
void idiv (const Size2 &v)
 Computes this /= (v.x, v.y). More...
 
const size_t & at (size_t i) const
 Returns const reference to the i -th element of the size. More...
 
size_t & at (size_t i)
 Returns reference to the i -th element of the size. More...
 
size_t sum () const
 Returns the sum of all the components (i.e. x + y). More...
 
size_t min () const
 Returns the minimum value among x and y. More...
 
size_t max () const
 Returns the maximum value among x and y. More...
 
size_t absmin () const
 Returns the absolute minimum value among x and y. More...
 
size_t absmax () const
 Returns the absolute maximum value among x and y. More...
 
size_t dominantAxis () const
 Returns the index of the dominant axis. More...
 
size_t subminantAxis () const
 Returns the index of the subminant axis. More...
 
bool isEqual (const Size2 &other) const
 Returns true if other is the same as this size. More...
 
size_t & operator[] (size_t i)
 Returns reference to the i -th element of the size. More...
 
const size_t & operator[] (size_t i) const
 Returns const reference to the i -th element of the size. More...
 
template<typename U >
Size2operator= (const std::initializer_list< U > &lst)
 Set x and y components with given initializer list. More...
 
Size2operator= (const Size2 &v)
 Set x and y with other size pt. More...
 
Size2operator+= (size_t v)
 Computes this += (v, v) More...
 
Size2operator+= (const Size2 &v)
 Computes this += (v.x, v.y) More...
 
Size2operator-= (size_t v)
 Computes this -= (v, v) More...
 
Size2operator-= (const Size2 &v)
 Computes this -= (v.x, v.y) More...
 
Size2operator*= (size_t v)
 Computes this *= (v, v) More...
 
Size2operator*= (const Size2 &v)
 Computes this *= (v.x, v.y) More...
 
Size2operator/= (size_t v)
 Computes this /= (v, v) More...
 
Size2operator/= (const Size2 &v)
 Computes this /= (v.x, v.y) More...
 
bool operator== (const Size2 &v) const
 Returns true if other is the same as this size. More...
 
bool operator!= (const Size2 &v) const
 Returns true if other is the not same as this size. More...
 

Public Attributes

size_t x
 X (or the first) component of the size. More...
 
size_t y
 Y (or the second) component of the size. More...
 

Detailed Description

2-D size class.

This class defines simple 2-D size data.

Constructor & Destructor Documentation

◆ Size2() [1/4]

constexpr jet::Size2::Size2 ( )
inlineconstexpr

Constructs default size (0, 0).

◆ Size2() [2/4]

constexpr jet::Size2::Size2 ( size_t  x_,
size_t  y_ 
)
inlineconstexpr

Constructs size with given parameters x_ and y_.

◆ Size2() [3/4]

template<typename U >
jet::Size2::Size2 ( const std::initializer_list< U > &  lst)

Constructs size with initializer list.

◆ Size2() [4/4]

constexpr jet::Size2::Size2 ( const Size2 v)
inlineconstexpr

Copy constructor.

Member Function Documentation

◆ absmax()

size_t jet::Size2::absmax ( ) const

Returns the absolute maximum value among x and y.

◆ absmin()

size_t jet::Size2::absmin ( ) const

Returns the absolute minimum value among x and y.

◆ add() [1/2]

Size2 jet::Size2::add ( const Size2 v) const

Computes this + (v.x, v.y).

◆ add() [2/2]

Size2 jet::Size2::add ( size_t  v) const

Computes this + (v, v).

◆ at() [1/2]

size_t& jet::Size2::at ( size_t  i)

Returns reference to the i -th element of the size.

◆ at() [2/2]

const size_t& jet::Size2::at ( size_t  i) const

Returns const reference to the i -th element of the size.

◆ div() [1/2]

Size2 jet::Size2::div ( const Size2 v) const

Computes this / (v.x, v.y).

◆ div() [2/2]

Size2 jet::Size2::div ( size_t  v) const

Computes this / (v, v).

◆ dominantAxis()

size_t jet::Size2::dominantAxis ( ) const

Returns the index of the dominant axis.

◆ iadd() [1/2]

void jet::Size2::iadd ( const Size2 v)

Computes this += (v.x, v.y).

◆ iadd() [2/2]

void jet::Size2::iadd ( size_t  v)

Computes this += (v, v).

◆ idiv() [1/2]

void jet::Size2::idiv ( const Size2 v)

Computes this /= (v.x, v.y).

◆ idiv() [2/2]

void jet::Size2::idiv ( size_t  v)

Computes this /= (v, v).

◆ imul() [1/2]

void jet::Size2::imul ( const Size2 v)

Computes this *= (v.x, v.y).

◆ imul() [2/2]

void jet::Size2::imul ( size_t  v)

Computes this *= (v, v).

◆ isEqual()

bool jet::Size2::isEqual ( const Size2 other) const

Returns true if other is the same as this size.

◆ isub() [1/2]

void jet::Size2::isub ( const Size2 v)

Computes this -= (v.x, v.y).

◆ isub() [2/2]

void jet::Size2::isub ( size_t  v)

Computes this -= (v, v).

◆ max()

size_t jet::Size2::max ( ) const

Returns the maximum value among x and y.

◆ min()

size_t jet::Size2::min ( ) const

Returns the minimum value among x and y.

◆ mul() [1/2]

Size2 jet::Size2::mul ( const Size2 v) const

Computes this * (v.x, v.y).

◆ mul() [2/2]

Size2 jet::Size2::mul ( size_t  v) const

Computes this * (v, v).

◆ operator!=()

bool jet::Size2::operator!= ( const Size2 v) const

Returns true if other is the not same as this size.

◆ operator*=() [1/2]

Size2& jet::Size2::operator*= ( const Size2 v)

Computes this *= (v.x, v.y)

◆ operator*=() [2/2]

Size2& jet::Size2::operator*= ( size_t  v)

Computes this *= (v, v)

◆ operator+=() [1/2]

Size2& jet::Size2::operator+= ( const Size2 v)

Computes this += (v.x, v.y)

◆ operator+=() [2/2]

Size2& jet::Size2::operator+= ( size_t  v)

Computes this += (v, v)

◆ operator-=() [1/2]

Size2& jet::Size2::operator-= ( const Size2 v)

Computes this -= (v.x, v.y)

◆ operator-=() [2/2]

Size2& jet::Size2::operator-= ( size_t  v)

Computes this -= (v, v)

◆ operator/=() [1/2]

Size2& jet::Size2::operator/= ( const Size2 v)

Computes this /= (v.x, v.y)

◆ operator/=() [2/2]

Size2& jet::Size2::operator/= ( size_t  v)

Computes this /= (v, v)

◆ operator=() [1/2]

Size2& jet::Size2::operator= ( const Size2 v)

Set x and y with other size pt.

◆ operator=() [2/2]

template<typename U >
Size2& jet::Size2::operator= ( const std::initializer_list< U > &  lst)

Set x and y components with given initializer list.

◆ operator==()

bool jet::Size2::operator== ( const Size2 v) const

Returns true if other is the same as this size.

◆ operator[]() [1/2]

size_t& jet::Size2::operator[] ( size_t  i)

Returns reference to the i -th element of the size.

◆ operator[]() [2/2]

const size_t& jet::Size2::operator[] ( size_t  i) const

Returns const reference to the i -th element of the size.

◆ rdiv() [1/2]

Size2 jet::Size2::rdiv ( const Size2 v) const

Computes (v.x, v.y) / this.

◆ rdiv() [2/2]

Size2 jet::Size2::rdiv ( size_t  v) const

Computes (v, v) / this.

◆ rsub() [1/2]

Size2 jet::Size2::rsub ( const Size2 v) const

Computes (v.x, v.y) - this.

◆ rsub() [2/2]

Size2 jet::Size2::rsub ( size_t  v) const

Computes (v, v) - this.

◆ set() [1/4]

void jet::Size2::set ( const Size2 pt)

Set x and y with other size pt.

◆ set() [2/4]

template<typename U >
void jet::Size2::set ( const std::initializer_list< U > &  lst)

Set x and y components with given initializer list.

◆ set() [3/4]

void jet::Size2::set ( size_t  s)

Set both x and y components to s.

◆ set() [4/4]

void jet::Size2::set ( size_t  x,
size_t  y 
)

Set x and y components with given parameters.

◆ setZero()

void jet::Size2::setZero ( )

Set both x and y to zero.

◆ sub() [1/2]

Size2 jet::Size2::sub ( const Size2 v) const

Computes this - (v.x, v.y).

◆ sub() [2/2]

Size2 jet::Size2::sub ( size_t  v) const

Computes this - (v, v).

◆ subminantAxis()

size_t jet::Size2::subminantAxis ( ) const

Returns the index of the subminant axis.

◆ sum()

size_t jet::Size2::sum ( ) const

Returns the sum of all the components (i.e. x + y).

Member Data Documentation

◆ x

size_t jet::Size2::x

X (or the first) component of the size.

◆ y

size_t jet::Size2::y

Y (or the second) component of the size.


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