Detailed Description
The PSizef class represents the size of an image or a rectangle: width (float) and height (float); PSizef instances are immutable (thread-safe).
#include <PSizef.h>
Constructor & Destructor Documentation
◆ PSizef() [1/4]
PSizef::PSizef | ( | ) |
Constructs a size (0,0).
◆ PSizef() [2/4]
|
explicit |
Constructs a size of s x s.
◆ PSizef() [3/4]
|
explicit |
Constructs a size from width and height.
◆ PSizef() [4/4]
PSizef::PSizef | ( | const PSizef & | other | ) |
Constructs a shared copy of other.
◆ ~PSizef()
|
virtual |
Destroys this object.
Member Function Documentation
◆ Bad()
|
inlinestatic |
◆ Clamped()
PSizef PSizef::Clamped | ( | float | min, |
float | max | ||
) |
Clamps width and height with given limit values.
◆ ClampedWH()
PSizef PSizef::ClampedWH | ( | float | minW, |
float | maxW, | ||
float | minH, | ||
float | maxH | ||
) |
Returns a PSizei which corresponds to this size object clamped with given limit values; width and height are clamped separately.
◆ FromString()
Parses the specified string to build a PSizei object.
Expected format is "WxH" or "W,H" or "W;H" or "W H" where W=width and H=height. If failure, size is set to 0x0. Returns PResult::C_OK if success, another result otherwise.
◆ GetHeight()
float PSizef::GetHeight | ( | ) | const |
Returns the height.
◆ GetWidth()
float PSizef::GetWidth | ( | ) | const |
Returns the width.
◆ IsValid()
bool PSizef::IsValid | ( | ) | const |
Returns true if this size is valid (width and height are positive), false otherwise.
◆ operator!=()
bool PSizef::operator!= | ( | const PSizef & | other | ) | const |
Returns true if this size is different of other, false otherwise.
◆ operator=()
◆ operator==()
bool PSizef::operator== | ( | const PSizef & | other | ) | const |
Returns true if this size is the same than other, false otherwise.
◆ Scaled()
PSizef PSizef::Scaled | ( | float | factor | ) | const |
Returns a PSizef object equal to this one scaled by the specified factor.
◆ ToSizei()
◆ ToStringShort()
PString PSizef::ToStringShort | ( | ) | const |
Returns a string representation of this object: "WxH".