Iridescence 1.00
Embedded Graphic Framework
Loading...
Searching...
No Matches
DsFSize Class Reference

DsFSize is class that represents the 2D size of a graphic object (width, height) as floating point values. More...

#include <ds_geometry.h>

Public Member Functions

 DsFSize ()
 Creates a DsFSize object of size (0, 0).
 
 DsFSize (float w, float h)
 Creates a DsFSize object of size (w, h).
 
 DsFSize (const DsPoint &p)
 Creates a DsFSize object using the X and Y coordinates of a point as width and height.
 
 DsFSize (const DsFPoint &p)
 Creates a DsFSize object using the X and Y coordinates of a point as width and height.
 
 DsFSize (const DsSize &s)
 Creates a DsFSize object from a DsSize object.
 
bool operator== (const DsFSize &rhs) const
 Comparison operator.
 
bool operator!= (const DsFSize &rhs) const
 Comparison operator.
 
DsFSize operator- () const
 Unary minus operator. Reverses the signs of both the W and H of the current DsFSize object.
 
DsFSizeoperator+= (const DsFSize &rhs)
 Addition operator - adds a DsFSize object to the current DsFSize object.
 
DsFSizeoperator+= (float rhs)
 Addition operator - adds an integer to the current DsFSize object (add to both w and h).
 
DsFSizeoperator-= (const DsFSize &rhs)
 Subtraction operator - subtracts a DsFSize object from the current DsFSize object.
 
DsFSizeoperator-= (float rhs)
 Subtraction operator - subtracts an integer from the current DsFSize object.
 
DsFSize swap (void)
 Returns a DsFSize object with the width and height swapped.
 
DsFSize saturateMin (const DsFSize &min)
 Saturates the current DsFSize object components to the minimum specified.
 
DsFSize saturateMax (const DsFSize &max)
 Saturates the current DsFSize object components to the maximum specified.
 
DsFSize saturate (const DsFSize &min, const DsFSize &max)
 Saturates the current DsFSize object components to the minimum and maximum specified.
 
 operator DsPoint () const
 Conversion operator to DsPoint.
 
 operator DsFPoint () const
 Conversion operator to DsFPoint.
 
 operator DsSize () const
 Conversion operator to DsSize.
 

Public Attributes

float w
 Width component.
 
float h
 Height component.
 

Friends

DsFSize operator+ (const DsFSize &lhs, const DsFSize &rhs)
 Addition operator - adds two DsFSize objects.
 
DsFSize operator+ (const DsFSize &lhs, float rhs)
 Addition operator - adds two DsFSize objects.
 
DsFSize operator- (const DsFSize &lhs, const DsFSize &rhs)
 Subtraction operator - subtracts two DsFSize objects.
 
DsFSize operator- (const DsFSize &lhs, float rhs)
 Subtraction operator - subtracts an integer from a DsFSize object.
 
DsFSize operator* (const DsFSize &lhs, float multiplier)
 Multiplication operator - multiplies both W and H components of a DsFSize object with the same multiplier.
 
DsFSize operator* (const DsFSize &lhs, const DsFSize &rhs)
 Multiplication operator - multiplies both W and H components of a DsFSize object with the (W, H) components from another DsFSize object.
 
DsFSize operator/ (const DsFSize &lhs, const DsFSize &rhs)
 Division operator - divides both W and H components of a DsFSize object by the same divisor.
 
DsFSize operator/ (const DsFSize &lhs, float divisor)
 Division operator - divides both W and H components of a DsFSize object by the (W, H) components from another DsFSize object.
 

Detailed Description

DsFSize is class that represents the 2D size of a graphic object (width, height) as floating point values.

Constructor & Destructor Documentation

◆ DsFSize() [1/4]

DsFSize::DsFSize ( float  w,
float  h 
)
inline

Creates a DsFSize object of size (w, h).

Parameters
wWidth in pixels
hHeight in pixels

◆ DsFSize() [2/4]

DsFSize::DsFSize ( const DsPoint p)
inline

Creates a DsFSize object using the X and Y coordinates of a point as width and height.

Parameters
pSource point

◆ DsFSize() [3/4]

DsFSize::DsFSize ( const DsFPoint p)
inline

Creates a DsFSize object using the X and Y coordinates of a point as width and height.

Parameters
pSource point

◆ DsFSize() [4/4]

DsFSize::DsFSize ( const DsSize s)
inline

Creates a DsFSize object from a DsSize object.

Parameters
sSource DsSize object

Member Function Documentation

◆ operator DsFPoint()

DsFSize::operator DsFPoint ( ) const
inline

Conversion operator to DsFPoint.

Returns
DsFPoint object

◆ operator DsPoint()

DsFSize::operator DsPoint ( ) const
inline

Conversion operator to DsPoint.

Returns
DsPoint object

◆ operator DsSize()

DsFSize::operator DsSize ( ) const
inline

Conversion operator to DsSize.

Returns
DsSize object

◆ operator!=()

bool DsFSize::operator!= ( const DsFSize rhs) const
inline

Comparison operator.

Parameters
rhsRight hand side DsFSize object of the comparison operator

◆ operator+=() [1/2]

DsFSize & DsFSize::operator+= ( const DsFSize rhs)
inline

Addition operator - adds a DsFSize object to the current DsFSize object.

Parameters
rhsRight hand side DsFSize object
Returns
Object reference

◆ operator+=() [2/2]

DsFSize & DsFSize::operator+= ( float  rhs)
inline

Addition operator - adds an integer to the current DsFSize object (add to both w and h).

Parameters
rhsRight hand side value
Returns
Object reference

◆ operator-()

DsFSize DsFSize::operator- ( ) const
inline

Unary minus operator. Reverses the signs of both the W and H of the current DsFSize object.

Returns
DsFSize with both the W and H components of the current object having the signs reversed

◆ operator-=() [1/2]

DsFSize & DsFSize::operator-= ( const DsFSize rhs)
inline

Subtraction operator - subtracts a DsFSize object from the current DsFSize object.

Parameters
rhsRight hand side DsFSize object
Returns
Object reference

◆ operator-=() [2/2]

DsFSize & DsFSize::operator-= ( float  rhs)
inline

Subtraction operator - subtracts an integer from the current DsFSize object.

Parameters
rhsRight hand side
Returns
Object reference

◆ operator==()

bool DsFSize::operator== ( const DsFSize rhs) const
inline

Comparison operator.

Parameters
rhsRight hand side DsFSize object of the comparison operator

◆ saturate()

DsFSize DsFSize::saturate ( const DsFSize min,
const DsFSize max 
)
inline

Saturates the current DsFSize object components to the minimum and maximum specified.

Parameters
minMinimum value
maxMaximum value
Returns
Saturated DsFSize object

◆ saturateMax()

DsFSize DsFSize::saturateMax ( const DsFSize max)
inline

Saturates the current DsFSize object components to the maximum specified.

Parameters
minMaximum value
Returns
Saturated DsFSize object

◆ saturateMin()

DsFSize DsFSize::saturateMin ( const DsFSize min)
inline

Saturates the current DsFSize object components to the minimum specified.

Parameters
minMinimum value
Returns
Saturated DsFSize object

◆ swap()

DsFSize DsFSize::swap ( void  )
inline

Returns a DsFSize object with the width and height swapped.

Returns
Swapped DsFSize object

Friends And Related Symbol Documentation

◆ operator* [1/2]

DsFSize operator* ( const DsFSize lhs,
const DsFSize rhs 
)
friend

Multiplication operator - multiplies both W and H components of a DsFSize object with the (W, H) components from another DsFSize object.

Parameters
lhsLeft hand side DsFSize object
rhsRight hand side DsFSize object
Returns
DsFSize object multiplied by the multiplier

◆ operator* [2/2]

DsFSize operator* ( const DsFSize lhs,
float  multiplier 
)
friend

Multiplication operator - multiplies both W and H components of a DsFSize object with the same multiplier.

Parameters
lhsLeft hand side DsFSize object
multiplierRight hand side multiplier
Returns
DsFSize object multiplied by the multiplier

◆ operator+ [1/2]

DsFSize operator+ ( const DsFSize lhs,
const DsFSize rhs 
)
friend

Addition operator - adds two DsFSize objects.

Parameters
lhsLeft hand side DsFSize object
rhsRight hand side DsFSize object
Returns
The sum of lhs and rhs DsFSize objects

◆ operator+ [2/2]

DsFSize operator+ ( const DsFSize lhs,
float  rhs 
)
friend

Addition operator - adds two DsFSize objects.

Parameters
lhsLeft hand side DsFSize object
rhsRight hand side value
Returns
The sum of lhs and the rhs value

◆ operator- [1/2]

DsFSize operator- ( const DsFSize lhs,
const DsFSize rhs 
)
friend

Subtraction operator - subtracts two DsFSize objects.

Parameters
lhsLeft hand side DsFSize object
rhsRight hand side DsFSize object
Returns
The difference between lhs and rhs DsFSize objects

◆ operator- [2/2]

DsFSize operator- ( const DsFSize lhs,
float  rhs 
)
friend

Subtraction operator - subtracts an integer from a DsFSize object.

Parameters
lhsLeft hand side DsFSize object
rhsRight hand side value
Returns
The difference between lhs and rhs DsFSize objects

◆ operator/ [1/2]

DsFSize operator/ ( const DsFSize lhs,
const DsFSize rhs 
)
friend

Division operator - divides both W and H components of a DsFSize object by the same divisor.

Parameters
lhsLeft hand side DsFSize object
rhsRight hand side DsFSize object
Returns
DsFSize object divided by the divisor

◆ operator/ [2/2]

DsFSize operator/ ( const DsFSize lhs,
float  divisor 
)
friend

Division operator - divides both W and H components of a DsFSize object by the (W, H) components from another DsFSize object.

Parameters
lhsLeft hand side DsFSize object
divisorRight hand side divisor
Returns
DsFSize object divided by the divisor

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