Skia
2DGraphicsLibrary
|
SkIPoint holds two 32 bit integer coordinates. More...
#include <SkPoint.h>
Public Member Functions | |
int32_t | x () const |
int32_t | y () const |
void | setX (int32_t x) |
void | setY (int32_t y) |
bool | isZero () const |
Returns true iff fX and fY are both zero. | |
void | setZero () |
Set both fX and fY to zero. More... | |
void | set (int32_t x, int32_t y) |
Set the x and y values of the point. More... | |
void | rotateCW (SkIPoint *dst) const |
Rotate the point clockwise, writing the new point into dst It is legal for dst == this. | |
void | rotateCW () |
Rotate the point clockwise, writing the new point back into the point. | |
void | rotateCCW (SkIPoint *dst) const |
Rotate the point counter-clockwise, writing the new point into dst. More... | |
void | rotateCCW () |
Rotate the point counter-clockwise, writing the new point back into the point. | |
void | negate () |
Negate the X and Y coordinates of the point. | |
SkIPoint | operator- () const |
Return a new point whose X and Y coordinates are the negative of the original point's. | |
void | operator+= (const SkIPoint &v) |
Add v's coordinates to this point's. | |
void | operator-= (const SkIPoint &v) |
Subtract v's coordinates from this point's. | |
bool | equals (int32_t x, int32_t y) const |
Returns true if the point's coordinates equal (x,y) | |
Static Public Member Functions | |
static SkIPoint | Make (int32_t x, int32_t y) |
static int32_t | DotProduct (const SkIPoint &a, const SkIPoint &b) |
Returns the dot product of a and b, treating them as 2D vectors. | |
static int32_t | CrossProduct (const SkIPoint &a, const SkIPoint &b) |
Returns the cross product of a and b, treating them as 2D vectors. | |
Public Attributes | |
int32_t | fX |
int32_t | fY |
Friends | |
bool | operator== (const SkIPoint &a, const SkIPoint &b) |
bool | operator!= (const SkIPoint &a, const SkIPoint &b) |
SkIPoint | operator- (const SkIPoint &a, const SkIPoint &b) |
Returns a new point whose coordinates are the difference between a and b (i.e. More... | |
SkIPoint | operator+ (const SkIPoint &a, const SkIPoint &b) |
Returns a new point whose coordinates are the sum of a and b (a + b) | |
SkIPoint holds two 32 bit integer coordinates.
void SkIPoint::rotateCCW | ( | SkIPoint * | dst | ) | const |
Rotate the point counter-clockwise, writing the new point into dst.
It is legal for dst == this
|
inline |
Set the x and y values of the point.
|
inline |
Set both fX and fY to zero.
Same as set(0, 0)
Returns a new point whose coordinates are the difference between a and b (i.e.
a - b)