Detailed Description
The PPoint2Di class represents a 2D-point with 32-bit int coordinates; PPoint2Di instances are immutable (thread-safe).
Definition at line 27 of file PPoint2Di.h.
#include <PPoint2Di.h>
Constructor & Destructor Documentation
◆ PPoint2Di() [1/2]
|
explicit |
Constructs a 2D-point from its coordinates (x, y), (0,0) by default.
◆ PPoint2Di() [2/2]
PPoint2Di::PPoint2Di | ( | const PPoint2Di & | other | ) |
Constructs a shared copy of other.
◆ ~PPoint2Di()
|
virtual |
Destroys this object.
Member Function Documentation
◆ EuclideanDistance()
float PPoint2Di::EuclideanDistance | ( | const PPoint2Di & | other | ) | const |
Computes the Euclidean distance between this and other point.
◆ GetX()
papillon::int32 PPoint2Di::GetX | ( | ) | const |
Returns the first coordinate of this 2D-point (column).
◆ GetY()
papillon::int32 PPoint2Di::GetY | ( | ) | const |
Returns the second coordinate of this 2D-point (row).
◆ operator!=()
bool PPoint2Di::operator!= | ( | const PPoint2Di & | other | ) | const |
Returns true if this 2D-point is different of other, false otherwise.
◆ operator*()
PPoint2Di PPoint2Di::operator* | ( | papillon::int32 | scaleBy | ) | const |
Returns a point corresponding to this point where both coordinates have been scaled by the given factor.
◆ operator+()
Returns a point corresponding to this point translated by the specified vector v.
◆ operator-() [1/2]
Returns a point corresponding to this point translated by the specified vector -v.
◆ operator-() [2/2]
PPoint2Di PPoint2Di::operator- | ( | ) | const |
Returns a point with unary minus operator applied to coordinates.
◆ operator=()
Performs a shared copy of other to this object.
◆ operator==()
bool PPoint2Di::operator== | ( | const PPoint2Di & | other | ) | const |
Returns true if this 2D-point is the same than other, false otherwise.
◆ Scaled()
PPoint2Di PPoint2Di::Scaled | ( | papillon::int32 | scaleBy | ) | const |
Returns a point corresponding to this point where both coordinates have been scaled by the given factor.
This can be useful if you have feature points in an image and then scale the image by a factor.
◆ ToPPoint2Df()
◆ Translated() [1/2]
PPoint2Di PPoint2Di::Translated | ( | papillon::int32 | vx, |
papillon::int32 | vy | ||
) | const |
Returns a point corresponding to this point translated by (vx, vy).
◆ Translated() [2/2]
Returns a point corresponding to this point translated by value.
◆ Zero()
|
inlinestatic |
Returns the constant holding the point (0,0).
Definition at line 34 of file PPoint2Di.h.