forked from progrium/darwinkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpoint.gen.go
149 lines (125 loc) · 4.41 KB
/
point.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
// Code generated by DarwinKit. DO NOT EDIT.
package vision
import (
"unsafe"
"github.com/progrium/macdriver/macos/coregraphics"
"github.com/progrium/macdriver/objc"
)
// The class instance for the [Point] class.
var PointClass = _PointClass{objc.GetClass("VNPoint")}
type _PointClass struct {
objc.Class
}
// An interface definition for the [Point] class.
type IPoint interface {
objc.IObject
DistanceToPoint(point IPoint) float64
Y() float64
Location() coregraphics.Point
X() float64
}
// An immutable object that represents a single, two-dimensional point in an image. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/vision/vnpoint?language=objc
type Point struct {
objc.Object
}
func PointFrom(ptr unsafe.Pointer) Point {
return Point{
Object: objc.ObjectFrom(ptr),
}
}
func (p_ Point) InitWithLocation(location coregraphics.Point) Point {
rv := objc.Call[Point](p_, objc.Sel("initWithLocation:"), location)
return rv
}
// Creates a point object from the specified Core Graphics point. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/vision/vnpoint/3548330-initwithlocation?language=objc
func NewPointWithLocation(location coregraphics.Point) Point {
instance := PointClass.Alloc().InitWithLocation(location)
instance.Autorelease()
return instance
}
func (p_ Point) InitWithXY(x float64, y float64) Point {
rv := objc.Call[Point](p_, objc.Sel("initWithX:y:"), x, y)
return rv
}
// Creates a point object with the specified coordinates. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/vision/vnpoint/3548331-initwithx?language=objc
func NewPointWithXY(x float64, y float64) Point {
instance := PointClass.Alloc().InitWithXY(x, y)
instance.Autorelease()
return instance
}
func (pc _PointClass) Alloc() Point {
rv := objc.Call[Point](pc, objc.Sel("alloc"))
return rv
}
func (pc _PointClass) New() Point {
rv := objc.Call[Point](pc, objc.Sel("new"))
rv.Autorelease()
return rv
}
func NewPoint() Point {
return PointClass.New()
}
func (p_ Point) Init() Point {
rv := objc.Call[Point](p_, objc.Sel("init"))
return rv
}
// Creates a point object that’s shifted by the X and Y offsets of the specified vector. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/vision/vnpoint/3548333-pointbyapplyingvector?language=objc
func (pc _PointClass) PointByApplyingVectorToPoint(vector IVector, point IPoint) Point {
rv := objc.Call[Point](pc, objc.Sel("pointByApplyingVector:toPoint:"), objc.Ptr(vector), objc.Ptr(point))
return rv
}
// Creates a point object that’s shifted by the X and Y offsets of the specified vector. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/vision/vnpoint/3548333-pointbyapplyingvector?language=objc
func Point_PointByApplyingVectorToPoint(vector IVector, point IPoint) Point {
return PointClass.PointByApplyingVectorToPoint(vector, point)
}
// Returns the distance to another point. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/vision/vnpoint/3675674-distancetopoint?language=objc
func (p_ Point) DistanceToPoint(point IPoint) float64 {
rv := objc.Call[float64](p_, objc.Sel("distanceToPoint:"), objc.Ptr(point))
return rv
}
// The y-coordinate. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/vision/vnpoint/3548335-y?language=objc
func (p_ Point) Y() float64 {
rv := objc.Call[float64](p_, objc.Sel("y"))
return rv
}
// A point object that represents the origin. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/vision/vnpoint/3548336-zeropoint?language=objc
func (pc _PointClass) ZeroPoint() Point {
rv := objc.Call[Point](pc, objc.Sel("zeroPoint"))
return rv
}
// A point object that represents the origin. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/vision/vnpoint/3548336-zeropoint?language=objc
func Point_ZeroPoint() Point {
return PointClass.ZeroPoint()
}
// The Core Graphics point for this point. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/vision/vnpoint/3548332-location?language=objc
func (p_ Point) Location() coregraphics.Point {
rv := objc.Call[coregraphics.Point](p_, objc.Sel("location"))
return rv
}
// The x-coordinate. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/vision/vnpoint/3548334-x?language=objc
func (p_ Point) X() float64 {
rv := objc.Call[float64](p_, objc.Sel("x"))
return rv
}