Tizen Native API
4.0
|
Simple class for passing around pairs of small unsigned integers. More...
Public Member Functions | |
Uint16Pair () | |
Default constructor for the (0, 0) tuple. | |
Uint16Pair (uint32_t width, uint32_t height) | |
Constructor taking separate x and y (width and height) parameters. | |
Uint16Pair (const Uint16Pair &rhs) | |
Copy constructor. | |
void | SetWidth (uint16_t width) |
Sets the width. | |
uint16_t | GetWidth () const |
Get the width. | |
void | SetHeight (uint16_t height) |
Sets the height. | |
uint16_t | GetHeight () const |
Returns the y dimension stored in this 2-tuple. | |
void | SetX (uint16_t x) |
Sets the x dimension (same as width). | |
uint16_t | GetX () const |
Returns the x dimension stored in this 2-tuple. | |
void | SetY (uint16_t y) |
Sets the y dimension (same as height). | |
uint16_t | GetY () const |
Returns the y dimension stored in this 2-tuple. | |
Uint16Pair & | operator= (const Uint16Pair &rhs) |
Assignment operator. | |
bool | operator== (const Uint16Pair &rhs) const |
Equality operator. | |
bool | operator!= (const Uint16Pair &rhs) const |
Inequality operator. | |
bool | operator< (const Uint16Pair &rhs) const |
Less than comparison operator for storing in collections (not geometrically meaningful). | |
bool | operator> (const Uint16Pair &rhs) const |
Greater than comparison operator for storing in collections (not geometrically meaningful). | |
Static Public Member Functions | |
template<typename FLOAT_VECTOR_N_TYPE > | |
static Uint16Pair | FromFloatVec2 (const FLOAT_VECTOR_N_TYPE &from) |
Creates an instance by rounding a floating point vector to closest integers. | |
template<typename FLOAT_ARRAY > | |
static Uint16Pair | FromFloatArray (const FLOAT_ARRAY &from) |
Creates an instance by rounding a floating point array to closest integers. |
Simple class for passing around pairs of small unsigned integers.
Use this for integer dimensions and points with limited range such as image sizes and pixel coordinates where a pair of floating point numbers is inefficient and illogical (i.e. the data is inherently integer). One of these can be passed in a single 32 bit integer register on common architectures.
Default constructor for the (0, 0) tuple.
Dali::Uint16Pair::Uint16Pair | ( | uint32_t | width, |
uint32_t | height | ||
) |
Constructor taking separate x and y (width and height) parameters.
[in] | width | The width or X dimension of the tuple. Make sure it is less than 65536 |
[in] | height | The height or Y dimension of the tuple. Make sure it is less than 65536 |
Dali::Uint16Pair::Uint16Pair | ( | const Uint16Pair & | rhs | ) |
Copy constructor.
[in] | rhs | A reference to assign |
static Uint16Pair Dali::Uint16Pair::FromFloatArray | ( | const FLOAT_ARRAY & | from | ) | [static] |
Creates an instance by rounding a floating point array to closest integers.
Uses a template to allow any vector type with operator [] to be converted in addition to plain arrays.
[in] | from | Floating point array |
static Uint16Pair Dali::Uint16Pair::FromFloatVec2 | ( | const FLOAT_VECTOR_N_TYPE & | from | ) | [static] |
Creates an instance by rounding a floating point vector to closest integers.
Uses a template for loose coupling, to save a header include, and allow any vector type with .x and .y members to be converted.
[in] | from | Floating point vector2 |
uint16_t Dali::Uint16Pair::GetHeight | ( | ) | const |
Returns the y dimension stored in this 2-tuple.
uint16_t Dali::Uint16Pair::GetWidth | ( | ) | const |
Get the width.
uint16_t Dali::Uint16Pair::GetX | ( | ) | const |
Returns the x dimension stored in this 2-tuple.
uint16_t Dali::Uint16Pair::GetY | ( | ) | const |
Returns the y dimension stored in this 2-tuple.
bool Dali::Uint16Pair::operator!= | ( | const Uint16Pair & | rhs | ) | const |
Inequality operator.
[in] | rhs | A reference for comparison |
bool Dali::Uint16Pair::operator< | ( | const Uint16Pair & | rhs | ) | const |
Less than comparison operator for storing in collections (not geometrically meaningful).
[in] | rhs | A reference for comparison |
Uint16Pair& Dali::Uint16Pair::operator= | ( | const Uint16Pair & | rhs | ) |
Assignment operator.
[in] | rhs | Handle to an object |
bool Dali::Uint16Pair::operator== | ( | const Uint16Pair & | rhs | ) | const |
Equality operator.
[in] | rhs | A reference for comparison |
bool Dali::Uint16Pair::operator> | ( | const Uint16Pair & | rhs | ) | const |
Greater than comparison operator for storing in collections (not geometrically meaningful).
[in] | rhs | A reference for comparison |
void Dali::Uint16Pair::SetHeight | ( | uint16_t | height | ) |
Sets the height.
[in] | height | The y dimension to be stored in this 2-tuple |
void Dali::Uint16Pair::SetWidth | ( | uint16_t | width | ) |
Sets the width.
[in] | width | The x dimension to be stored in this 2-tuple |
void Dali::Uint16Pair::SetX | ( | uint16_t | x | ) |
Sets the x dimension (same as width).
[in] | x | The x dimension to be stored in this 2-tuple |
void Dali::Uint16Pair::SetY | ( | uint16_t | y | ) |
Sets the y dimension (same as height).
[in] | y | The y dimension to be stored in this 2-tuple |