Detailed Description
The PSizei class represents the size of an image or a rectangle: width (int) and height (int); PSizei instances are immutable (thread-safe).
#include <PSizei.h>
Constructor & Destructor Documentation
◆ PSizei() [1/4]
PSizei::PSizei | ( | ) |
Constructs a size (0,0).
◆ PSizei() [2/4]
|
explicit |
Constructs a size of n x n.
◆ PSizei() [3/4]
|
explicit |
Constructs a size from width and height.
◆ PSizei() [4/4]
PSizei::PSizei | ( | const PSizei & | other | ) |
Constructs a shared copy of other.
◆ ~PSizei()
|
virtual |
Destroys this object.
Member Function Documentation
◆ Clamped()
PSizei PSizei::Clamped | ( | papillon::int32 | min, |
papillon::int32 | max | ||
) |
Returns a PSizei which corresponds to this size object clamped with given limit values.
◆ ClampedWH()
PSizei PSizei::ClampedWH | ( | papillon::int32 | minW, |
papillon::int32 | maxW, | ||
papillon::int32 | minH, | ||
papillon::int32 | 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()
papillon::int32 PSizei::GetHeight | ( | ) | const |
Returns the height.
◆ GetWidth()
papillon::int32 PSizei::GetWidth | ( | ) | const |
Returns the width.
◆ IsValid()
bool PSizei::IsValid | ( | ) | const |
Returns true if this size is valid (width and height are >= 0), false otherwise.
◆ IsZero()
bool PSizei::IsZero | ( | ) | const |
Returns true if this size is 0x0, false otherwise.
◆ operator!=()
bool PSizei::operator!= | ( | const PSizei & | other | ) | const |
Returns true if this size is different of other, false otherwise.
◆ operator=()
◆ operator==()
bool PSizei::operator== | ( | const PSizei & | other | ) | const |
Returns true if this size is the same than other, false otherwise.
◆ Scaled()
PSizei PSizei::Scaled | ( | float | factor | ) | const |
Returns a PSizei object equal to this one scaled by the specified factor.
◆ ToSizef()
◆ ToStringShort()
PString PSizei::ToStringShort | ( | ) | const |
Returns a string representation of this object: "WxH".