aboutsummaryrefslogtreecommitdiffhomepage
path: root/site/user/api/SkIPoint16_Reference.md
blob: 1c9f9d7a04a0d32b69abf81a22ba94c5f6547e98 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
SkIPoint16 Reference
===

# <a name="IPoint16"></a> IPoint16

# <a name="SkIPoint16"></a> Struct SkIPoint16
<a href="SkIPoint_Reference#SkIPoint">SkIPoint</a> holds two 16 bit integer coordinates

# <a name="Overview"></a> Overview

## <a name="Subtopics"></a> Subtopics

| topics | description |
| --- | ---  |

## <a name="Member_Functions"></a> Member Functions

| description | function |
| --- | ---  |
| <a href="#SkIPoint16_Make">Make</a> | Constructs from integer inputs. |
| <a href="#SkIPoint16_set">set</a> | Sets to integer input. |
| <a href="#SkIPoint16_x">x</a> | Returns <a href="#SkIPoint16_fX">fX</a>. |
| <a href="#SkIPoint16_y">y</a> | Returns <a href="#SkIPoint16_fY">fY</a>. |

<a name="SkIPoint16_fX"> <code><strong>int16_t  fX</strong></code> </a>

<a href="#SkIPoint16_x">x</a>-axis value used by <a href="#IPoint16">IPoint16</a>.

<a name="SkIPoint16_fY"> <code><strong>int16_t  fY</strong></code> </a>

<a href="#SkIPoint16_y">y</a>-axis value used by <a href="#IPoint16">IPoint16</a>.

<a name="SkIPoint16_Make"></a>
## Make

<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
static constexpr SkIPoint16 Make(int x, int y)
</pre>

Sets <a href="#SkIPoint16_fX">fX</a> to <a href="#SkIPoint16_x">x</a>, <a href="#SkIPoint16_fY">fY</a> to <a href="#SkIPoint16_y">y</a>. If <a href="undocumented#SK_DEBUG">SK DEBUG</a> is defined, asserts
if <a href="#SkIPoint16_x">x</a> or <a href="#SkIPoint16_y">y</a> does not fit in 16 bits.

### Parameters

<table>  <tr>    <td><a name="SkIPoint16_Make_x"> <code><strong>x </strong></code> </a></td> <td>
integer <a href="#SkIPoint16_x">x</a>-axis value of constructed <a href="SkIPoint_Reference#IPoint">IPoint</a></td>
  </tr>  <tr>    <td><a name="SkIPoint16_Make_y"> <code><strong>y </strong></code> </a></td> <td>
integer <a href="#SkIPoint16_y">y</a>-axis value of constructed <a href="SkIPoint_Reference#IPoint">IPoint</a></td>
  </tr>
</table>

### Return Value

<a href="#IPoint16">IPoint16</a> (<a href="#SkIPoint16_x">x</a>, <a href="#SkIPoint16_y">y</a>)

### Example

<div><fiddle-embed name="d815ca04fbf22b5acec6f85b6351f362">

#### Example Output

~~~~
pt1.fX == pt2.fX
pt1.fY == pt2.fY
~~~~

</fiddle-embed></div>

### See Also

<a href="#SkIPoint16_set">set</a> <a href="#SkPoint_iset">SkPoint::iset()</a> <a href="#SkIPoint_Make">SkIPoint::Make</a>

---

<a name="SkIPoint16_x"></a>
## x

<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
int16_t x() const
</pre>

Returns <a href="#SkIPoint16_x">x</a>-axis value of <a href="#IPoint16">IPoint16</a>.

### Return Value

<a href="#SkIPoint16_fX">fX</a>

### Example

<div><fiddle-embed name="f7fd3b3674f042869de3582ab793dbf7">

#### Example Output

~~~~
pt1.fX == pt1.x()
~~~~

</fiddle-embed></div>

### See Also

<a href="#SkIPoint16_y">y</a> <a href="#SkIPoint_x">SkIPoint::x()</a>

---

<a name="SkIPoint16_y"></a>
## y

<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
int16_t y() const
</pre>

Returns <a href="#SkIPoint16_y">y</a>-axis value of <a href="SkIPoint_Reference#IPoint">IPoint</a>.

### Return Value

<a href="#SkIPoint16_fY">fY</a>

### Example

<div><fiddle-embed name="3662cedaf1e9924a401f794902da3b1f">

#### Example Output

~~~~
pt1.fY == pt1.y()
~~~~

</fiddle-embed></div>

### See Also

<a href="#SkIPoint16_x">x</a> <a href="#SkPoint_y">SkPoint::y()</a> <a href="#SkIPoint_y">SkIPoint::y()</a>

---

<a name="SkIPoint16_set"></a>
## set

<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
void set(int x, int y)
</pre>

Sets <a href="#SkIPoint16_fX">fX</a> to <a href="#SkIPoint16_x">x</a> and <a href="#SkIPoint16_fY">fY</a> to <a href="#SkIPoint16_y">y</a>.

### Parameters

<table>  <tr>    <td><a name="SkIPoint16_set_x"> <code><strong>x </strong></code> </a></td> <td>
new value for <a href="#SkIPoint16_fX">fX</a></td>
  </tr>  <tr>    <td><a name="SkIPoint16_set_y"> <code><strong>y </strong></code> </a></td> <td>
new value for <a href="#SkIPoint16_fY">fY</a></td>
  </tr>
</table>

### Example

<div><fiddle-embed name="abff78d3f2d97b1284ccb13d0c56b6c8">

#### Example Output

~~~~
pt1.fX == pt2.fX
pt1.fY == pt2.fY
~~~~

</fiddle-embed></div>

### See Also

<a href="#SkIPoint16_Make">Make</a> <a href="#SkPoint_set">SkPoint::set</a>

---