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
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
/// VNFaceLandmarkRegion is an immutable object acting as a collection of landmark points for defining a specific region of the face (including potentially all of the landmark points for a face). The VNFaceLandmarkRegion is an abstract base class.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vnfacelandmarkregion?language=objc)
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct VNFaceLandmarkRegion;
);
extern_conformance!(
unsafe impl NSCoding for VNFaceLandmarkRegion {}
);
extern_conformance!(
unsafe impl NSCopying for VNFaceLandmarkRegion {}
);
unsafe impl CopyingHelper for VNFaceLandmarkRegion {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for VNFaceLandmarkRegion {}
);
extern_conformance!(
unsafe impl NSSecureCoding for VNFaceLandmarkRegion {}
);
#[cfg(feature = "VNRequestRevisionProviding")]
extern_conformance!(
unsafe impl VNRequestRevisionProviding for VNFaceLandmarkRegion {}
);
impl VNFaceLandmarkRegion {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
/// pointCount returns the amount of points in a given region. This can be zero if no points for a region could be found.
#[unsafe(method(pointCount))]
#[unsafe(method_family = none)]
pub unsafe fn pointCount(&self) -> NSUInteger;
);
}
extern_class!(
/// VNFaceLandmarkRegion2D gives access to the 2D landmark points for the region. The points are stored as vector_float2 and must not be modified.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vnfacelandmarkregion2d?language=objc)
#[unsafe(super(VNFaceLandmarkRegion, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct VNFaceLandmarkRegion2D;
);
extern_conformance!(
unsafe impl NSCoding for VNFaceLandmarkRegion2D {}
);
extern_conformance!(
unsafe impl NSCopying for VNFaceLandmarkRegion2D {}
);
unsafe impl CopyingHelper for VNFaceLandmarkRegion2D {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for VNFaceLandmarkRegion2D {}
);
extern_conformance!(
unsafe impl NSSecureCoding for VNFaceLandmarkRegion2D {}
);
#[cfg(feature = "VNRequestRevisionProviding")]
extern_conformance!(
unsafe impl VNRequestRevisionProviding for VNFaceLandmarkRegion2D {}
);
impl VNFaceLandmarkRegion2D {
extern_methods!(
#[cfg(feature = "objc2-core-foundation")]
/// Obtains the array of normalized landmark points.
///
///
/// Provides the address of a buffer containing the array of CGPoints representing the landmark points. This buffer is owned by the target object and is guaranteed to exist as long as the VNFaceLandmarkRegion2D does.
///
///
/// Returns: the address of the array of pointCount points.
///
/// # Safety
///
/// You must ensure this is still alive.
#[unsafe(method(normalizedPoints))]
#[unsafe(method_family = none)]
pub unsafe fn normalizedPoints(&self) -> *const CGPoint;
#[cfg(feature = "objc2-core-foundation")]
/// Provides the array of landmark points in the coordinate space of a specific image size.
///
///
/// Provides the address of a buffer containing the array of CGPoints representing the landmark points in the coordinate space of a specific image size. This buffer is owned by the target object and is guaranteed to exist as long as the VNFaceLandmarkRegion2D does.
///
///
/// Parameter `imageSize`: The pixel dimensions of the image in which the landmark points are being presented.
///
///
/// Returns: the address of the array of pointCount points, or NULL if the conversion could not take place.
#[unsafe(method(pointsInImageOfSize:))]
#[unsafe(method_family = none)]
pub unsafe fn pointsInImageOfSize(&self, image_size: CGSize) -> NonNull<CGPoint>;
/// Obtains the array of accuracy placement estimates per landmark point.
///
///
/// Provides the NSArray object containing landmarks accuracy placement estimates per landmark point. This property is only
/// populated when VNDetectFaceLandmarksRequest object is configured with VNRequestFaceLandmarksConstellation76Points. It is
/// set to nil for other constellations
///
///
/// Returns: NSArray object of NSNumber(s) initialized to floating point values.
#[unsafe(method(precisionEstimatesPerPoint))]
#[unsafe(method_family = none)]
pub unsafe fn precisionEstimatesPerPoint(&self) -> Option<Retained<NSArray<NSNumber>>>;
#[cfg(feature = "VNTypes")]
/// Describes how to interpret the points provided by the region.
#[unsafe(method(pointsClassification))]
#[unsafe(method_family = none)]
pub unsafe fn pointsClassification(&self) -> VNPointsClassification;
);
}
/// Methods declared on superclass `VNFaceLandmarkRegion`.
impl VNFaceLandmarkRegion2D {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
);
}
extern_class!(
/// VNFaceLandmarks2D is the result of a face landmarks request. It is an abstract base class.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vnfacelandmarks?language=objc)
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct VNFaceLandmarks;
);
extern_conformance!(
unsafe impl NSCoding for VNFaceLandmarks {}
);
extern_conformance!(
unsafe impl NSCopying for VNFaceLandmarks {}
);
unsafe impl CopyingHelper for VNFaceLandmarks {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for VNFaceLandmarks {}
);
extern_conformance!(
unsafe impl NSSecureCoding for VNFaceLandmarks {}
);
#[cfg(feature = "VNRequestRevisionProviding")]
extern_conformance!(
unsafe impl VNRequestRevisionProviding for VNFaceLandmarks {}
);
impl VNFaceLandmarks {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[cfg(feature = "VNTypes")]
/// a confidence estimate for the returned landmarks.
#[unsafe(method(confidence))]
#[unsafe(method_family = none)]
pub unsafe fn confidence(&self) -> VNConfidence;
);
}
/// Methods declared on superclass `NSObject`.
impl VNFaceLandmarks {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
extern_class!(
/// VNFaceLandmarks2D is the result of a face landmarks 2D request, containing detected facial landmark points organized into VNFaceLandmarkRegion2D regions. The points are accessible as a full list, or as sub-gruops representing pre-defined facial regions.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vnfacelandmarks2d?language=objc)
#[unsafe(super(VNFaceLandmarks, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct VNFaceLandmarks2D;
);
extern_conformance!(
unsafe impl NSCoding for VNFaceLandmarks2D {}
);
extern_conformance!(
unsafe impl NSCopying for VNFaceLandmarks2D {}
);
unsafe impl CopyingHelper for VNFaceLandmarks2D {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for VNFaceLandmarks2D {}
);
extern_conformance!(
unsafe impl NSSecureCoding for VNFaceLandmarks2D {}
);
#[cfg(feature = "VNRequestRevisionProviding")]
extern_conformance!(
unsafe impl VNRequestRevisionProviding for VNFaceLandmarks2D {}
);
impl VNFaceLandmarks2D {
extern_methods!(
/// allPoints the region containing all face landmark points.
#[unsafe(method(allPoints))]
#[unsafe(method_family = none)]
pub unsafe fn allPoints(&self) -> Option<Retained<VNFaceLandmarkRegion2D>>;
/// faceContour the region containing the points that describe the face contour from cheek over chin to cheek.
#[unsafe(method(faceContour))]
#[unsafe(method_family = none)]
pub unsafe fn faceContour(&self) -> Option<Retained<VNFaceLandmarkRegion2D>>;
/// leftEye the region containing the points describing the outline of the left eye.
#[unsafe(method(leftEye))]
#[unsafe(method_family = none)]
pub unsafe fn leftEye(&self) -> Option<Retained<VNFaceLandmarkRegion2D>>;
/// rightEye the region containing the points describing the outline of the right eye.
#[unsafe(method(rightEye))]
#[unsafe(method_family = none)]
pub unsafe fn rightEye(&self) -> Option<Retained<VNFaceLandmarkRegion2D>>;
/// leftEyebrow the region containing the points describing the trace of the left eyebrow.
#[unsafe(method(leftEyebrow))]
#[unsafe(method_family = none)]
pub unsafe fn leftEyebrow(&self) -> Option<Retained<VNFaceLandmarkRegion2D>>;
/// rightEyebrow the region containing the points describing the trace of the right eyebrow.
#[unsafe(method(rightEyebrow))]
#[unsafe(method_family = none)]
pub unsafe fn rightEyebrow(&self) -> Option<Retained<VNFaceLandmarkRegion2D>>;
/// nose the region containing the points describing the outline of the nose.
#[unsafe(method(nose))]
#[unsafe(method_family = none)]
pub unsafe fn nose(&self) -> Option<Retained<VNFaceLandmarkRegion2D>>;
/// noseCrest the region containing the points describing the trace of the center crest of the nose.
#[unsafe(method(noseCrest))]
#[unsafe(method_family = none)]
pub unsafe fn noseCrest(&self) -> Option<Retained<VNFaceLandmarkRegion2D>>;
/// medianLine the region containing the points describing the trace of the center line of the face.
#[unsafe(method(medianLine))]
#[unsafe(method_family = none)]
pub unsafe fn medianLine(&self) -> Option<Retained<VNFaceLandmarkRegion2D>>;
/// outer lips the region containing the points describing the outline of the outside of the lips.
#[unsafe(method(outerLips))]
#[unsafe(method_family = none)]
pub unsafe fn outerLips(&self) -> Option<Retained<VNFaceLandmarkRegion2D>>;
/// innerLips the region containing the points describing the outline of the space between the of the lips.
#[unsafe(method(innerLips))]
#[unsafe(method_family = none)]
pub unsafe fn innerLips(&self) -> Option<Retained<VNFaceLandmarkRegion2D>>;
/// leftPupil the region containing the point where the left pupil is located. This value may be inaccurate if
/// the face isBlinking.
#[unsafe(method(leftPupil))]
#[unsafe(method_family = none)]
pub unsafe fn leftPupil(&self) -> Option<Retained<VNFaceLandmarkRegion2D>>;
/// rightPupil the region containing the point where the right pupil is located. This value may be inaccurate if
/// the face isBlinking.
#[unsafe(method(rightPupil))]
#[unsafe(method_family = none)]
pub unsafe fn rightPupil(&self) -> Option<Retained<VNFaceLandmarkRegion2D>>;
);
}
/// Methods declared on superclass `VNFaceLandmarks`.
impl VNFaceLandmarks2D {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
);
}
/// Methods declared on superclass `NSObject`.
impl VNFaceLandmarks2D {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}