blob: b5c3cfee99470229f2db8d757ef4df3b35916524 [file] [log] [blame]
Cary Clarka560c472017-11-27 10:44:06 -05001#Topic IPoint16
2#Alias IPoint16_Reference
3
4#Struct SkIPoint16
5
6SkIPoint holds two 16 bit integer coordinates
7
8#Topic Overview
9
10#Subtopic Subtopics
11#ToDo manually add subtopics ##
12#Table
13#Legend
14# topics # description ##
15#Legend ##
16#Table ##
17##
18
19#Subtopic Member_Functions
20#Table
21#Legend
22# description # function ##
23#Legend ##
24# Make # Constructs from integer inputs. ##
25# set() # Sets to integer input. ##
26# x() # Returns fX. ##
27# y() # Returns fY. ##
28#Table ##
29#Subtopic ##
30
31#Topic ##
32
33#Member int16_t fX
34x-axis value used by IPoint16.
35##
36
37#Member int16_t fY
38y-axis value used by IPoint16.
39##
40
41# ------------------------------------------------------------------------------
42
43#Method static constexpr SkIPoint16 Make(int x, int y)
44
45Sets fX to x, fY to y. If SK_DEBUG is defined, asserts
46if x or y does not fit in 16 bits.
47
48#Param x integer x-axis value of constructed IPoint ##
49#Param y integer y-axis value of constructed IPoint ##
50
51#Return IPoint16 (x, y) ##
52
53#Example
54SkIPoint16 pt1 = {45, 66};
55SkIPoint16 pt2 = SkIPoint16::Make(45, 66);
56SkDebugf("pt1.fX %c= pt2.fX\n", pt1.fX == pt2.fX ? '=' : '!');
57SkDebugf("pt1.fY %c= pt2.fY\n", pt1.fY == pt2.fY ? '=' : '!');
58#StdOut
59pt1.fX == pt2.fX
60pt1.fY == pt2.fY
61##
62##
63
64#SeeAlso set() SkPoint::iset() SkIPoint::Make
65
66#Method ##
67
68# ------------------------------------------------------------------------------
69
70#Method int16_t x() const
71
72Returns x-axis value of IPoint16.
73
74#Return fX ##
75
76#Example
77SkIPoint16 pt1 = {45, 66};
78SkDebugf("pt1.fX %c= pt1.x()\n", pt1.fX == pt1.x() ? '=' : '!');
79#StdOut
80pt1.fX == pt1.x()
81##
82##
83
84#SeeAlso y() SkIPoint::x()
85
86#Method ##
87
88# ------------------------------------------------------------------------------
89
90#Method int16_t y() const
91
92Returns y-axis value of IPoint.
93
94#Return fY ##
95
96#Example
97SkIPoint16 pt1 = {45, 66};
98SkDebugf("pt1.fY %c= pt1.y()\n", pt1.fY == pt1.y() ? '=' : '!');
99#StdOut
100pt1.fY == pt1.y()
101##
102##
103
104#SeeAlso x() SkPoint::y() SkIPoint::y()
105
106#Method ##
107
108# ------------------------------------------------------------------------------
109
110#Method void set(int x, int y)
111
112Sets fX to x and fY to y.
113
114#Param x new value for fX ##
115#Param y new value for fY ##
116
117#Example
118SkIPoint16 pt1, pt2 = { SK_MinS16, SK_MaxS16 };
119pt1.set(SK_MinS16, SK_MaxS16);
120SkDebugf("pt1.fX %c= pt2.fX\n", pt1.fX == pt2.fX ? '=' : '!');
121SkDebugf("pt1.fY %c= pt2.fY\n", pt1.fY == pt2.fY ? '=' : '!');
122#StdOut
123pt1.fX == pt2.fX
124pt1.fY == pt2.fY
125##
126##
127
128#SeeAlso Make SkPoint::set
129
130#Method ##
131
132#Struct SkIPoint16 ##
133
134#Topic IPoint16 ##