objc2_vision/generated/
VNFaceLandmarks.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5#[cfg(feature = "objc2-core-foundation")]
6use objc2_core_foundation::*;
7use objc2_foundation::*;
8
9use crate::*;
10
11extern_class!(
12    /// 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.
13    ///
14    /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vnfacelandmarkregion?language=objc)
15    #[unsafe(super(NSObject))]
16    #[derive(Debug, PartialEq, Eq, Hash)]
17    pub struct VNFaceLandmarkRegion;
18);
19
20extern_conformance!(
21    unsafe impl NSCoding for VNFaceLandmarkRegion {}
22);
23
24extern_conformance!(
25    unsafe impl NSCopying for VNFaceLandmarkRegion {}
26);
27
28unsafe impl CopyingHelper for VNFaceLandmarkRegion {
29    type Result = Self;
30}
31
32extern_conformance!(
33    unsafe impl NSObjectProtocol for VNFaceLandmarkRegion {}
34);
35
36extern_conformance!(
37    unsafe impl NSSecureCoding for VNFaceLandmarkRegion {}
38);
39
40#[cfg(feature = "VNRequestRevisionProviding")]
41extern_conformance!(
42    unsafe impl VNRequestRevisionProviding for VNFaceLandmarkRegion {}
43);
44
45impl VNFaceLandmarkRegion {
46    extern_methods!(
47        #[unsafe(method(new))]
48        #[unsafe(method_family = new)]
49        pub unsafe fn new() -> Retained<Self>;
50
51        #[unsafe(method(init))]
52        #[unsafe(method_family = init)]
53        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
54
55        /// pointCount returns the amount of points in a given region. This can be zero if no points for a region could be found.
56        #[unsafe(method(pointCount))]
57        #[unsafe(method_family = none)]
58        pub unsafe fn pointCount(&self) -> NSUInteger;
59    );
60}
61
62extern_class!(
63    /// VNFaceLandmarkRegion2D gives access to the 2D landmark points for the region. The points are stored as vector_float2 and must not be modified.
64    ///
65    /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vnfacelandmarkregion2d?language=objc)
66    #[unsafe(super(VNFaceLandmarkRegion, NSObject))]
67    #[derive(Debug, PartialEq, Eq, Hash)]
68    pub struct VNFaceLandmarkRegion2D;
69);
70
71extern_conformance!(
72    unsafe impl NSCoding for VNFaceLandmarkRegion2D {}
73);
74
75extern_conformance!(
76    unsafe impl NSCopying for VNFaceLandmarkRegion2D {}
77);
78
79unsafe impl CopyingHelper for VNFaceLandmarkRegion2D {
80    type Result = Self;
81}
82
83extern_conformance!(
84    unsafe impl NSObjectProtocol for VNFaceLandmarkRegion2D {}
85);
86
87extern_conformance!(
88    unsafe impl NSSecureCoding for VNFaceLandmarkRegion2D {}
89);
90
91#[cfg(feature = "VNRequestRevisionProviding")]
92extern_conformance!(
93    unsafe impl VNRequestRevisionProviding for VNFaceLandmarkRegion2D {}
94);
95
96impl VNFaceLandmarkRegion2D {
97    extern_methods!(
98        #[cfg(feature = "objc2-core-foundation")]
99        /// Obtains the array of normalized landmark points.
100        ///
101        ///
102        /// 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.
103        ///
104        ///
105        /// Returns: the address of the array of pointCount points.
106        ///
107        /// # Safety
108        ///
109        /// You must ensure this is still alive.
110        #[unsafe(method(normalizedPoints))]
111        #[unsafe(method_family = none)]
112        pub unsafe fn normalizedPoints(&self) -> *const CGPoint;
113
114        #[cfg(feature = "objc2-core-foundation")]
115        /// Provides the array of landmark points in the coordinate space of a specific image size.
116        ///
117        ///
118        /// 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.
119        ///
120        ///
121        /// Parameter `imageSize`: The pixel dimensions of the image in which the landmark points are being presented.
122        ///
123        ///
124        /// Returns: the address of the array of pointCount points, or NULL if the conversion could not take place.
125        #[unsafe(method(pointsInImageOfSize:))]
126        #[unsafe(method_family = none)]
127        pub unsafe fn pointsInImageOfSize(&self, image_size: CGSize) -> NonNull<CGPoint>;
128
129        /// Obtains the array of accuracy placement estimates per landmark point.
130        ///
131        ///
132        /// Provides the NSArray object containing landmarks accuracy placement estimates per landmark point. This property is only
133        /// populated when VNDetectFaceLandmarksRequest object is configured with VNRequestFaceLandmarksConstellation76Points. It is
134        /// set to nil for other constellations
135        ///
136        ///
137        /// Returns: NSArray object of NSNumber(s) initialized to floating point values.
138        #[unsafe(method(precisionEstimatesPerPoint))]
139        #[unsafe(method_family = none)]
140        pub unsafe fn precisionEstimatesPerPoint(&self) -> Option<Retained<NSArray<NSNumber>>>;
141
142        #[cfg(feature = "VNTypes")]
143        /// Describes how to interpret the points provided by the region.
144        #[unsafe(method(pointsClassification))]
145        #[unsafe(method_family = none)]
146        pub unsafe fn pointsClassification(&self) -> VNPointsClassification;
147    );
148}
149
150/// Methods declared on superclass `VNFaceLandmarkRegion`.
151impl VNFaceLandmarkRegion2D {
152    extern_methods!(
153        #[unsafe(method(new))]
154        #[unsafe(method_family = new)]
155        pub unsafe fn new() -> Retained<Self>;
156
157        #[unsafe(method(init))]
158        #[unsafe(method_family = init)]
159        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
160    );
161}
162
163extern_class!(
164    /// VNFaceLandmarks2D is the result of a face landmarks request. It is an abstract base class.
165    ///
166    /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vnfacelandmarks?language=objc)
167    #[unsafe(super(NSObject))]
168    #[derive(Debug, PartialEq, Eq, Hash)]
169    pub struct VNFaceLandmarks;
170);
171
172extern_conformance!(
173    unsafe impl NSCoding for VNFaceLandmarks {}
174);
175
176extern_conformance!(
177    unsafe impl NSCopying for VNFaceLandmarks {}
178);
179
180unsafe impl CopyingHelper for VNFaceLandmarks {
181    type Result = Self;
182}
183
184extern_conformance!(
185    unsafe impl NSObjectProtocol for VNFaceLandmarks {}
186);
187
188extern_conformance!(
189    unsafe impl NSSecureCoding for VNFaceLandmarks {}
190);
191
192#[cfg(feature = "VNRequestRevisionProviding")]
193extern_conformance!(
194    unsafe impl VNRequestRevisionProviding for VNFaceLandmarks {}
195);
196
197impl VNFaceLandmarks {
198    extern_methods!(
199        #[unsafe(method(init))]
200        #[unsafe(method_family = init)]
201        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
202
203        #[cfg(feature = "VNTypes")]
204        /// a confidence estimate for the returned landmarks.
205        #[unsafe(method(confidence))]
206        #[unsafe(method_family = none)]
207        pub unsafe fn confidence(&self) -> VNConfidence;
208    );
209}
210
211/// Methods declared on superclass `NSObject`.
212impl VNFaceLandmarks {
213    extern_methods!(
214        #[unsafe(method(new))]
215        #[unsafe(method_family = new)]
216        pub unsafe fn new() -> Retained<Self>;
217    );
218}
219
220extern_class!(
221    /// 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.
222    ///
223    /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vnfacelandmarks2d?language=objc)
224    #[unsafe(super(VNFaceLandmarks, NSObject))]
225    #[derive(Debug, PartialEq, Eq, Hash)]
226    pub struct VNFaceLandmarks2D;
227);
228
229extern_conformance!(
230    unsafe impl NSCoding for VNFaceLandmarks2D {}
231);
232
233extern_conformance!(
234    unsafe impl NSCopying for VNFaceLandmarks2D {}
235);
236
237unsafe impl CopyingHelper for VNFaceLandmarks2D {
238    type Result = Self;
239}
240
241extern_conformance!(
242    unsafe impl NSObjectProtocol for VNFaceLandmarks2D {}
243);
244
245extern_conformance!(
246    unsafe impl NSSecureCoding for VNFaceLandmarks2D {}
247);
248
249#[cfg(feature = "VNRequestRevisionProviding")]
250extern_conformance!(
251    unsafe impl VNRequestRevisionProviding for VNFaceLandmarks2D {}
252);
253
254impl VNFaceLandmarks2D {
255    extern_methods!(
256        /// allPoints the region containing all face landmark points.
257        #[unsafe(method(allPoints))]
258        #[unsafe(method_family = none)]
259        pub unsafe fn allPoints(&self) -> Option<Retained<VNFaceLandmarkRegion2D>>;
260
261        /// faceContour the region containing the points that describe the face contour from cheek over chin to cheek.
262        #[unsafe(method(faceContour))]
263        #[unsafe(method_family = none)]
264        pub unsafe fn faceContour(&self) -> Option<Retained<VNFaceLandmarkRegion2D>>;
265
266        /// leftEye the region containing the points describing the outline of the left eye.
267        #[unsafe(method(leftEye))]
268        #[unsafe(method_family = none)]
269        pub unsafe fn leftEye(&self) -> Option<Retained<VNFaceLandmarkRegion2D>>;
270
271        /// rightEye the region containing the points describing the outline of the right eye.
272        #[unsafe(method(rightEye))]
273        #[unsafe(method_family = none)]
274        pub unsafe fn rightEye(&self) -> Option<Retained<VNFaceLandmarkRegion2D>>;
275
276        /// leftEyebrow the region containing the points describing the trace of the left eyebrow.
277        #[unsafe(method(leftEyebrow))]
278        #[unsafe(method_family = none)]
279        pub unsafe fn leftEyebrow(&self) -> Option<Retained<VNFaceLandmarkRegion2D>>;
280
281        /// rightEyebrow the region containing the points describing the trace of the right eyebrow.
282        #[unsafe(method(rightEyebrow))]
283        #[unsafe(method_family = none)]
284        pub unsafe fn rightEyebrow(&self) -> Option<Retained<VNFaceLandmarkRegion2D>>;
285
286        /// nose the region containing the points describing the outline of the nose.
287        #[unsafe(method(nose))]
288        #[unsafe(method_family = none)]
289        pub unsafe fn nose(&self) -> Option<Retained<VNFaceLandmarkRegion2D>>;
290
291        /// noseCrest the region containing the points describing the trace of the center crest of the nose.
292        #[unsafe(method(noseCrest))]
293        #[unsafe(method_family = none)]
294        pub unsafe fn noseCrest(&self) -> Option<Retained<VNFaceLandmarkRegion2D>>;
295
296        /// medianLine the region containing the points describing the trace of the center line of the face.
297        #[unsafe(method(medianLine))]
298        #[unsafe(method_family = none)]
299        pub unsafe fn medianLine(&self) -> Option<Retained<VNFaceLandmarkRegion2D>>;
300
301        /// outer lips the region containing the points describing the outline of the outside of the lips.
302        #[unsafe(method(outerLips))]
303        #[unsafe(method_family = none)]
304        pub unsafe fn outerLips(&self) -> Option<Retained<VNFaceLandmarkRegion2D>>;
305
306        /// innerLips the region containing the points describing the outline of the space between the of the lips.
307        #[unsafe(method(innerLips))]
308        #[unsafe(method_family = none)]
309        pub unsafe fn innerLips(&self) -> Option<Retained<VNFaceLandmarkRegion2D>>;
310
311        /// leftPupil the region containing the point where the left pupil is located.  This value may be inaccurate if
312        /// the face isBlinking.
313        #[unsafe(method(leftPupil))]
314        #[unsafe(method_family = none)]
315        pub unsafe fn leftPupil(&self) -> Option<Retained<VNFaceLandmarkRegion2D>>;
316
317        /// rightPupil the region containing the point where the right pupil is located.  This value may be inaccurate if
318        /// the face isBlinking.
319        #[unsafe(method(rightPupil))]
320        #[unsafe(method_family = none)]
321        pub unsafe fn rightPupil(&self) -> Option<Retained<VNFaceLandmarkRegion2D>>;
322    );
323}
324
325/// Methods declared on superclass `VNFaceLandmarks`.
326impl VNFaceLandmarks2D {
327    extern_methods!(
328        #[unsafe(method(init))]
329        #[unsafe(method_family = init)]
330        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
331    );
332}
333
334/// Methods declared on superclass `NSObject`.
335impl VNFaceLandmarks2D {
336    extern_methods!(
337        #[unsafe(method(new))]
338        #[unsafe(method_family = new)]
339        pub unsafe fn new() -> Retained<Self>;
340    );
341}