skia2/site/user/api/SkIPoint_Reference.md

516 lines
19 KiB
Markdown
Raw Normal View History

SkIPoint Reference
===
<a name='SkIPoint'></a>
---
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
struct <a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a> {
int32_t <a href='#SkIPoint_fX'>fX</a>;
int32_t <a href='#SkIPoint_fY'>fY</a>;
static constexpr <a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a> <a href='#SkIPoint_Make'>Make</a>(int32_t x, int32_t y);
int32_t <a href='#SkIPoint_x'>x()</a> const;
int32_t <a href='#SkIPoint_y'>y()</a> const;
bool <a href='#SkIPoint_isZero'>isZero</a>() const;
void <a href='#SkIPoint_set'>set</a>(int32_t x, int32_t y);
<a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a> operator-() const;
void <a href='#SkIPoint_addto_operator'>operator+=</a>(const <a href='SkIPoint_Reference#SkIVector'>SkIVector</a>& v);
void <a href='#SkIPoint_subtractfrom_operator'>operator-=</a>(const <a href='SkIPoint_Reference#SkIVector'>SkIVector</a>& v);
bool <a href='#SkIPoint_equals'>equals</a>(int32_t x, int32_t y) const;
friend bool <a href='#SkIPoint_equal_operator'>operator==</a>(const <a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a>& a, const <a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a>& b);
friend bool <a href='#SkIPoint_notequal_operator'>operator!=</a>(const <a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a>& a, const <a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a>& b);
friend <a href='SkIPoint_Reference#SkIVector'>SkIVector</a> <a href='#SkIPoint_subtract_operator'>operator-</a>(const <a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a>& a, const <a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a>& b);
friend <a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a> <a href='#SkIPoint_add_operator'>operator+</a>(const <a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a>& a, const <a href='SkIPoint_Reference#SkIVector'>SkIVector</a>& b);
};
</pre>
<a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a> holds two 32-bit integer coordinates.<table style='border-collapse: collapse; width: 62.5em'>
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Type</th>
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Member</th>
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>int32_t</td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkIPoint_fX'><code>fX</code></a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>
x-axis value used by <a href='SkIPoint_Reference#IPoint'>IPoint</a>.
</td>
</tr>
<tr>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>int32_t</td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkIPoint_fY'><code>fY</code></a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>
y-axis value used by <a href='SkIPoint_Reference#IPoint'>IPoint</a>.
</td>
</tr>
</table>
<a name='SkIPoint_Make'></a>
---
<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
static constexpr <a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a> <a href='#SkIPoint_Make'>Make</a>(int32_t x, int32_t y)
</pre>
Sets <a href='#SkIPoint_fX'>fX</a> to <a href='#SkIPoint_Make_x'>x</a>, <a href='#SkIPoint_fY'>fY</a> to <a href='#SkIPoint_Make_y'>y</a>.
### Parameters
<table> <tr> <td><a name='SkIPoint_Make_x'><code><strong>x</strong></code></a></td>
<td>integer x-axis value of constructed <a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a></td>
</tr>
<tr> <td><a name='SkIPoint_Make_y'><code><strong>y</strong></code></a></td>
<td>integer y-axis value of constructed <a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a></td>
</tr>
</table>
### Return Value
<a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a> (<a href='#SkIPoint_Make_x'>x</a>, <a href='#SkIPoint_Make_y'>y</a>)
### Example
Docs: Update docs to point at named fiddles for x in docs/examples/* ; do if grep -q '// Disabled' $x; then continue fi HASH=$(sed -n 's#^// HASH=\(.*\)$#\1#p' $x) NAME=$(sed -n 's#^REG_FIDDLE(\([^,]*\),.*$#\1#p' $x) FILES="$(grep -l $HASH site/user/api/*.md)" if [ "$FILES" ] ; then echo $HASH $NAME $FILES; sed -i "s/$HASH/@$NAME/g" $FILES fi done https://skia.org/user/api/SkAutoCanvasRestore_Reference?cl=248158 https://skia.org/user/api/SkBitmap_Reference?cl=248158 https://skia.org/user/api/SkBlendMode_Reference?cl=248158 https://skia.org/user/api/SkCanvas_Reference?cl=248158 https://skia.org/user/api/SkColor4f_Reference?cl=248158 https://skia.org/user/api/SkColor_Reference?cl=248158 https://skia.org/user/api/SkFont_Reference?cl=248158 https://skia.org/user/api/SkIPoint_Reference?cl=248158 https://skia.org/user/api/SkIRect_Reference?cl=248158 https://skia.org/user/api/SkImageInfo_Reference?cl=248158 https://skia.org/user/api/SkImage_Reference?cl=248158 https://skia.org/user/api/SkMatrix_Reference?cl=248158 https://skia.org/user/api/SkPaint_Reference?cl=248158 https://skia.org/user/api/SkPath_Reference?cl=248158 https://skia.org/user/api/SkPicture_Reference?cl=248158 https://skia.org/user/api/SkPixmap_Reference?cl=248158 https://skia.org/user/api/SkPoint_Reference?cl=248158 https://skia.org/user/api/SkRRect_Reference?cl=248158 https://skia.org/user/api/SkRect_Reference?cl=248158 https://skia.org/user/api/SkRegion_Reference?cl=248158 https://skia.org/user/api/SkSurface_Reference?cl=248158 https://skia.org/user/api/SkTextBlobBuilder_Reference?cl=248158 https://skia.org/user/api/SkTextBlob_Reference?cl=248158 No-Try: true Change-Id: I29ff57f3c1dd9f27f67be5511c942e7108908642 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/248158 Auto-Submit: Hal Canary <halcanary@google.com> Commit-Queue: Ben Wagner aka dogben <benjaminwagner@google.com> Reviewed-by: Ben Wagner aka dogben <benjaminwagner@google.com>
2019-10-11 15:46:30 +00:00
<div><fiddle-embed name="@IPoint_Make">
#### Example Output
~~~~
pt1 == pt2
~~~~
</fiddle-embed></div>
### See Also
<a href='#SkIPoint_set'>set()</a> <a href='SkPoint_Reference#SkPoint'>SkPoint</a>::<a href='#SkPoint_iset'>iset()</a> <a href='SkPoint_Reference#SkPoint'>SkPoint</a>::<a href='#SkPoint_Make'>Make</a>
<a name='Property'></a>
<a name='SkIPoint_x'></a>
---
<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
int32_t <a href='#SkIPoint_x'>x()</a>const
</pre>
Returns x-axis value of <a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a>.
### Return Value
<a href='#SkIPoint_fX'>fX</a>
### Example
Docs: Update docs to point at named fiddles for x in docs/examples/* ; do if grep -q '// Disabled' $x; then continue fi HASH=$(sed -n 's#^// HASH=\(.*\)$#\1#p' $x) NAME=$(sed -n 's#^REG_FIDDLE(\([^,]*\),.*$#\1#p' $x) FILES="$(grep -l $HASH site/user/api/*.md)" if [ "$FILES" ] ; then echo $HASH $NAME $FILES; sed -i "s/$HASH/@$NAME/g" $FILES fi done https://skia.org/user/api/SkAutoCanvasRestore_Reference?cl=248158 https://skia.org/user/api/SkBitmap_Reference?cl=248158 https://skia.org/user/api/SkBlendMode_Reference?cl=248158 https://skia.org/user/api/SkCanvas_Reference?cl=248158 https://skia.org/user/api/SkColor4f_Reference?cl=248158 https://skia.org/user/api/SkColor_Reference?cl=248158 https://skia.org/user/api/SkFont_Reference?cl=248158 https://skia.org/user/api/SkIPoint_Reference?cl=248158 https://skia.org/user/api/SkIRect_Reference?cl=248158 https://skia.org/user/api/SkImageInfo_Reference?cl=248158 https://skia.org/user/api/SkImage_Reference?cl=248158 https://skia.org/user/api/SkMatrix_Reference?cl=248158 https://skia.org/user/api/SkPaint_Reference?cl=248158 https://skia.org/user/api/SkPath_Reference?cl=248158 https://skia.org/user/api/SkPicture_Reference?cl=248158 https://skia.org/user/api/SkPixmap_Reference?cl=248158 https://skia.org/user/api/SkPoint_Reference?cl=248158 https://skia.org/user/api/SkRRect_Reference?cl=248158 https://skia.org/user/api/SkRect_Reference?cl=248158 https://skia.org/user/api/SkRegion_Reference?cl=248158 https://skia.org/user/api/SkSurface_Reference?cl=248158 https://skia.org/user/api/SkTextBlobBuilder_Reference?cl=248158 https://skia.org/user/api/SkTextBlob_Reference?cl=248158 No-Try: true Change-Id: I29ff57f3c1dd9f27f67be5511c942e7108908642 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/248158 Auto-Submit: Hal Canary <halcanary@google.com> Commit-Queue: Ben Wagner aka dogben <benjaminwagner@google.com> Reviewed-by: Ben Wagner aka dogben <benjaminwagner@google.com>
2019-10-11 15:46:30 +00:00
<div><fiddle-embed name="@IPoint_x">
#### Example Output
~~~~
pt1.fX == pt1.x()
~~~~
</fiddle-embed></div>
### See Also
<a href='#SkIPoint_y'>y()</a> <a href='SkPoint_Reference#SkPoint'>SkPoint</a>::<a href='#SkPoint_x'>x()</a>
<a name='SkIPoint_y'></a>
---
<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
int32_t <a href='#SkIPoint_y'>y()</a>const
</pre>
Returns y-axis value of <a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a>.
### Return Value
<a href='#SkIPoint_fY'>fY</a>
### Example
Docs: Update docs to point at named fiddles for x in docs/examples/* ; do if grep -q '// Disabled' $x; then continue fi HASH=$(sed -n 's#^// HASH=\(.*\)$#\1#p' $x) NAME=$(sed -n 's#^REG_FIDDLE(\([^,]*\),.*$#\1#p' $x) FILES="$(grep -l $HASH site/user/api/*.md)" if [ "$FILES" ] ; then echo $HASH $NAME $FILES; sed -i "s/$HASH/@$NAME/g" $FILES fi done https://skia.org/user/api/SkAutoCanvasRestore_Reference?cl=248158 https://skia.org/user/api/SkBitmap_Reference?cl=248158 https://skia.org/user/api/SkBlendMode_Reference?cl=248158 https://skia.org/user/api/SkCanvas_Reference?cl=248158 https://skia.org/user/api/SkColor4f_Reference?cl=248158 https://skia.org/user/api/SkColor_Reference?cl=248158 https://skia.org/user/api/SkFont_Reference?cl=248158 https://skia.org/user/api/SkIPoint_Reference?cl=248158 https://skia.org/user/api/SkIRect_Reference?cl=248158 https://skia.org/user/api/SkImageInfo_Reference?cl=248158 https://skia.org/user/api/SkImage_Reference?cl=248158 https://skia.org/user/api/SkMatrix_Reference?cl=248158 https://skia.org/user/api/SkPaint_Reference?cl=248158 https://skia.org/user/api/SkPath_Reference?cl=248158 https://skia.org/user/api/SkPicture_Reference?cl=248158 https://skia.org/user/api/SkPixmap_Reference?cl=248158 https://skia.org/user/api/SkPoint_Reference?cl=248158 https://skia.org/user/api/SkRRect_Reference?cl=248158 https://skia.org/user/api/SkRect_Reference?cl=248158 https://skia.org/user/api/SkRegion_Reference?cl=248158 https://skia.org/user/api/SkSurface_Reference?cl=248158 https://skia.org/user/api/SkTextBlobBuilder_Reference?cl=248158 https://skia.org/user/api/SkTextBlob_Reference?cl=248158 No-Try: true Change-Id: I29ff57f3c1dd9f27f67be5511c942e7108908642 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/248158 Auto-Submit: Hal Canary <halcanary@google.com> Commit-Queue: Ben Wagner aka dogben <benjaminwagner@google.com> Reviewed-by: Ben Wagner aka dogben <benjaminwagner@google.com>
2019-10-11 15:46:30 +00:00
<div><fiddle-embed name="@IPoint_y">
#### Example Output
~~~~
pt1.fY == pt1.y()
~~~~
</fiddle-embed></div>
### See Also
<a href='#SkIPoint_x'>x()</a> <a href='SkPoint_Reference#SkPoint'>SkPoint</a>::<a href='#SkPoint_y'>y()</a>
<a name='SkIPoint_isZero'></a>
---
<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
bool <a href='#SkIPoint_isZero'>isZero</a>()const
</pre>
Returns true if <a href='#SkIPoint_fX'>fX</a> and <a href='#SkIPoint_fY'>fY</a> are both zero.
### Return Value
true if <a href='#SkIPoint_fX'>fX</a> is zero and <a href='#SkIPoint_fY'>fY</a> is zero
### Example
Docs: Update docs to point at named fiddles for x in docs/examples/* ; do if grep -q '// Disabled' $x; then continue fi HASH=$(sed -n 's#^// HASH=\(.*\)$#\1#p' $x) NAME=$(sed -n 's#^REG_FIDDLE(\([^,]*\),.*$#\1#p' $x) FILES="$(grep -l $HASH site/user/api/*.md)" if [ "$FILES" ] ; then echo $HASH $NAME $FILES; sed -i "s/$HASH/@$NAME/g" $FILES fi done https://skia.org/user/api/SkAutoCanvasRestore_Reference?cl=248158 https://skia.org/user/api/SkBitmap_Reference?cl=248158 https://skia.org/user/api/SkBlendMode_Reference?cl=248158 https://skia.org/user/api/SkCanvas_Reference?cl=248158 https://skia.org/user/api/SkColor4f_Reference?cl=248158 https://skia.org/user/api/SkColor_Reference?cl=248158 https://skia.org/user/api/SkFont_Reference?cl=248158 https://skia.org/user/api/SkIPoint_Reference?cl=248158 https://skia.org/user/api/SkIRect_Reference?cl=248158 https://skia.org/user/api/SkImageInfo_Reference?cl=248158 https://skia.org/user/api/SkImage_Reference?cl=248158 https://skia.org/user/api/SkMatrix_Reference?cl=248158 https://skia.org/user/api/SkPaint_Reference?cl=248158 https://skia.org/user/api/SkPath_Reference?cl=248158 https://skia.org/user/api/SkPicture_Reference?cl=248158 https://skia.org/user/api/SkPixmap_Reference?cl=248158 https://skia.org/user/api/SkPoint_Reference?cl=248158 https://skia.org/user/api/SkRRect_Reference?cl=248158 https://skia.org/user/api/SkRect_Reference?cl=248158 https://skia.org/user/api/SkRegion_Reference?cl=248158 https://skia.org/user/api/SkSurface_Reference?cl=248158 https://skia.org/user/api/SkTextBlobBuilder_Reference?cl=248158 https://skia.org/user/api/SkTextBlob_Reference?cl=248158 No-Try: true Change-Id: I29ff57f3c1dd9f27f67be5511c942e7108908642 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/248158 Auto-Submit: Hal Canary <halcanary@google.com> Commit-Queue: Ben Wagner aka dogben <benjaminwagner@google.com> Reviewed-by: Ben Wagner aka dogben <benjaminwagner@google.com>
2019-10-11 15:46:30 +00:00
<div><fiddle-embed name="@IPoint_isZero">
#### Example Output
~~~~
pt.isZero() == true
~~~~
</fiddle-embed></div>
### See Also
<a href='SkPoint_Reference#SkPoint'>SkPoint</a>::<a href='#SkPoint_isZero'>isZero</a>
<a name='Set'></a>
<a name='SkIPoint_set'></a>
---
<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
void set(int32_t x, int32_t y)
</pre>
Sets <a href='#SkIPoint_fX'>fX</a> to <a href='#SkIPoint_set_x'>x</a> and <a href='#SkIPoint_fY'>fY</a> to <a href='#SkIPoint_set_y'>y</a>.
### Parameters
<table> <tr> <td><a name='SkIPoint_set_x'><code><strong>x</strong></code></a></td>
<td>new value for <a href='#SkIPoint_fX'>fX</a></td>
</tr>
<tr> <td><a name='SkIPoint_set_y'><code><strong>y</strong></code></a></td>
<td>new value for <a href='#SkIPoint_fY'>fY</a></td>
</tr>
</table>
### Example
Docs: Update docs to point at named fiddles for x in docs/examples/* ; do if grep -q '// Disabled' $x; then continue fi HASH=$(sed -n 's#^// HASH=\(.*\)$#\1#p' $x) NAME=$(sed -n 's#^REG_FIDDLE(\([^,]*\),.*$#\1#p' $x) FILES="$(grep -l $HASH site/user/api/*.md)" if [ "$FILES" ] ; then echo $HASH $NAME $FILES; sed -i "s/$HASH/@$NAME/g" $FILES fi done https://skia.org/user/api/SkAutoCanvasRestore_Reference?cl=248158 https://skia.org/user/api/SkBitmap_Reference?cl=248158 https://skia.org/user/api/SkBlendMode_Reference?cl=248158 https://skia.org/user/api/SkCanvas_Reference?cl=248158 https://skia.org/user/api/SkColor4f_Reference?cl=248158 https://skia.org/user/api/SkColor_Reference?cl=248158 https://skia.org/user/api/SkFont_Reference?cl=248158 https://skia.org/user/api/SkIPoint_Reference?cl=248158 https://skia.org/user/api/SkIRect_Reference?cl=248158 https://skia.org/user/api/SkImageInfo_Reference?cl=248158 https://skia.org/user/api/SkImage_Reference?cl=248158 https://skia.org/user/api/SkMatrix_Reference?cl=248158 https://skia.org/user/api/SkPaint_Reference?cl=248158 https://skia.org/user/api/SkPath_Reference?cl=248158 https://skia.org/user/api/SkPicture_Reference?cl=248158 https://skia.org/user/api/SkPixmap_Reference?cl=248158 https://skia.org/user/api/SkPoint_Reference?cl=248158 https://skia.org/user/api/SkRRect_Reference?cl=248158 https://skia.org/user/api/SkRect_Reference?cl=248158 https://skia.org/user/api/SkRegion_Reference?cl=248158 https://skia.org/user/api/SkSurface_Reference?cl=248158 https://skia.org/user/api/SkTextBlobBuilder_Reference?cl=248158 https://skia.org/user/api/SkTextBlob_Reference?cl=248158 No-Try: true Change-Id: I29ff57f3c1dd9f27f67be5511c942e7108908642 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/248158 Auto-Submit: Hal Canary <halcanary@google.com> Commit-Queue: Ben Wagner aka dogben <benjaminwagner@google.com> Reviewed-by: Ben Wagner aka dogben <benjaminwagner@google.com>
2019-10-11 15:46:30 +00:00
<div><fiddle-embed name="@IPoint_set">
#### Example Output
~~~~
pt1 == pt2
~~~~
</fiddle-embed></div>
### See Also
<a href='#SkIPoint_Make'>Make</a>
<a name='SkIPoint_minus_operator'></a>
---
<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
<a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a> operator-()const
</pre>
Returns <a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a> changing the signs of <a href='#SkIPoint_fX'>fX</a> and <a href='#SkIPoint_fY'>fY</a>.
### Return Value
<a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a> as (-<a href='#SkIPoint_fX'>fX</a>, -<a href='#SkIPoint_fY'>fY</a>)
### Example
Docs: Update docs to point at named fiddles for x in docs/examples/* ; do if grep -q '// Disabled' $x; then continue fi HASH=$(sed -n 's#^// HASH=\(.*\)$#\1#p' $x) NAME=$(sed -n 's#^REG_FIDDLE(\([^,]*\),.*$#\1#p' $x) FILES="$(grep -l $HASH site/user/api/*.md)" if [ "$FILES" ] ; then echo $HASH $NAME $FILES; sed -i "s/$HASH/@$NAME/g" $FILES fi done https://skia.org/user/api/SkAutoCanvasRestore_Reference?cl=248158 https://skia.org/user/api/SkBitmap_Reference?cl=248158 https://skia.org/user/api/SkBlendMode_Reference?cl=248158 https://skia.org/user/api/SkCanvas_Reference?cl=248158 https://skia.org/user/api/SkColor4f_Reference?cl=248158 https://skia.org/user/api/SkColor_Reference?cl=248158 https://skia.org/user/api/SkFont_Reference?cl=248158 https://skia.org/user/api/SkIPoint_Reference?cl=248158 https://skia.org/user/api/SkIRect_Reference?cl=248158 https://skia.org/user/api/SkImageInfo_Reference?cl=248158 https://skia.org/user/api/SkImage_Reference?cl=248158 https://skia.org/user/api/SkMatrix_Reference?cl=248158 https://skia.org/user/api/SkPaint_Reference?cl=248158 https://skia.org/user/api/SkPath_Reference?cl=248158 https://skia.org/user/api/SkPicture_Reference?cl=248158 https://skia.org/user/api/SkPixmap_Reference?cl=248158 https://skia.org/user/api/SkPoint_Reference?cl=248158 https://skia.org/user/api/SkRRect_Reference?cl=248158 https://skia.org/user/api/SkRect_Reference?cl=248158 https://skia.org/user/api/SkRegion_Reference?cl=248158 https://skia.org/user/api/SkSurface_Reference?cl=248158 https://skia.org/user/api/SkTextBlobBuilder_Reference?cl=248158 https://skia.org/user/api/SkTextBlob_Reference?cl=248158 No-Try: true Change-Id: I29ff57f3c1dd9f27f67be5511c942e7108908642 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/248158 Auto-Submit: Hal Canary <halcanary@google.com> Commit-Queue: Ben Wagner aka dogben <benjaminwagner@google.com> Reviewed-by: Ben Wagner aka dogben <benjaminwagner@google.com>
2019-10-11 15:46:30 +00:00
<div><fiddle-embed name="@IPoint_minus_operator">
#### Example Output
~~~~
pt: 0, 0 negate: 0, 0
pt: -1, -2 negate: 1, 2
pt: 2147483647, -2147483647 negate: -2147483647, 2147483647
pt: -2147483648, -2147483648 negate: -2147483648, -2147483648
~~~~
</fiddle-embed></div>
### See Also
<a href='#SkIPoint_subtract_operator'>operator-</a>(const <a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a>& a, const <a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a>& b) <a href='#SkIPoint_subtractfrom_operator'>operator-=</a>(const <a href='SkIPoint_Reference#SkIVector'>SkIVector</a>& v) <a href='SkPoint_Reference#SkPoint'>SkPoint</a>::operator-() const
<a name='SkIPoint_addto_operator'></a>
---
<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
void <a href='#SkIPoint_addto_operator'>operator+=</a>(const <a href='SkIPoint_Reference#SkIVector'>SkIVector</a>& v)
</pre>
Offsets <a href='SkIPoint_Reference#IPoint'>IPoint</a> by <a href='#IPoint_IVector'>IVector</a> <a href='#SkIPoint_addto_operator_v'>v</a>. Sets <a href='SkIPoint_Reference#IPoint'>IPoint</a> to <code>(<a href='#SkIPoint_fX'>fX</a> + <a href='#SkIPoint_addto_operator_v'>v</a>.<a href='#SkIPoint_fX'>fX</a>, <a href='#SkIPoint_fY'>fY</a> + <a href='#SkIPoint_addto_operator_v'>v</a>.<a href='#SkIPoint_fY'>fY</a>)</code>.
### Parameters
<table> <tr> <td><a name='SkIPoint_addto_operator_v'><code><strong>v</strong></code></a></td>
<td><a href='#IPoint_IVector'>IVector</a> to add</td>
</tr>
</table>
### Example
Docs: Update docs to point at named fiddles for x in docs/examples/* ; do if grep -q '// Disabled' $x; then continue fi HASH=$(sed -n 's#^// HASH=\(.*\)$#\1#p' $x) NAME=$(sed -n 's#^REG_FIDDLE(\([^,]*\),.*$#\1#p' $x) FILES="$(grep -l $HASH site/user/api/*.md)" if [ "$FILES" ] ; then echo $HASH $NAME $FILES; sed -i "s/$HASH/@$NAME/g" $FILES fi done https://skia.org/user/api/SkAutoCanvasRestore_Reference?cl=248158 https://skia.org/user/api/SkBitmap_Reference?cl=248158 https://skia.org/user/api/SkBlendMode_Reference?cl=248158 https://skia.org/user/api/SkCanvas_Reference?cl=248158 https://skia.org/user/api/SkColor4f_Reference?cl=248158 https://skia.org/user/api/SkColor_Reference?cl=248158 https://skia.org/user/api/SkFont_Reference?cl=248158 https://skia.org/user/api/SkIPoint_Reference?cl=248158 https://skia.org/user/api/SkIRect_Reference?cl=248158 https://skia.org/user/api/SkImageInfo_Reference?cl=248158 https://skia.org/user/api/SkImage_Reference?cl=248158 https://skia.org/user/api/SkMatrix_Reference?cl=248158 https://skia.org/user/api/SkPaint_Reference?cl=248158 https://skia.org/user/api/SkPath_Reference?cl=248158 https://skia.org/user/api/SkPicture_Reference?cl=248158 https://skia.org/user/api/SkPixmap_Reference?cl=248158 https://skia.org/user/api/SkPoint_Reference?cl=248158 https://skia.org/user/api/SkRRect_Reference?cl=248158 https://skia.org/user/api/SkRect_Reference?cl=248158 https://skia.org/user/api/SkRegion_Reference?cl=248158 https://skia.org/user/api/SkSurface_Reference?cl=248158 https://skia.org/user/api/SkTextBlobBuilder_Reference?cl=248158 https://skia.org/user/api/SkTextBlob_Reference?cl=248158 No-Try: true Change-Id: I29ff57f3c1dd9f27f67be5511c942e7108908642 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/248158 Auto-Submit: Hal Canary <halcanary@google.com> Commit-Queue: Ben Wagner aka dogben <benjaminwagner@google.com> Reviewed-by: Ben Wagner aka dogben <benjaminwagner@google.com>
2019-10-11 15:46:30 +00:00
<div><fiddle-embed name="@IPoint_addto_operator"></fiddle-embed></div>
### See Also
<a href='#SkIPoint_add_operator'>operator+</a>(const <a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a>& a, const <a href='SkIPoint_Reference#SkIVector'>SkIVector</a>& b) <a href='SkPoint_Reference#SkPoint'>SkPoint</a>::operator+=(const <a href='SkPoint_Reference#SkVector'>SkVector</a>& <a href='#SkIPoint_addto_operator_v'>v</a>)
<a name='SkIPoint_subtractfrom_operator'></a>
---
<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
void <a href='#SkIPoint_subtractfrom_operator'>operator-=</a>(const <a href='SkIPoint_Reference#SkIVector'>SkIVector</a>& v)
</pre>
Subtracts <a href='#IPoint_IVector'>IVector</a> <a href='#SkIPoint_subtractfrom_operator_v'>v</a> from <a href='SkIPoint_Reference#IPoint'>IPoint</a>. Sets <a href='SkIPoint_Reference#IPoint'>IPoint</a> to: <code>(<a href='#SkIPoint_fX'>fX</a> - <a href='#SkIPoint_subtractfrom_operator_v'>v</a>.<a href='#SkIPoint_fX'>fX</a>, <a href='#SkIPoint_fY'>fY</a> - <a href='#SkIPoint_subtractfrom_operator_v'>v</a>.<a href='#SkIPoint_fY'>fY</a>)</code>.
### Parameters
<table> <tr> <td><a name='SkIPoint_subtractfrom_operator_v'><code><strong>v</strong></code></a></td>
<td><a href='#IPoint_IVector'>IVector</a> to subtract</td>
</tr>
</table>
### Example
Docs: Update docs to point at named fiddles for x in docs/examples/* ; do if grep -q '// Disabled' $x; then continue fi HASH=$(sed -n 's#^// HASH=\(.*\)$#\1#p' $x) NAME=$(sed -n 's#^REG_FIDDLE(\([^,]*\),.*$#\1#p' $x) FILES="$(grep -l $HASH site/user/api/*.md)" if [ "$FILES" ] ; then echo $HASH $NAME $FILES; sed -i "s/$HASH/@$NAME/g" $FILES fi done https://skia.org/user/api/SkAutoCanvasRestore_Reference?cl=248158 https://skia.org/user/api/SkBitmap_Reference?cl=248158 https://skia.org/user/api/SkBlendMode_Reference?cl=248158 https://skia.org/user/api/SkCanvas_Reference?cl=248158 https://skia.org/user/api/SkColor4f_Reference?cl=248158 https://skia.org/user/api/SkColor_Reference?cl=248158 https://skia.org/user/api/SkFont_Reference?cl=248158 https://skia.org/user/api/SkIPoint_Reference?cl=248158 https://skia.org/user/api/SkIRect_Reference?cl=248158 https://skia.org/user/api/SkImageInfo_Reference?cl=248158 https://skia.org/user/api/SkImage_Reference?cl=248158 https://skia.org/user/api/SkMatrix_Reference?cl=248158 https://skia.org/user/api/SkPaint_Reference?cl=248158 https://skia.org/user/api/SkPath_Reference?cl=248158 https://skia.org/user/api/SkPicture_Reference?cl=248158 https://skia.org/user/api/SkPixmap_Reference?cl=248158 https://skia.org/user/api/SkPoint_Reference?cl=248158 https://skia.org/user/api/SkRRect_Reference?cl=248158 https://skia.org/user/api/SkRect_Reference?cl=248158 https://skia.org/user/api/SkRegion_Reference?cl=248158 https://skia.org/user/api/SkSurface_Reference?cl=248158 https://skia.org/user/api/SkTextBlobBuilder_Reference?cl=248158 https://skia.org/user/api/SkTextBlob_Reference?cl=248158 No-Try: true Change-Id: I29ff57f3c1dd9f27f67be5511c942e7108908642 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/248158 Auto-Submit: Hal Canary <halcanary@google.com> Commit-Queue: Ben Wagner aka dogben <benjaminwagner@google.com> Reviewed-by: Ben Wagner aka dogben <benjaminwagner@google.com>
2019-10-11 15:46:30 +00:00
<div><fiddle-embed name="@IPoint_subtractfrom_operator"></fiddle-embed></div>
### See Also
<a href='#SkIPoint_subtract_operator'>operator-</a>(const <a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a>& a, const <a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a>& b) <a href='SkPoint_Reference#SkPoint'>SkPoint</a>::operator-=(const <a href='SkPoint_Reference#SkVector'>SkVector</a>& <a href='#SkIPoint_subtractfrom_operator_v'>v</a>)
<a name='SkIPoint_equals'></a>
---
<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
bool equals(int32_t x, int32_t y)const
</pre>
Returns true if <a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a> is equivalent to <a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a> constructed from (<a href='#SkIPoint_equals_x'>x</a>, <a href='#SkIPoint_equals_y'>y</a>).
### Parameters
<table> <tr> <td><a name='SkIPoint_equals_x'><code><strong>x</strong></code></a></td>
<td>value compared with <a href='#SkIPoint_fX'>fX</a></td>
</tr>
<tr> <td><a name='SkIPoint_equals_y'><code><strong>y</strong></code></a></td>
<td>value compared with <a href='#SkIPoint_fY'>fY</a></td>
</tr>
</table>
### Return Value
true if <a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a> equals (<a href='#SkIPoint_equals_x'>x</a>, <a href='#SkIPoint_equals_y'>y</a>)
### Example
Docs: Update docs to point at named fiddles for x in docs/examples/* ; do if grep -q '// Disabled' $x; then continue fi HASH=$(sed -n 's#^// HASH=\(.*\)$#\1#p' $x) NAME=$(sed -n 's#^REG_FIDDLE(\([^,]*\),.*$#\1#p' $x) FILES="$(grep -l $HASH site/user/api/*.md)" if [ "$FILES" ] ; then echo $HASH $NAME $FILES; sed -i "s/$HASH/@$NAME/g" $FILES fi done https://skia.org/user/api/SkAutoCanvasRestore_Reference?cl=248158 https://skia.org/user/api/SkBitmap_Reference?cl=248158 https://skia.org/user/api/SkBlendMode_Reference?cl=248158 https://skia.org/user/api/SkCanvas_Reference?cl=248158 https://skia.org/user/api/SkColor4f_Reference?cl=248158 https://skia.org/user/api/SkColor_Reference?cl=248158 https://skia.org/user/api/SkFont_Reference?cl=248158 https://skia.org/user/api/SkIPoint_Reference?cl=248158 https://skia.org/user/api/SkIRect_Reference?cl=248158 https://skia.org/user/api/SkImageInfo_Reference?cl=248158 https://skia.org/user/api/SkImage_Reference?cl=248158 https://skia.org/user/api/SkMatrix_Reference?cl=248158 https://skia.org/user/api/SkPaint_Reference?cl=248158 https://skia.org/user/api/SkPath_Reference?cl=248158 https://skia.org/user/api/SkPicture_Reference?cl=248158 https://skia.org/user/api/SkPixmap_Reference?cl=248158 https://skia.org/user/api/SkPoint_Reference?cl=248158 https://skia.org/user/api/SkRRect_Reference?cl=248158 https://skia.org/user/api/SkRect_Reference?cl=248158 https://skia.org/user/api/SkRegion_Reference?cl=248158 https://skia.org/user/api/SkSurface_Reference?cl=248158 https://skia.org/user/api/SkTextBlobBuilder_Reference?cl=248158 https://skia.org/user/api/SkTextBlob_Reference?cl=248158 No-Try: true Change-Id: I29ff57f3c1dd9f27f67be5511c942e7108908642 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/248158 Auto-Submit: Hal Canary <halcanary@google.com> Commit-Queue: Ben Wagner aka dogben <benjaminwagner@google.com> Reviewed-by: Ben Wagner aka dogben <benjaminwagner@google.com>
2019-10-11 15:46:30 +00:00
<div><fiddle-embed name="@IPoint_equals">
#### Example Output
~~~~
pt: 0, 0 == pt
pt: -1, -2 == pt
pt: 2147483647, -1 == pt
pt: -2147483648, -1 == pt
~~~~
</fiddle-embed></div>
### See Also
<a href='#SkIPoint_equal_operator'>operator==</a>(const <a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a>& a, const <a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a>& b)
<a name='SkIPoint_equal_operator'></a>
---
<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
bool <a href='#SkIPoint_equal_operator'>operator==</a>(const <a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a>& a, const <a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a>& b)
</pre>
Returns true if <a href='#SkIPoint_equal_operator_a'>a</a> is equivalent to <a href='#SkIPoint_equal_operator_b'>b</a>.
### Parameters
<table> <tr> <td><a name='SkIPoint_equal_operator_a'><code><strong>a</strong></code></a></td>
<td><a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a> to compare</td>
</tr>
<tr> <td><a name='SkIPoint_equal_operator_b'><code><strong>b</strong></code></a></td>
<td><a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a> to compare</td>
</tr>
</table>
### Return Value
true if <a href='#SkIPoint_equal_operator_a'>a</a>.<a href='#SkIPoint_fX'>fX</a> == <a href='#SkIPoint_equal_operator_b'>b</a>.<a href='#SkIPoint_fX'>fX</a> and <a href='#SkIPoint_equal_operator_a'>a</a>.<a href='#SkIPoint_fY'>fY</a> == <a href='#SkIPoint_equal_operator_b'>b</a>.<a href='#SkIPoint_fY'>fY</a>
### Example
Docs: Update docs to point at named fiddles for x in docs/examples/* ; do if grep -q '// Disabled' $x; then continue fi HASH=$(sed -n 's#^// HASH=\(.*\)$#\1#p' $x) NAME=$(sed -n 's#^REG_FIDDLE(\([^,]*\),.*$#\1#p' $x) FILES="$(grep -l $HASH site/user/api/*.md)" if [ "$FILES" ] ; then echo $HASH $NAME $FILES; sed -i "s/$HASH/@$NAME/g" $FILES fi done https://skia.org/user/api/SkAutoCanvasRestore_Reference?cl=248158 https://skia.org/user/api/SkBitmap_Reference?cl=248158 https://skia.org/user/api/SkBlendMode_Reference?cl=248158 https://skia.org/user/api/SkCanvas_Reference?cl=248158 https://skia.org/user/api/SkColor4f_Reference?cl=248158 https://skia.org/user/api/SkColor_Reference?cl=248158 https://skia.org/user/api/SkFont_Reference?cl=248158 https://skia.org/user/api/SkIPoint_Reference?cl=248158 https://skia.org/user/api/SkIRect_Reference?cl=248158 https://skia.org/user/api/SkImageInfo_Reference?cl=248158 https://skia.org/user/api/SkImage_Reference?cl=248158 https://skia.org/user/api/SkMatrix_Reference?cl=248158 https://skia.org/user/api/SkPaint_Reference?cl=248158 https://skia.org/user/api/SkPath_Reference?cl=248158 https://skia.org/user/api/SkPicture_Reference?cl=248158 https://skia.org/user/api/SkPixmap_Reference?cl=248158 https://skia.org/user/api/SkPoint_Reference?cl=248158 https://skia.org/user/api/SkRRect_Reference?cl=248158 https://skia.org/user/api/SkRect_Reference?cl=248158 https://skia.org/user/api/SkRegion_Reference?cl=248158 https://skia.org/user/api/SkSurface_Reference?cl=248158 https://skia.org/user/api/SkTextBlobBuilder_Reference?cl=248158 https://skia.org/user/api/SkTextBlob_Reference?cl=248158 No-Try: true Change-Id: I29ff57f3c1dd9f27f67be5511c942e7108908642 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/248158 Auto-Submit: Hal Canary <halcanary@google.com> Commit-Queue: Ben Wagner aka dogben <benjaminwagner@google.com> Reviewed-by: Ben Wagner aka dogben <benjaminwagner@google.com>
2019-10-11 15:46:30 +00:00
<div><fiddle-embed name="@IPoint_equal_operator">
#### Example Output
~~~~
pt: 0, 0 == pt
pt: -1, -2 == pt
pt: 2147483647, -1 == pt
pt: -2147483648, -1 == pt
~~~~
</fiddle-embed></div>
### See Also
<a href='#SkIPoint_equals'>equals()</a> <a href='#SkIPoint_notequal_operator'>operator!=</a>(const <a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a>& <a href='#SkIPoint_equal_operator_a'>a</a>, const <a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a>& <a href='#SkIPoint_equal_operator_b'>b</a>)
<a name='SkIPoint_notequal_operator'></a>
---
<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
bool <a href='#SkIPoint_notequal_operator'>operator!=</a>(const <a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a>& a, const <a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a>& b)
</pre>
Returns true if <a href='#SkIPoint_notequal_operator_a'>a</a> is not equivalent to <a href='#SkIPoint_notequal_operator_b'>b</a>.
### Parameters
<table> <tr> <td><a name='SkIPoint_notequal_operator_a'><code><strong>a</strong></code></a></td>
<td><a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a> to compare</td>
</tr>
<tr> <td><a name='SkIPoint_notequal_operator_b'><code><strong>b</strong></code></a></td>
<td><a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a> to compare</td>
</tr>
</table>
### Return Value
true if <a href='#SkIPoint_notequal_operator_a'>a</a>.<a href='#SkIPoint_fX'>fX</a> != <a href='#SkIPoint_notequal_operator_b'>b</a>.<a href='#SkIPoint_fX'>fX</a> or <a href='#SkIPoint_notequal_operator_a'>a</a>.<a href='#SkIPoint_fY'>fY</a> != <a href='#SkIPoint_notequal_operator_b'>b</a>.<a href='#SkIPoint_fY'>fY</a>
### Example
Docs: Update docs to point at named fiddles for x in docs/examples/* ; do if grep -q '// Disabled' $x; then continue fi HASH=$(sed -n 's#^// HASH=\(.*\)$#\1#p' $x) NAME=$(sed -n 's#^REG_FIDDLE(\([^,]*\),.*$#\1#p' $x) FILES="$(grep -l $HASH site/user/api/*.md)" if [ "$FILES" ] ; then echo $HASH $NAME $FILES; sed -i "s/$HASH/@$NAME/g" $FILES fi done https://skia.org/user/api/SkAutoCanvasRestore_Reference?cl=248158 https://skia.org/user/api/SkBitmap_Reference?cl=248158 https://skia.org/user/api/SkBlendMode_Reference?cl=248158 https://skia.org/user/api/SkCanvas_Reference?cl=248158 https://skia.org/user/api/SkColor4f_Reference?cl=248158 https://skia.org/user/api/SkColor_Reference?cl=248158 https://skia.org/user/api/SkFont_Reference?cl=248158 https://skia.org/user/api/SkIPoint_Reference?cl=248158 https://skia.org/user/api/SkIRect_Reference?cl=248158 https://skia.org/user/api/SkImageInfo_Reference?cl=248158 https://skia.org/user/api/SkImage_Reference?cl=248158 https://skia.org/user/api/SkMatrix_Reference?cl=248158 https://skia.org/user/api/SkPaint_Reference?cl=248158 https://skia.org/user/api/SkPath_Reference?cl=248158 https://skia.org/user/api/SkPicture_Reference?cl=248158 https://skia.org/user/api/SkPixmap_Reference?cl=248158 https://skia.org/user/api/SkPoint_Reference?cl=248158 https://skia.org/user/api/SkRRect_Reference?cl=248158 https://skia.org/user/api/SkRect_Reference?cl=248158 https://skia.org/user/api/SkRegion_Reference?cl=248158 https://skia.org/user/api/SkSurface_Reference?cl=248158 https://skia.org/user/api/SkTextBlobBuilder_Reference?cl=248158 https://skia.org/user/api/SkTextBlob_Reference?cl=248158 No-Try: true Change-Id: I29ff57f3c1dd9f27f67be5511c942e7108908642 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/248158 Auto-Submit: Hal Canary <halcanary@google.com> Commit-Queue: Ben Wagner aka dogben <benjaminwagner@google.com> Reviewed-by: Ben Wagner aka dogben <benjaminwagner@google.com>
2019-10-11 15:46:30 +00:00
<div><fiddle-embed name="@IPoint_notequal_operator">
#### Example Output
~~~~
pt: 0, 0 == pt
pt: -1, -2 == pt
pt: 2147483647, -1 == pt
pt: -2147483648, -1 == pt
~~~~
</fiddle-embed></div>
### See Also
<a href='#SkIPoint_equal_operator'>operator==</a>(const <a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a>& <a href='#SkIPoint_notequal_operator_a'>a</a>, const <a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a>& <a href='#SkIPoint_notequal_operator_b'>b</a>) <a href='#SkIPoint_equals'>equals()</a>
<a name='SkIPoint_subtract_operator'></a>
---
<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
<a href='SkIPoint_Reference#SkIVector'>SkIVector</a> <a href='#SkIPoint_subtract_operator'>operator-</a>(const <a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a>& a, const <a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a>& b)
</pre>
Returns <a href='#IPoint_IVector'>IVector</a> from <a href='#SkIPoint_subtract_operator_b'>b</a> to <a href='#SkIPoint_subtract_operator_a'>a</a>; computed as <code>(<a href='#SkIPoint_subtract_operator_a'>a</a>.<a href='#SkIPoint_fX'>fX</a> - <a href='#SkIPoint_subtract_operator_b'>b</a>.<a href='#SkIPoint_fX'>fX</a>, <a href='#SkIPoint_subtract_operator_a'>a</a>.<a href='#SkIPoint_fY'>fY</a> - <a href='#SkIPoint_subtract_operator_b'>b</a>.<a href='#SkIPoint_fY'>fY</a>)</code>.
Can also be used to subtract <a href='#IPoint_IVector'>IVector</a> from <a href='#IPoint_IVector'>IVector</a>, returning <a href='#IPoint_IVector'>IVector</a>.
### Parameters
<table> <tr> <td><a name='SkIPoint_subtract_operator_a'><code><strong>a</strong></code></a></td>
<td><a href='SkIPoint_Reference#IPoint'>IPoint</a> or <a href='#IPoint_IVector'>IVector</a> to subtract from</td>
</tr>
<tr> <td><a name='SkIPoint_subtract_operator_b'><code><strong>b</strong></code></a></td>
<td><a href='#IPoint_IVector'>IVector</a> to subtract</td>
</tr>
</table>
### Return Value
<a href='#IPoint_IVector'>IVector</a> from <a href='#SkIPoint_subtract_operator_b'>b</a> to <a href='#SkIPoint_subtract_operator_a'>a</a>
### Example
Docs: Update docs to point at named fiddles for x in docs/examples/* ; do if grep -q '// Disabled' $x; then continue fi HASH=$(sed -n 's#^// HASH=\(.*\)$#\1#p' $x) NAME=$(sed -n 's#^REG_FIDDLE(\([^,]*\),.*$#\1#p' $x) FILES="$(grep -l $HASH site/user/api/*.md)" if [ "$FILES" ] ; then echo $HASH $NAME $FILES; sed -i "s/$HASH/@$NAME/g" $FILES fi done https://skia.org/user/api/SkAutoCanvasRestore_Reference?cl=248158 https://skia.org/user/api/SkBitmap_Reference?cl=248158 https://skia.org/user/api/SkBlendMode_Reference?cl=248158 https://skia.org/user/api/SkCanvas_Reference?cl=248158 https://skia.org/user/api/SkColor4f_Reference?cl=248158 https://skia.org/user/api/SkColor_Reference?cl=248158 https://skia.org/user/api/SkFont_Reference?cl=248158 https://skia.org/user/api/SkIPoint_Reference?cl=248158 https://skia.org/user/api/SkIRect_Reference?cl=248158 https://skia.org/user/api/SkImageInfo_Reference?cl=248158 https://skia.org/user/api/SkImage_Reference?cl=248158 https://skia.org/user/api/SkMatrix_Reference?cl=248158 https://skia.org/user/api/SkPaint_Reference?cl=248158 https://skia.org/user/api/SkPath_Reference?cl=248158 https://skia.org/user/api/SkPicture_Reference?cl=248158 https://skia.org/user/api/SkPixmap_Reference?cl=248158 https://skia.org/user/api/SkPoint_Reference?cl=248158 https://skia.org/user/api/SkRRect_Reference?cl=248158 https://skia.org/user/api/SkRect_Reference?cl=248158 https://skia.org/user/api/SkRegion_Reference?cl=248158 https://skia.org/user/api/SkSurface_Reference?cl=248158 https://skia.org/user/api/SkTextBlobBuilder_Reference?cl=248158 https://skia.org/user/api/SkTextBlob_Reference?cl=248158 No-Try: true Change-Id: I29ff57f3c1dd9f27f67be5511c942e7108908642 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/248158 Auto-Submit: Hal Canary <halcanary@google.com> Commit-Queue: Ben Wagner aka dogben <benjaminwagner@google.com> Reviewed-by: Ben Wagner aka dogben <benjaminwagner@google.com>
2019-10-11 15:46:30 +00:00
<div><fiddle-embed name="@IPoint_subtract_operator"></fiddle-embed></div>
### See Also
<a href='#SkIPoint_subtractfrom_operator'>operator-=</a>(const <a href='SkIPoint_Reference#SkIVector'>SkIVector</a>& v)
<a name='SkIPoint_add_operator'></a>
---
<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
<a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a> <a href='#SkIPoint_add_operator'>operator+</a>(const <a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a>& a, const <a href='SkIPoint_Reference#SkIVector'>SkIVector</a>& b)
</pre>
Returns <a href='SkIPoint_Reference#IPoint'>IPoint</a> resulting from <a href='SkIPoint_Reference#IPoint'>IPoint</a> <a href='#SkIPoint_add_operator_a'>a</a> offset by <a href='#IPoint_IVector'>IVector</a> <a href='#SkIPoint_add_operator_b'>b</a>, computed as:
<code>(<a href='#SkIPoint_add_operator_a'>a</a>.<a href='#SkIPoint_fX'>fX</a> + <a href='#SkIPoint_add_operator_b'>b</a>.<a href='#SkIPoint_fX'>fX</a>, <a href='#SkIPoint_add_operator_a'>a</a>.<a href='#SkIPoint_fY'>fY</a> + <a href='#SkIPoint_add_operator_b'>b</a>.<a href='#SkIPoint_fY'>fY</a>)</code>.
Can also be used to offset <a href='SkIPoint_Reference#IPoint'>IPoint</a> <a href='#SkIPoint_add_operator_b'>b</a> by <a href='#IPoint_IVector'>IVector</a> <a href='#SkIPoint_add_operator_a'>a</a>, returning <a href='SkIPoint_Reference#IPoint'>IPoint</a>.
Can also be used to add <a href='#IPoint_IVector'>IVector</a> to <a href='#IPoint_IVector'>IVector</a>, returning <a href='#IPoint_IVector'>IVector</a>.
### Parameters
<table> <tr> <td><a name='SkIPoint_add_operator_a'><code><strong>a</strong></code></a></td>
<td><a href='SkIPoint_Reference#IPoint'>IPoint</a> or <a href='#IPoint_IVector'>IVector</a> to add to</td>
</tr>
<tr> <td><a name='SkIPoint_add_operator_b'><code><strong>b</strong></code></a></td>
<td><a href='SkIPoint_Reference#IPoint'>IPoint</a> or <a href='#IPoint_IVector'>IVector</a> to add</td>
</tr>
</table>
### Return Value
<a href='SkIPoint_Reference#IPoint'>IPoint</a> equal to <a href='#SkIPoint_add_operator_a'>a</a> offset by <a href='#SkIPoint_add_operator_b'>b</a>
### Example
Docs: Update docs to point at named fiddles for x in docs/examples/* ; do if grep -q '// Disabled' $x; then continue fi HASH=$(sed -n 's#^// HASH=\(.*\)$#\1#p' $x) NAME=$(sed -n 's#^REG_FIDDLE(\([^,]*\),.*$#\1#p' $x) FILES="$(grep -l $HASH site/user/api/*.md)" if [ "$FILES" ] ; then echo $HASH $NAME $FILES; sed -i "s/$HASH/@$NAME/g" $FILES fi done https://skia.org/user/api/SkAutoCanvasRestore_Reference?cl=248158 https://skia.org/user/api/SkBitmap_Reference?cl=248158 https://skia.org/user/api/SkBlendMode_Reference?cl=248158 https://skia.org/user/api/SkCanvas_Reference?cl=248158 https://skia.org/user/api/SkColor4f_Reference?cl=248158 https://skia.org/user/api/SkColor_Reference?cl=248158 https://skia.org/user/api/SkFont_Reference?cl=248158 https://skia.org/user/api/SkIPoint_Reference?cl=248158 https://skia.org/user/api/SkIRect_Reference?cl=248158 https://skia.org/user/api/SkImageInfo_Reference?cl=248158 https://skia.org/user/api/SkImage_Reference?cl=248158 https://skia.org/user/api/SkMatrix_Reference?cl=248158 https://skia.org/user/api/SkPaint_Reference?cl=248158 https://skia.org/user/api/SkPath_Reference?cl=248158 https://skia.org/user/api/SkPicture_Reference?cl=248158 https://skia.org/user/api/SkPixmap_Reference?cl=248158 https://skia.org/user/api/SkPoint_Reference?cl=248158 https://skia.org/user/api/SkRRect_Reference?cl=248158 https://skia.org/user/api/SkRect_Reference?cl=248158 https://skia.org/user/api/SkRegion_Reference?cl=248158 https://skia.org/user/api/SkSurface_Reference?cl=248158 https://skia.org/user/api/SkTextBlobBuilder_Reference?cl=248158 https://skia.org/user/api/SkTextBlob_Reference?cl=248158 No-Try: true Change-Id: I29ff57f3c1dd9f27f67be5511c942e7108908642 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/248158 Auto-Submit: Hal Canary <halcanary@google.com> Commit-Queue: Ben Wagner aka dogben <benjaminwagner@google.com> Reviewed-by: Ben Wagner aka dogben <benjaminwagner@google.com>
2019-10-11 15:46:30 +00:00
<div><fiddle-embed name="@IPoint_add_operator"></fiddle-embed></div>
### See Also
<a href='#SkIPoint_addto_operator'>operator+=</a>(const <a href='SkIPoint_Reference#SkIVector'>SkIVector</a>& v)
<a name='IVector'></a>
<a name='SkIVector'></a>
---
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
typedef <a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a> <a href='SkIPoint_Reference#SkIVector'>SkIVector</a>;
</pre>
<a href='SkIPoint_Reference#SkIVector'>SkIVector</a> provides an alternative name for <a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a>. <a href='SkIPoint_Reference#SkIVector'>SkIVector</a> and <a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a>
can be used interchangeably for all purposes.