Specifies a 2 dimensional size. More...
#include <dimension2d.h>
Public Member Functions | |
dimension2d () | |
Default constructor for empty dimension. More... | |
dimension2d (const T &width, const T &height) | |
Constructor with width and height. More... | |
dimension2d (const vector2d< T > &other) | |
template<class U > | |
dimension2d (const dimension2d< U > &other) | |
Use this constructor only where you are sure that the conversion is valid. More... | |
T | getArea () const |
Get area. More... | |
dimension2d< T > | getInterpolated (const dimension2d< T > &other, f32 d) const |
Get the interpolated dimension. More... | |
dimension2d< T > | getOptimalSize (bool requirePowerOfTwo=true, bool requireSquare=false, bool larger=true, u32 maxValue=0) const |
Get the optimal size according to some properties. More... | |
bool | operator!= (const dimension2d< T > &other) const |
Inequality operator. More... | |
bool | operator!= (const vector2d< T > &other) const |
dimension2d< T > | operator* (const T &scale) const |
Multiply width and height by scalar. More... | |
dimension2d< T > & | operator*= (const T &scale) |
Multiply width and height by scalar. More... | |
dimension2d< T > | operator+ (const dimension2d< T > &other) const |
Add two dimensions. More... | |
dimension2d< T > & | operator+= (const dimension2d< T > &other) |
Add another dimension to this one. More... | |
dimension2d< T > | operator- (const dimension2d< T > &other) const |
Subtract one dimension from another. More... | |
dimension2d< T > & | operator-= (const dimension2d< T > &other) |
Subtract a dimension from this one. More... | |
dimension2d< T > | operator/ (const T &scale) const |
Divide width and height by scalar. More... | |
dimension2d< T > & | operator/= (const T &scale) |
Divide width and height by scalar. More... | |
template<class U > | |
dimension2d< T > & | operator= (const dimension2d< U > &other) |
bool | operator== (const dimension2d< T > &other) const |
Equality operator. More... | |
bool | operator== (const vector2d< T > &other) const |
dimension2d< T > & | set (const T &width, const T &height) |
Set to new values. More... | |
Public Attributes | |
T | Height |
Height of the dimension. More... | |
T | Width |
Width of the dimension. More... | |
Specifies a 2 dimensional size.
Definition at line 20 of file dimension2d.h.
|
inline |
Default constructor for empty dimension.
Definition at line 24 of file dimension2d.h.
Referenced by irr::core::dimension2d< u32 >::dimension2d().
|
inline |
Constructor with width and height.
Definition at line 26 of file dimension2d.h.
irr::core::dimension2d< T >::dimension2d | ( | const vector2d< T > & | other | ) |
Definition at line 333 of file vector2d.h.
|
inlineexplicit |
Use this constructor only where you are sure that the conversion is valid.
Definition at line 33 of file dimension2d.h.
|
inline |
Get area.
Definition at line 130 of file dimension2d.h.
|
inline |
Get the interpolated dimension.
other | Other dimension to interpolate with. |
d | Value between 0.0f and 1.0f. |
Definition at line 196 of file dimension2d.h.
|
inline |
Get the optimal size according to some properties.
This is a function often used for texture dimension calculations. The function returns the next larger or smaller dimension which is a power-of-two dimension (2^n,2^m) and/or square (Width=Height).
requirePowerOfTwo | Forces the result to use only powers of two as values. |
requireSquare | Makes width==height in the result |
larger | Choose whether the result is larger or smaller than the current dimension. If one dimension need not be changed it is kept with any value of larger. |
maxValue | Maximum texturesize. if value > 0 size is clamped to maxValue |
Definition at line 150 of file dimension2d.h.
|
inline |
Inequality operator.
Definition at line 53 of file dimension2d.h.
|
inline |
Definition at line 60 of file dimension2d.h.
|
inline |
Multiply width and height by scalar.
Definition at line 96 of file dimension2d.h.
|
inline |
Multiply width and height by scalar.
Definition at line 88 of file dimension2d.h.
|
inline |
Add two dimensions.
Definition at line 110 of file dimension2d.h.
|
inline |
Add another dimension to this one.
Definition at line 102 of file dimension2d.h.
|
inline |
Subtract one dimension from another.
Definition at line 124 of file dimension2d.h.
|
inline |
Subtract a dimension from this one.
Definition at line 116 of file dimension2d.h.
|
inline |
Divide width and height by scalar.
Definition at line 82 of file dimension2d.h.
|
inline |
Divide width and height by scalar.
Definition at line 74 of file dimension2d.h.
|
inline |
Definition at line 37 of file dimension2d.h.
|
inline |
Equality operator.
Definition at line 46 of file dimension2d.h.
Referenced by irr::core::dimension2d< u32 >::operator!=().
bool irr::core::dimension2d< T >::operator== | ( | const vector2d< T > & | other | ) | const |
Definition at line 336 of file vector2d.h.
|
inline |
Set to new values.
Definition at line 66 of file dimension2d.h.
T irr::core::dimension2d< T >::Height |
Height of the dimension.
Definition at line 206 of file dimension2d.h.
Referenced by irr::core::dimension2d< u32 >::getArea(), irr::core::dimension2d< u32 >::getInterpolated(), irr::core::dimension2d< u32 >::getOptimalSize(), irr::core::dimension2d< u32 >::operator*(), irr::core::dimension2d< u32 >::operator*=(), irr::core::vector2d< f32 >::operator+(), irr::core::dimension2d< u32 >::operator+(), irr::core::vector2d< f32 >::operator+=(), irr::core::dimension2d< u32 >::operator+=(), irr::core::vector2d< f32 >::operator-(), irr::core::dimension2d< u32 >::operator-(), irr::core::vector2d< f32 >::operator-=(), irr::core::dimension2d< u32 >::operator-=(), irr::core::dimension2d< u32 >::operator/(), irr::core::dimension2d< u32 >::operator/=(), irr::core::dimension2d< u32 >::operator=(), irr::core::vector2d< f32 >::operator=(), irr::core::dimension2d< u32 >::operator==(), irr::gui::IGUIElement::recalculateAbsolutePosition(), irr::gui::IGUIElement::serializeAttributes(), irr::core::dimension2d< u32 >::set(), irr::gui::IGUIElement::setMinSize(), irr::gui::IGUIElement::setRelativePosition(), and irr::gui::IGUIElement::setRelativePositionProportional().
T irr::core::dimension2d< T >::Width |
Width of the dimension.
Definition at line 204 of file dimension2d.h.
Referenced by irr::core::dimension2d< u32 >::getArea(), irr::core::dimension2d< u32 >::getInterpolated(), irr::core::dimension2d< u32 >::getOptimalSize(), irr::core::dimension2d< u32 >::operator*(), irr::core::dimension2d< u32 >::operator*=(), irr::core::vector2d< f32 >::operator+(), irr::core::dimension2d< u32 >::operator+(), irr::core::vector2d< f32 >::operator+=(), irr::core::dimension2d< u32 >::operator+=(), irr::core::vector2d< f32 >::operator-(), irr::core::dimension2d< u32 >::operator-(), irr::core::vector2d< f32 >::operator-=(), irr::core::dimension2d< u32 >::operator-=(), irr::core::dimension2d< u32 >::operator/(), irr::core::dimension2d< u32 >::operator/=(), irr::core::dimension2d< u32 >::operator=(), irr::core::vector2d< f32 >::operator=(), irr::core::dimension2d< u32 >::operator==(), irr::gui::IGUIElement::recalculateAbsolutePosition(), irr::gui::IGUIElement::serializeAttributes(), irr::core::dimension2d< u32 >::set(), irr::gui::IGUIElement::setMinSize(), irr::gui::IGUIElement::setRelativePosition(), and irr::gui::IGUIElement::setRelativePositionProportional().