blob: cae7fb38ca9514e2bc11e315b3ff14194242c179 [file] [log] [blame] [view]
Cary Clarka560c472017-11-27 10:44:06 -05001SkIPoint Reference
2===
3
Cary Clarka560c472017-11-27 10:44:06 -05004# <a name="IPoint"></a> IPoint
5
Cary Clark08895c42018-02-01 09:37:32 -05006## <a name="Overview"></a> Overview
Cary Clarka560c472017-11-27 10:44:06 -05007
Cary Clark4855f782018-02-06 09:41:53 -05008## <a name="Subtopic"></a> Subtopic
Cary Clarka560c472017-11-27 10:44:06 -05009
Cary Clark5081eed2018-01-22 07:55:48 -050010| name | description |
Cary Clark08895c42018-02-01 09:37:32 -050011| --- | --- |
Cary Clark4855f782018-02-06 09:41:53 -050012| <a href="#Constructor">Constructor</a> | functions that construct <a href="SkIPoint_Reference#SkIPoint">SkIPoint</a> |
13| <a href="#Member_Function">Member Function</a> | static functions and member methods |
14| <a href="#Member">Member</a> | member values |
15| <a href="#Operator">Operator</a> | operator overloading methods |
Cary Clark08895c42018-02-01 09:37:32 -050016
17# <a name="SkIPoint"></a> Struct SkIPoint
18<a href="#SkIPoint">SkIPoint</a> holds two 32 bit integer coordinates.
Cary Clark5081eed2018-01-22 07:55:48 -050019
Cary Clark4855f782018-02-06 09:41:53 -050020## <a name="Related_Function"></a> Related Function
Cary Clark5081eed2018-01-22 07:55:48 -050021
22| name | description |
Cary Clark08895c42018-02-01 09:37:32 -050023| --- | --- |
Cary Clarka560c472017-11-27 10:44:06 -050024
Cary Clark4855f782018-02-06 09:41:53 -050025## <a name="Member_Function"></a> Member Function
Cary Clarka560c472017-11-27 10:44:06 -050026
Cary Clark5081eed2018-01-22 07:55:48 -050027| name | description |
Cary Clark08895c42018-02-01 09:37:32 -050028| --- | --- |
Cary Clark5081eed2018-01-22 07:55:48 -050029| <a href="#SkIPoint_Make">Make</a> | constructs from integer inputs |
30| <a href="#SkIPoint_equals">equals</a> | returns true if members are equal |
31| <a href="#SkIPoint_isZero">isZero</a> | returns true if both members equal zero |
32| <a href="#SkIPoint_set">set</a> | sets to integer input |
33| <a href="#SkIPoint_x">x</a> | returns <a href="#SkIPoint_fX">fX</a> |
34| <a href="#SkIPoint_y">y</a> | returns <a href="#SkIPoint_fY">fY</a> |
Cary Clarka560c472017-11-27 10:44:06 -050035
Cary Clark4855f782018-02-06 09:41:53 -050036## <a name="Member"></a> Member
Cary Clark08895c42018-02-01 09:37:32 -050037
38| name | description |
39| --- | --- |
40| <a href="#SkIPoint_fX">fX</a> | x-axis value |
41| <a href="#SkIPoint_fY">fY</a> | y-axis value |
42
Cary Clarka560c472017-11-27 10:44:06 -050043<a name="SkIPoint_fX"> <code><strong>int32_t fX</strong></code> </a>
44
Cary Clark2dc84ad2018-01-26 12:56:22 -050045x-axis value used by <a href="#IPoint">IPoint</a>.
Cary Clarka560c472017-11-27 10:44:06 -050046
47<a name="SkIPoint_fY"> <code><strong>int32_t fY</strong></code> </a>
48
Cary Clark2dc84ad2018-01-26 12:56:22 -050049y-axis value used by <a href="#IPoint">IPoint</a>.
Cary Clarka560c472017-11-27 10:44:06 -050050
Cary Clark4855f782018-02-06 09:41:53 -050051## <a name="Constructor"></a> Constructor
52
53| name | description |
54| --- | --- |
55| <a href="#SkIPoint_Make">Make</a> | constructs from integer inputs |
56
Cary Clarka560c472017-11-27 10:44:06 -050057<a name="SkIPoint_Make"></a>
58## Make
59
60<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
61static constexpr SkIPoint Make(int32_t x, int32_t y)
62</pre>
63
Cary Clark2dc84ad2018-01-26 12:56:22 -050064Sets <a href="#SkIPoint_fX">fX</a> to x, <a href="#SkIPoint_fY">fY</a> to y.
Cary Clarka560c472017-11-27 10:44:06 -050065
66### Parameters
67
68<table> <tr> <td><a name="SkIPoint_Make_x"> <code><strong>x </strong></code> </a></td> <td>
Cary Clark2dc84ad2018-01-26 12:56:22 -050069integer x-axis value of constructed <a href="#IPoint">IPoint</a></td>
Cary Clarka560c472017-11-27 10:44:06 -050070 </tr> <tr> <td><a name="SkIPoint_Make_y"> <code><strong>y </strong></code> </a></td> <td>
Cary Clark2dc84ad2018-01-26 12:56:22 -050071integer y-axis value of constructed <a href="#IPoint">IPoint</a></td>
Cary Clarka560c472017-11-27 10:44:06 -050072 </tr>
73</table>
74
75### Return Value
76
Cary Clark2dc84ad2018-01-26 12:56:22 -050077<a href="#IPoint">IPoint</a> (x, y)
Cary Clarka560c472017-11-27 10:44:06 -050078
79### Example
80
81<div><fiddle-embed name="e5cf5159525bd3140f288a95fe641fae">
82
83#### Example Output
84
85~~~~
86pt1 == pt2
87~~~~
88
89</fiddle-embed></div>
90
91### See Also
92
Cary Clark2dc84ad2018-01-26 12:56:22 -050093<a href="#SkIPoint_set">set</a> <a href="#SkPoint_iset">SkPoint::iset()</a><sup><a href="#SkPoint_iset_2">[2]</a></sup> <a href="#SkPoint_Make">SkPoint::Make</a> <a href="#SkIPoint16_Make">SkIPoint16::Make</a>
Cary Clarka560c472017-11-27 10:44:06 -050094
95---
96
Cary Clark4855f782018-02-06 09:41:53 -050097## <a name="Property"></a> Property
98
99| name | description |
100| --- | --- |
101| <a href="#SkIPoint_isZero">isZero</a> | returns true if both members equal zero |
102| <a href="#SkIPoint_x">x</a> | returns <a href="#SkIPoint_fX">fX</a> |
103| <a href="#SkIPoint_y">y</a> | returns <a href="#SkIPoint_fY">fY</a> |
104
Cary Clarka560c472017-11-27 10:44:06 -0500105<a name="SkIPoint_x"></a>
106## x
107
108<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
109int32_t x() const
110</pre>
111
Cary Clark2dc84ad2018-01-26 12:56:22 -0500112Returns x-axis value of <a href="#IPoint">IPoint</a>.
Cary Clarka560c472017-11-27 10:44:06 -0500113
114### Return Value
115
116<a href="#SkIPoint_fX">fX</a>
117
118### Example
119
120<div><fiddle-embed name="eed4185294f8a8216fc354e6ee6b2e3a">
121
122#### Example Output
123
124~~~~
125pt1.fX == pt1.x()
126~~~~
127
128</fiddle-embed></div>
129
130### See Also
131
132<a href="#SkIPoint_y">y</a> <a href="#SkPoint_x">SkPoint::x()</a> <a href="#SkIPoint16_x">SkIPoint16::x()</a>
133
134---
135
136<a name="SkIPoint_y"></a>
137## y
138
139<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
140int32_t y() const
141</pre>
142
Cary Clark2dc84ad2018-01-26 12:56:22 -0500143Returns y-axis value of <a href="#IPoint">IPoint</a>.
Cary Clarka560c472017-11-27 10:44:06 -0500144
145### Return Value
146
147<a href="#SkIPoint_fY">fY</a>
148
149### Example
150
151<div><fiddle-embed name="35c41b8ba7cebf8c9a7a8494e610e14d">
152
153#### Example Output
154
155~~~~
156pt1.fY == pt1.y()
157~~~~
158
159</fiddle-embed></div>
160
161### See Also
162
163<a href="#SkIPoint_x">x</a> <a href="#SkPoint_y">SkPoint::y()</a> <a href="#SkIPoint16_y">SkIPoint16::y()</a>
164
165---
166
167<a name="SkIPoint_isZero"></a>
168## isZero
169
170<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
171bool isZero() const
172</pre>
173
174Returns true if <a href="#SkIPoint_fX">fX</a> and <a href="#SkIPoint_fY">fY</a> are both zero.
175
176### Return Value
177
178true if <a href="#SkIPoint_fX">fX</a> is zero and <a href="#SkIPoint_fY">fY</a> is zero
179
180### Example
181
182<div><fiddle-embed name="658c1df611b4577cc7e0bb384e95737e">
183
184#### Example Output
185
186~~~~
187pt.isZero() == true
188~~~~
189
190</fiddle-embed></div>
191
192### See Also
193
194<a href="#SkPoint_isZero">SkPoint::isZero</a>
195
196---
197
Cary Clark4855f782018-02-06 09:41:53 -0500198## <a name="Set"></a> Set
199
200| name | description |
201| --- | --- |
202| <a href="#SkIPoint_set">set</a> | sets to integer input |
203
Cary Clarka560c472017-11-27 10:44:06 -0500204<a name="SkIPoint_set"></a>
205## set
206
207<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
208void set(int32_t x, int32_t y)
209</pre>
210
Cary Clark2dc84ad2018-01-26 12:56:22 -0500211Sets <a href="#SkIPoint_fX">fX</a> to x and <a href="#SkIPoint_fY">fY</a> to y.
Cary Clarka560c472017-11-27 10:44:06 -0500212
213### Parameters
214
215<table> <tr> <td><a name="SkIPoint_set_x"> <code><strong>x </strong></code> </a></td> <td>
216new value for <a href="#SkIPoint_fX">fX</a></td>
217 </tr> <tr> <td><a name="SkIPoint_set_y"> <code><strong>y </strong></code> </a></td> <td>
218new value for <a href="#SkIPoint_fY">fY</a></td>
219 </tr>
220</table>
221
222### Example
223
224<div><fiddle-embed name="165418b5718d79d8f1682a8a0ee32ba0">
225
226#### Example Output
227
228~~~~
229pt1 == pt2
230~~~~
231
232</fiddle-embed></div>
233
234### See Also
235
236<a href="#SkIPoint_Make">Make</a> <a href="#SkIPoint16_set">SkIPoint16::set</a>
237
238---
239
Cary Clark4855f782018-02-06 09:41:53 -0500240## <a name="Operator"></a> Operator
241
242| name | description |
243| --- | --- |
244| <a href="#SkIPoint_equals">equals</a> | returns true if members are equal |
245| <a href="#SkIPoint_notequal_operator">operator!=(const SkIPoint& a, const SkIPoint& b)</a> | returns true if <a href="#IPoint">IPoints</a> are unequal |
246| <a href="#SkIPoint_add_operator">operator+(const SkIPoint& a, const SkIVector& b)</a> | returns <a href="#IPoint">IPoint</a> offset by <a href="SkIPoint_Reference#IVector">IVector</a> |
247| <a href="#SkIPoint_addto_operator">operator+=(const SkIVector& v)</a> | adds <a href="SkIPoint_Reference#IVector">IVector</a> to <a href="#IPoint">IPoint</a> |
248| <a href="#SkIPoint_minus_operator">operator-() const</a> | reverses sign of <a href="#IPoint">IPoint</a> |
249| <a href="#SkIPoint_subtract_operator">operator-(const SkIPoint& a, const SkIPoint& b)</a> | returns <a href="SkIPoint_Reference#IVector">IVector</a> between <a href="#IPoint">IPoints</a> |
250| <a href="#SkIPoint_subtractfrom_operator">operator-=(const SkIVector& v)</a> | subtracts <a href="SkIPoint_Reference#IVector">IVector</a> from <a href="#IPoint">IPoint</a> |
251| <a href="#SkIPoint_equal_operator">operator==(const SkIPoint& a, const SkIPoint& b)</a> | returns true if <a href="#IPoint">IPoints</a> are equal |
252
Cary Clarka560c472017-11-27 10:44:06 -0500253<a name="SkIPoint_minus_operator"></a>
254## operator-
255
256<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
257SkIPoint operator-() _const
258</pre>
259
260Returns <a href="#IPoint">IPoint</a> changing the signs of <a href="#SkIPoint_fX">fX</a> and <a href="#SkIPoint_fY">fY</a>.
261
262### Return Value
263
264<a href="#IPoint">IPoint</a> as (-<a href="#SkIPoint_fX">fX</a>, -<a href="#SkIPoint_fY">fY</a>)
265
266### Example
267
268<div><fiddle-embed name="d283e8876366349aedd85b65cadb3706">
269
270#### Example Output
271
272~~~~
273pt: 0, 0 negate: 0, 0
274pt: -1, -2 negate: 1, 2
275pt: 2147483647, -2147483647 negate: -2147483647, 2147483647
276pt: -2147483648, -2147483648 negate: -2147483648, -2147483648
277~~~~
278
279</fiddle-embed></div>
280
281### See Also
282
283<a href="#SkIPoint_subtract_operator">operator-(const SkIPoint& a, const SkIPoint& b)</a> <a href="#SkIPoint_subtractfrom_operator">operator-=(const SkIVector& v)</a> <a href="#SkPoint_minus_operator">SkPoint::operator-() const</a>
284
285---
286
287<a name="SkIPoint_addto_operator"></a>
288## operator+=
289
290<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
291void operator+=(const SkIVector& v)
292</pre>
293
294Offsets <a href="#IPoint">IPoint</a> by <a href="SkIPoint_Reference#IVector">IVector</a> <a href="#SkIPoint_addto_operator_v">v</a>. Sets <a href="#IPoint">IPoint</a> to(<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>).
295
296### Parameters
297
298<table> <tr> <td><a name="SkIPoint_addto_operator_v"> <code><strong>v </strong></code> </a></td> <td>
299<a href="SkIPoint_Reference#IVector">IVector</a> to add</td>
300 </tr>
301</table>
302
303### Example
304
305<div><fiddle-embed name="4eb2d95c9e9a66f05296e345bb68bd51"></fiddle-embed></div>
306
307### See Also
308
309<a href="#SkIPoint_add_operator">operator+(const SkIPoint& a, const SkIVector& b)</a> <a href="#SkPoint_addto_operator">SkPoint::operator+=(const SkVector& v)</a>
310
311---
312
313<a name="SkIPoint_subtractfrom_operator"></a>
314## operator-=
315
316<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
317void operator-=(const SkIVector& v)
318</pre>
319
320Subtracts <a href="SkIPoint_Reference#IVector">IVector</a> <a href="#SkIPoint_subtractfrom_operator_v">v</a> from <a href="#IPoint">IPoint</a>. Sets <a href="#IPoint">IPoint</a> to:
321(<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>).
322
323### Parameters
324
325<table> <tr> <td><a name="SkIPoint_subtractfrom_operator_v"> <code><strong>v </strong></code> </a></td> <td>
326<a href="SkIPoint_Reference#IVector">IVector</a> to subtract</td>
327 </tr>
328</table>
329
330### Example
331
332<div><fiddle-embed name="a01e533dc7ab34ed728dc4e7a5f1f0ee"></fiddle-embed></div>
333
334### See Also
335
336<a href="#SkIPoint_subtract_operator">operator-(const SkIPoint& a, const SkIPoint& b)</a> <a href="#SkPoint_subtractfrom_operator">SkPoint::operator-=(const SkVector& v)</a>
337
338---
339
340<a name="SkIPoint_equals"></a>
341## equals
342
343<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
344bool equals(int32_t x, int32_t y) const
345</pre>
346
Cary Clark2dc84ad2018-01-26 12:56:22 -0500347Returns true if <a href="#IPoint">IPoint</a> is equivalent to <a href="#IPoint">IPoint</a> constructed from (x, y).
Cary Clarka560c472017-11-27 10:44:06 -0500348
349### Parameters
350
351<table> <tr> <td><a name="SkIPoint_equals_x"> <code><strong>x </strong></code> </a></td> <td>
352value compared with <a href="#SkIPoint_fX">fX</a></td>
353 </tr> <tr> <td><a name="SkIPoint_equals_y"> <code><strong>y </strong></code> </a></td> <td>
354value compared with <a href="#SkIPoint_fY">fY</a></td>
355 </tr>
356</table>
357
358### Return Value
359
Cary Clark2dc84ad2018-01-26 12:56:22 -0500360true if <a href="#IPoint">IPoint</a> equals (x, y)
Cary Clarka560c472017-11-27 10:44:06 -0500361
362### Example
363
364<div><fiddle-embed name="64f575d36439d5b69aaed14ffeff1cc4">
365
366#### Example Output
367
368~~~~
369pt: 0, 0 == pt
370pt: -1, -2 == pt
371pt: 2147483647, -1 == pt
372pt: -2147483648, -1 == pt
373~~~~
374
375</fiddle-embed></div>
376
377### See Also
378
379<a href="#SkIPoint_equal_operator">operator==(const SkIPoint& a, const SkIPoint& b)</a>
380
381---
382
383<a name="SkIPoint_equal_operator"></a>
384## operator==
385
386<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
387bool operator==(const SkIPoint& a, const SkIPoint& b)
388</pre>
389
390Returns true if <a href="#SkIPoint_equal_operator_a">a</a> is equivalent to <a href="#SkIPoint_equal_operator_b">b</a>.
391
392### Parameters
393
394<table> <tr> <td><a name="SkIPoint_equal_operator_a"> <code><strong>a </strong></code> </a></td> <td>
395<a href="#IPoint">IPoint</a> to compare</td>
396 </tr> <tr> <td><a name="SkIPoint_equal_operator_b"> <code><strong>b </strong></code> </a></td> <td>
397<a href="#IPoint">IPoint</a> to compare</td>
398 </tr>
399</table>
400
401### Return Value
402
403true 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>
404
405### Example
406
407<div><fiddle-embed name="37ffe2817d720f99e6c252332ce70460">
408
409#### Example Output
410
411~~~~
412pt: 0, 0 == pt
413pt: -1, -2 == pt
414pt: 2147483647, -1 == pt
415pt: -2147483648, -1 == pt
416~~~~
417
418</fiddle-embed></div>
419
420### See Also
421
422<a href="#SkIPoint_equals">equals</a> <a href="#SkIPoint_notequal_operator">operator!=(const SkIPoint& a, const SkIPoint& b)</a>
423
424---
425
426<a name="SkIPoint_notequal_operator"></a>
427## operator!=
428
429<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
430bool operator!=(const SkIPoint& a, const SkIPoint& b)
431</pre>
432
433Returns true if <a href="#SkIPoint_notequal_operator_a">a</a> is not equivalent to <a href="#SkIPoint_notequal_operator_b">b</a>.
434
435### Parameters
436
437<table> <tr> <td><a name="SkIPoint_notequal_operator_a"> <code><strong>a </strong></code> </a></td> <td>
438<a href="#IPoint">IPoint</a> to compare</td>
439 </tr> <tr> <td><a name="SkIPoint_notequal_operator_b"> <code><strong>b </strong></code> </a></td> <td>
440<a href="#IPoint">IPoint</a> to compare</td>
441 </tr>
442</table>
443
444### Return Value
445
446true 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>
447
448### Example
449
450<div><fiddle-embed name="dd89dc48dff69b53d99530b120f204bc">
451
452#### Example Output
453
454~~~~
455pt: 0, 0 == pt
456pt: -1, -2 == pt
457pt: 2147483647, -1 == pt
458pt: -2147483648, -1 == pt
459~~~~
460
461</fiddle-embed></div>
462
463### See Also
464
465<a href="#SkIPoint_equal_operator">operator==(const SkIPoint& a, const SkIPoint& b)</a> <a href="#SkIPoint_equals">equals</a>
466
467---
468
469<a name="SkIPoint_subtract_operator"></a>
470## operator-
471
472<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
473SkIVector operator-(const SkIPoint& a, const SkIPoint& b)
474</pre>
475
476Returns <a href="SkIPoint_Reference#IVector">IVector</a> from <a href="#SkIPoint_subtract_operator_b">b</a> to <a href="#SkIPoint_subtract_operator_a">a</a>; computed as(<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>).
477
478Can also be used to subtract <a href="SkIPoint_Reference#IVector">IVector</a> from <a href="SkIPoint_Reference#IVector">IVector</a>, returning <a href="SkIPoint_Reference#IVector">IVector</a>.
479
480### Parameters
481
482<table> <tr> <td><a name="SkIPoint_subtract_operator_a"> <code><strong>a </strong></code> </a></td> <td>
483<a href="#IPoint">IPoint</a> or <a href="SkIPoint_Reference#IVector">IVector</a> to subtract from</td>
484 </tr> <tr> <td><a name="SkIPoint_subtract_operator_b"> <code><strong>b </strong></code> </a></td> <td>
485<a href="SkIPoint_Reference#IVector">IVector</a> to subtract</td>
486 </tr>
487</table>
488
489### Return Value
490
491<a href="SkIPoint_Reference#IVector">IVector</a> from <a href="#SkIPoint_subtract_operator_b">b</a> to <a href="#SkIPoint_subtract_operator_a">a</a>
492
493### Example
494
495<div><fiddle-embed name="e626e26bf557857b824aa7d03f723e0f"></fiddle-embed></div>
496
497### See Also
498
499<a href="#SkIPoint_subtractfrom_operator">operator-=(const SkIVector& v)</a>
500
501---
502
503<a name="SkIPoint_add_operator"></a>
504## operator+
505
506<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
507SkIPoint operator+(const SkIPoint& a, const SkIVector& b)
508</pre>
509
510Returns <a href="#IPoint">IPoint</a> resulting from <a href="#IPoint">IPoint</a> <a href="#SkIPoint_add_operator_a">a</a> offset by <a href="SkIPoint_Reference#IVector">IVector</a> <a href="#SkIPoint_add_operator_b">b</a>, computed as:
511(<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>).
512
513Can also be used to offset <a href="#IPoint">IPoint</a> <a href="#SkIPoint_add_operator_b">b</a> by <a href="SkIPoint_Reference#IVector">IVector</a> <a href="#SkIPoint_add_operator_a">a</a>, returning <a href="#IPoint">IPoint</a>.
514Can also be used to add <a href="SkIPoint_Reference#IVector">IVector</a> to <a href="SkIPoint_Reference#IVector">IVector</a>, returning <a href="SkIPoint_Reference#IVector">IVector</a>.
515
516### Parameters
517
518<table> <tr> <td><a name="SkIPoint_add_operator_a"> <code><strong>a </strong></code> </a></td> <td>
519<a href="#IPoint">IPoint</a> or <a href="SkIPoint_Reference#IVector">IVector</a> to add to</td>
520 </tr> <tr> <td><a name="SkIPoint_add_operator_b"> <code><strong>b </strong></code> </a></td> <td>
521<a href="#IPoint">IPoint</a> or <a href="SkIPoint_Reference#IVector">IVector</a> to add</td>
522 </tr>
523</table>
524
525### Return Value
526
527<a href="#IPoint">IPoint</a> equal to <a href="#SkIPoint_add_operator_a">a</a> offset by <a href="#SkIPoint_add_operator_b">b</a>
528
529### Example
530
531<div><fiddle-embed name="63f4cba971c6d8434595906f865b5a29"></fiddle-embed></div>
532
533### See Also
534
535<a href="#SkIPoint_addto_operator">operator+=(const SkIVector& v)</a>
536
537---
538
Cary Clark2f466242017-12-11 16:03:17 -0500539# <a name="IVector"></a> IVector