#include <SkPoint_impl.h>
SkIPoint holds two 32-bit integer coordinates.
Definition at line 28 of file SkPoint_impl.h.
◆ equals()
bool SkIPoint::equals |
( |
int32_t |
x, |
|
|
int32_t |
y |
|
) |
| const |
|
inline |
Returns true if SkIPoint is equivalent to SkIPoint constructed from (x, y).
- Parameters
-
x | value compared with fX |
y | value compared with fY |
- Returns
- true if SkIPoint equals (x, y)
Definition at line 102 of file SkPoint_impl.h.
102 {
103 return fX ==
x &&
fY ==
y;
104 }
constexpr int32_t y() const
constexpr int32_t x() const
◆ isZero()
bool SkIPoint::isZero |
( |
| ) |
const |
|
inline |
Returns true if fX and fY are both zero.
- Returns
- true if fX is zero and fY is zero
Definition at line 58 of file SkPoint_impl.h.
58{
return (
fX |
fY) == 0; }
◆ Make()
static constexpr SkIPoint SkIPoint::Make |
( |
int32_t |
x, |
|
|
int32_t |
y |
|
) |
| |
|
inlinestaticconstexpr |
◆ operator+=()
void SkIPoint::operator+= |
( |
const SkIVector & |
v | ) |
|
|
inline |
Offsets SkIPoint by ivector v. Sets SkIPoint to (fX + v.fX, fY + v.fY).
- Parameters
-
Definition at line 82 of file SkPoint_impl.h.
82 {
85 }
static constexpr int32_t Sk32_sat_add(int32_t a, int32_t b)
◆ operator-()
◆ operator-=()
void SkIPoint::operator-= |
( |
const SkIVector & |
v | ) |
|
|
inline |
Subtracts ivector v from SkIPoint. Sets SkIPoint to: (fX - v.fX, fY - v.fY).
- Parameters
-
Definition at line 91 of file SkPoint_impl.h.
91 {
94 }
static constexpr int32_t Sk32_sat_sub(int32_t a, int32_t b)
◆ set()
void SkIPoint::set |
( |
int32_t |
x, |
|
|
int32_t |
y |
|
) |
| |
|
inline |
Sets fX to x and fY to y.
- Parameters
-
x | new value for fX |
y | new value for fY |
Definition at line 65 of file SkPoint_impl.h.
◆ x()
constexpr int32_t SkIPoint::x |
( |
| ) |
const |
|
inlineconstexpr |
◆ y()
constexpr int32_t SkIPoint::y |
( |
| ) |
const |
|
inlineconstexpr |
◆ operator!=
Returns true if a is not equivalent to b.
- Parameters
-
- Returns
- true if a.fX != b.fX or a.fY != b.fY
Definition at line 122 of file SkPoint_impl.h.
122 {
123 return a.fX !=
b.fX ||
a.fY !=
b.fY;
124 }
◆ operator+
Returns SkIPoint resulting from SkIPoint a offset by ivector b, computed as: (a.fX + b.fX, a.fY + b.fY).
Can also be used to offset SkIPoint b by ivector a, returning SkIPoint. Can also be used to add ivector to ivector, returning ivector.
- Parameters
-
- Returns
- SkIPoint equal to a offset by b
Definition at line 148 of file SkPoint_impl.h.
◆ operator-
Returns ivector from b to a; computed as (a.fX - b.fX, a.fY - b.fY).
Can also be used to subtract ivector from ivector, returning ivector.
- Parameters
-
a | SkIPoint or ivector to subtract from |
b | ivector to subtract |
- Returns
- ivector from b to a
Definition at line 134 of file SkPoint_impl.h.
◆ operator==
Returns true if a is equivalent to b.
- Parameters
-
- Returns
- true if a.fX == b.fX and a.fY == b.fY
Definition at line 112 of file SkPoint_impl.h.
112 {
113 return a.fX ==
b.fX &&
a.fY ==
b.fY;
114 }
◆ fX
◆ fY
The documentation for this struct was generated from the following file: