blob: 4f3d53b28b583517605015314cb7127a91a0baf3 [file] [log] [blame]
Cary Clarka560c472017-11-27 10:44:06 -05001#Topic IPoint16
2#Alias IPoint16_Reference
3
4#Struct SkIPoint16
5
Cary Clark5081eed2018-01-22 07:55:48 -05006SkIPoint holds two 16 bit integer coordinates.
Cary Clarka560c472017-11-27 10:44:06 -05007
8#Topic Overview
9
10#Subtopic Subtopics
11#ToDo manually add subtopics ##
12#Table
13#Legend
Cary Clark5081eed2018-01-22 07:55:48 -050014# name # description ##
Cary Clarka560c472017-11-27 10:44:06 -050015#Legend ##
Cary Clark5081eed2018-01-22 07:55:48 -050016# Constructors # functions that construct SkIPoint16 ##
17# Member_Functions # static functions and member methods ##
Cary Clarka560c472017-11-27 10:44:06 -050018#Table ##
Cary Clark5081eed2018-01-22 07:55:48 -050019#Subtopic ##
20
21#Subtopic Constructors
22#Table
23#Legend
24# name # description ##
25#Legend ##
26# Make # constructs from integer inputs ##
27#Table ##
28#Subtopic ##
Cary Clarka560c472017-11-27 10:44:06 -050029
30#Subtopic Member_Functions
31#Table
32#Legend
Cary Clark5081eed2018-01-22 07:55:48 -050033# name # description ##
Cary Clarka560c472017-11-27 10:44:06 -050034#Legend ##
Cary Clark5081eed2018-01-22 07:55:48 -050035# Make # constructs from integer inputs ##
36# set() # sets to integer input ##
37# x() # returns fX ##
38# y() # returns fY ##
Cary Clarka560c472017-11-27 10:44:06 -050039#Table ##
40#Subtopic ##
41
Cary Clark5081eed2018-01-22 07:55:48 -050042#Topic Overview ##
Cary Clarka560c472017-11-27 10:44:06 -050043
44#Member int16_t fX
Cary Clark5081eed2018-01-22 07:55:48 -050045x-axis value used by IPoint16
Cary Clarka560c472017-11-27 10:44:06 -050046##
47
48#Member int16_t fY
Cary Clark5081eed2018-01-22 07:55:48 -050049y-axis value used by IPoint16
Cary Clarka560c472017-11-27 10:44:06 -050050##
51
52# ------------------------------------------------------------------------------
53
54#Method static constexpr SkIPoint16 Make(int x, int y)
55
56Sets fX to x, fY to y. If SK_DEBUG is defined, asserts
57if x or y does not fit in 16 bits.
58
59#Param x integer x-axis value of constructed IPoint ##
60#Param y integer y-axis value of constructed IPoint ##
61
62#Return IPoint16 (x, y) ##
63
64#Example
65SkIPoint16 pt1 = {45, 66};
66SkIPoint16 pt2 = SkIPoint16::Make(45, 66);
67SkDebugf("pt1.fX %c= pt2.fX\n", pt1.fX == pt2.fX ? '=' : '!');
68SkDebugf("pt1.fY %c= pt2.fY\n", pt1.fY == pt2.fY ? '=' : '!');
69#StdOut
70pt1.fX == pt2.fX
71pt1.fY == pt2.fY
72##
73##
74
75#SeeAlso set() SkPoint::iset() SkIPoint::Make
76
77#Method ##
78
79# ------------------------------------------------------------------------------
80
81#Method int16_t x() const
82
83Returns x-axis value of IPoint16.
84
85#Return fX ##
86
87#Example
88SkIPoint16 pt1 = {45, 66};
89SkDebugf("pt1.fX %c= pt1.x()\n", pt1.fX == pt1.x() ? '=' : '!');
90#StdOut
91pt1.fX == pt1.x()
92##
93##
94
95#SeeAlso y() SkIPoint::x()
96
97#Method ##
98
99# ------------------------------------------------------------------------------
100
101#Method int16_t y() const
102
103Returns y-axis value of IPoint.
104
105#Return fY ##
106
107#Example
108SkIPoint16 pt1 = {45, 66};
109SkDebugf("pt1.fY %c= pt1.y()\n", pt1.fY == pt1.y() ? '=' : '!');
110#StdOut
111pt1.fY == pt1.y()
112##
113##
114
115#SeeAlso x() SkPoint::y() SkIPoint::y()
116
117#Method ##
118
119# ------------------------------------------------------------------------------
120
121#Method void set(int x, int y)
122
123Sets fX to x and fY to y.
124
125#Param x new value for fX ##
126#Param y new value for fY ##
127
128#Example
129SkIPoint16 pt1, pt2 = { SK_MinS16, SK_MaxS16 };
130pt1.set(SK_MinS16, SK_MaxS16);
131SkDebugf("pt1.fX %c= pt2.fX\n", pt1.fX == pt2.fX ? '=' : '!');
132SkDebugf("pt1.fY %c= pt2.fY\n", pt1.fY == pt2.fY ? '=' : '!');
133#StdOut
134pt1.fX == pt2.fX
135pt1.fY == pt2.fY
136##
137##
138
139#SeeAlso Make SkPoint::set
140
141#Method ##
142
143#Struct SkIPoint16 ##
144
145#Topic IPoint16 ##