forked from progrium/darwinkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvector.gen.go
240 lines (204 loc) · 8.59 KB
/
vector.gen.go
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
// Code generated by DarwinKit. DO NOT EDIT.
package vision
import (
"unsafe"
"github.com/progrium/macdriver/objc"
)
// The class instance for the [Vector] class.
var VectorClass = _VectorClass{objc.GetClass("VNVector")}
type _VectorClass struct {
objc.Class
}
// An interface definition for the [Vector] class.
type IVector interface {
objc.IObject
Length() float64
X() float64
R() float64
Y() float64
SquaredLength() float64
Theta() float64
}
// An immutable, two-dimensional vector represented by its x-axis and y-axis projections. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/vision/vnvector?language=objc
type Vector struct {
objc.Object
}
func VectorFrom(ptr unsafe.Pointer) Vector {
return Vector{
Object: objc.ObjectFrom(ptr),
}
}
func (v_ Vector) InitWithRTheta(r float64, theta float64) Vector {
rv := objc.Call[Vector](v_, objc.Sel("initWithR:theta:"), r, theta)
return rv
}
// Creates a new vector in polar coordinate space. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/vision/vnvector/3548339-initwithr?language=objc
func NewVectorWithRTheta(r float64, theta float64) Vector {
instance := VectorClass.Alloc().InitWithRTheta(r, theta)
instance.Autorelease()
return instance
}
func (v_ Vector) InitWithXComponentYComponent(x float64, y float64) Vector {
rv := objc.Call[Vector](v_, objc.Sel("initWithXComponent:yComponent:"), x, y)
return rv
}
// Creates a new vector in Cartesian coordinate space, based on its x-axis and y-axis projections. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/vision/vnvector/3548341-initwithxcomponent?language=objc
func NewVectorWithXComponentYComponent(x float64, y float64) Vector {
instance := VectorClass.Alloc().InitWithXComponentYComponent(x, y)
instance.Autorelease()
return instance
}
func (v_ Vector) InitWithVectorHeadTail(head IPoint, tail IPoint) Vector {
rv := objc.Call[Vector](v_, objc.Sel("initWithVectorHead:tail:"), objc.Ptr(head), objc.Ptr(tail))
return rv
}
// Creates a new vector in Cartesian coordinate space. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/vision/vnvector/3548340-initwithvectorhead?language=objc
func NewVectorWithVectorHeadTail(head IPoint, tail IPoint) Vector {
instance := VectorClass.Alloc().InitWithVectorHeadTail(head, tail)
instance.Autorelease()
return instance
}
func (vc _VectorClass) Alloc() Vector {
rv := objc.Call[Vector](vc, objc.Sel("alloc"))
return rv
}
func (vc _VectorClass) New() Vector {
rv := objc.Call[Vector](vc, objc.Sel("new"))
rv.Autorelease()
return rv
}
func NewVector() Vector {
return VectorClass.New()
}
func (v_ Vector) Init() Vector {
rv := objc.Call[Vector](v_, objc.Sel("init"))
return rv
}
// Creates a new vector by adding the specified vectors. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/vision/vnvector/3548347-vectorbyaddingvector?language=objc
func (vc _VectorClass) VectorByAddingVectorToVector(v1 IVector, v2 IVector) Vector {
rv := objc.Call[Vector](vc, objc.Sel("vectorByAddingVector:toVector:"), objc.Ptr(v1), objc.Ptr(v2))
return rv
}
// Creates a new vector by adding the specified vectors. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/vision/vnvector/3548347-vectorbyaddingvector?language=objc
func Vector_VectorByAddingVectorToVector(v1 IVector, v2 IVector) Vector {
return VectorClass.VectorByAddingVectorToVector(v1, v2)
}
// Creates a new vector by subtracting the first vector from the second vector. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/vision/vnvector/3548349-vectorbysubtractingvector?language=objc
func (vc _VectorClass) VectorBySubtractingVectorFromVector(v1 IVector, v2 IVector) Vector {
rv := objc.Call[Vector](vc, objc.Sel("vectorBySubtractingVector:fromVector:"), objc.Ptr(v1), objc.Ptr(v2))
return rv
}
// Creates a new vector by subtracting the first vector from the second vector. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/vision/vnvector/3548349-vectorbysubtractingvector?language=objc
func Vector_VectorBySubtractingVectorFromVector(v1 IVector, v2 IVector) Vector {
return VectorClass.VectorBySubtractingVectorFromVector(v1, v2)
}
// Creates a new vector by multiplying the specified vector’s x-axis and y-axis projections by the scalar value. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/vision/vnvector/3548348-vectorbymultiplyingvector?language=objc
func (vc _VectorClass) VectorByMultiplyingVectorByScalar(vector IVector, scalar float64) Vector {
rv := objc.Call[Vector](vc, objc.Sel("vectorByMultiplyingVector:byScalar:"), objc.Ptr(vector), scalar)
return rv
}
// Creates a new vector by multiplying the specified vector’s x-axis and y-axis projections by the scalar value. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/vision/vnvector/3548348-vectorbymultiplyingvector?language=objc
func Vector_VectorByMultiplyingVectorByScalar(vector IVector, scalar float64) Vector {
return VectorClass.VectorByMultiplyingVectorByScalar(vector, scalar)
}
// Caclulates the dot product of two vectors. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/vision/vnvector/3548338-dotproductofvector?language=objc
func (vc _VectorClass) DotProductOfVectorVector(v1 IVector, v2 IVector) float64 {
rv := objc.Call[float64](vc, objc.Sel("dotProductOfVector:vector:"), objc.Ptr(v1), objc.Ptr(v2))
return rv
}
// Caclulates the dot product of two vectors. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/vision/vnvector/3548338-dotproductofvector?language=objc
func Vector_DotProductOfVectorVector(v1 IVector, v2 IVector) float64 {
return VectorClass.DotProductOfVectorVector(v1, v2)
}
// Calculates a vector that’s normalized by preserving its direction, so that the vector length equals 1.0. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/vision/vnvector/3548346-unitvectorforvector?language=objc
func (vc _VectorClass) UnitVectorForVector(vector IVector) Vector {
rv := objc.Call[Vector](vc, objc.Sel("unitVectorForVector:"), objc.Ptr(vector))
return rv
}
// Calculates a vector that’s normalized by preserving its direction, so that the vector length equals 1.0. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/vision/vnvector/3548346-unitvectorforvector?language=objc
func Vector_UnitVectorForVector(vector IVector) Vector {
return VectorClass.UnitVectorForVector(vector)
}
// A vector object with zero length. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/vision/vnvector/3548352-zerovector?language=objc
func (vc _VectorClass) ZeroVector() Vector {
rv := objc.Call[Vector](vc, objc.Sel("zeroVector"))
return rv
}
// A vector object with zero length. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/vision/vnvector/3548352-zerovector?language=objc
func Vector_ZeroVector() Vector {
return VectorClass.ZeroVector()
}
// The length, or absolute value, of the vector. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/vision/vnvector/3548342-length?language=objc
func (v_ Vector) Length() float64 {
rv := objc.Call[float64](v_, objc.Sel("length"))
return rv
}
// A signed projection that indicates the vector’s direction on the x-axis. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/vision/vnvector/3548350-x?language=objc
func (v_ Vector) X() float64 {
rv := objc.Call[float64](v_, objc.Sel("x"))
return rv
}
// The radius, absolute value, or length of the vector. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/vision/vnvector/3548343-r?language=objc
func (v_ Vector) R() float64 {
rv := objc.Call[float64](v_, objc.Sel("r"))
return rv
}
// A signed projection that indicates the vector’s direction on the y-axis. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/vision/vnvector/3548351-y?language=objc
func (v_ Vector) Y() float64 {
rv := objc.Call[float64](v_, objc.Sel("y"))
return rv
}
// The squared length of the vector. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/vision/vnvector/3548344-squaredlength?language=objc
func (v_ Vector) SquaredLength() float64 {
rv := objc.Call[float64](v_, objc.Sel("squaredLength"))
return rv
}
// The angle between the vector direction and the positive direction of the x-axis. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/vision/vnvector/3548345-theta?language=objc
func (v_ Vector) Theta() float64 {
rv := objc.Call[float64](v_, objc.Sel("theta"))
return rv
}