DsSize is class that represents the 2D size of a graphic object (width, height) as integer values.
More...
#include <ds_geometry.h>
|
int32_t | w |
| Width component.
|
|
int32_t | h |
| Height component.
|
|
DsSize is class that represents the 2D size of a graphic object (width, height) as integer values.
◆ DsSize() [1/2]
DsSize::DsSize |
( |
int32_t |
w, |
|
|
int32_t |
h |
|
) |
| |
|
inline |
Creates a DsSize object of size (w, h).
- Parameters
-
w | Width in pixels |
h | Height in pixels |
◆ DsSize() [2/2]
DsSize::DsSize |
( |
const DsPoint & |
p | ) |
|
|
inline |
Creates a DsSize object using the X and Y coordinates of a point as width and height.
- Parameters
-
◆ operator DsFPoint()
◆ operator DsPoint()
◆ operator!=()
bool DsSize::operator!= |
( |
const DsSize & |
rhs | ) |
const |
|
inline |
Comparison operator.
- Parameters
-
rhs | Right hand side DsSize object of the comparison operator |
◆ operator+=() [1/2]
Addition operator - adds a DsSize object to the current DsSize object.
- Parameters
-
rhs | Right hand side DsSize object |
- Returns
- Object reference
◆ operator+=() [2/2]
DsSize & DsSize::operator+= |
( |
int32_t |
rhs | ) |
|
|
inline |
Addition operator - adds an integer to the current DsSize object (add to both w and h).
- Parameters
-
- Returns
- Object reference
◆ operator-()
DsSize DsSize::operator- |
( |
| ) |
const |
|
inline |
Unary minus operator. Reverses the signs of both the W and H of the current DsSize object.
- Returns
- DsSize with both the W and H components of the current object having the signs reversed
◆ operator-=() [1/2]
Subtraction operator - subtracts a DsSize object from the current DsSize object.
- Parameters
-
rhs | Right hand side DsSize object |
- Returns
- Object reference
◆ operator-=() [2/2]
DsSize & DsSize::operator-= |
( |
int32_t |
rhs | ) |
|
|
inline |
Subtraction operator - subtracts an integer from the current DsSize object.
- Parameters
-
- Returns
- Object reference
◆ operator==()
bool DsSize::operator== |
( |
const DsSize & |
rhs | ) |
const |
|
inline |
Comparison operator.
- Parameters
-
rhs | Right hand side DsSize object of the comparison operator |
◆ saturate()
Saturates the current DsSize object components to the minimum and maximum specified.
- Parameters
-
min | Minimum value |
max | Maximum value |
- Returns
- Saturated DsSize object
◆ saturateMax()
Saturates the current DsSize object components to the maximum specified.
- Parameters
-
- Returns
- Saturated DsSize object
◆ saturateMin()
Saturates the current DsSize object components to the minimum specified.
- Parameters
-
- Returns
- Saturated DsSize object
◆ swap()
Returns a DsSize object with the width and height swapped.
- Returns
- Swapped DsSize object
◆ operator*
Multiplication operator - multiplies both W and H components of a DsSize object with the same multiplier.
- Parameters
-
lhs | Left hand side DsSize object |
multiplier | Right hand side multiplier |
- Returns
- lfs DsSize object multiplied by the multiplier
◆ operator+ [1/2]
Addition operator - adds two DsSize objects.
- Parameters
-
lhs | Left hand side DsSize object |
rhs | Right hand side DsSize object |
- Returns
- The sum of lhs and rhs DsSize objects
◆ operator+ [2/2]
Addition operator - adds two DsSize objects.
- Parameters
-
lhs | Left hand side DsSize object |
rhs | Right hand side value |
- Returns
- The sum of lhs and the rhs value
◆ operator- [1/2]
Subtraction operator - subtracts two DsSize objects.
- Parameters
-
lhs | Left hand side DsSize object |
rhs | Right hand side DsSize object |
- Returns
- The difference between lhs and rhs DsSize objects
◆ operator- [2/2]
Subtraction operator - subtracts an integer from a DsSize object.
- Parameters
-
lhs | Left hand side DsSize object |
rhs | Right hand side value |
- Returns
- The difference between lhs and rhs DsSize objects
◆ operator/
Division operator - divides both W and H components of a DsSize object by the same divisor.
- Parameters
-
lhs | Left hand side DsSize object |
divisor | Right hand side divisor |
- Returns
- lfs DsSize object divided by the divisor
The documentation for this class was generated from the following file: