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        #[unsafe(method(normalizedPoints))]
107        #[unsafe(method_family = none)]
108        pub unsafe fn normalizedPoints(&self) -> *const CGPoint;
109
110        #[cfg(feature = "objc2-core-foundation")]
111        /// Provides the array of landmark points in the coordinate space of a specific image size.
112        ///
113        ///
114        /// 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.
115        ///
116        ///
117        /// Parameter `imageSize`: The pixel dimensions of the image in which the landmark points are being presented.
118        ///
119        ///
120        /// Returns: the address of the array of pointCount points, or NULL if the conversion could not take place.
121        #[unsafe(method(pointsInImageOfSize:))]
122        #[unsafe(method_family = none)]
123        pub unsafe fn pointsInImageOfSize(&self, image_size: CGSize) -> NonNull<CGPoint>;
124
125        /// Obtains the array of accuracy placement estimates per landmark point.
126        ///
127        ///
128        /// Provides the NSArray object containing landmarks accuracy placement estimates per landmark point. This property is only
129        /// populated when VNDetectFaceLandmarksRequest object is configured with VNRequestFaceLandmarksConstellation76Points. It is
130        /// set to nil for other constellations
131        ///
132        ///
133        /// Returns: NSArray object of NSNumber(s) initialized to floating point values.
134        #[unsafe(method(precisionEstimatesPerPoint))]
135        #[unsafe(method_family = none)]
136        pub unsafe fn precisionEstimatesPerPoint(&self) -> Option<Retained<NSArray<NSNumber>>>;
137
138        #[cfg(feature = "VNTypes")]
139        /// Describes how to interpret the points provided by the region.
140        #[unsafe(method(pointsClassification))]
141        #[unsafe(method_family = none)]
142        pub unsafe fn pointsClassification(&self) -> VNPointsClassification;
143    );
144}
145
146/// Methods declared on superclass `VNFaceLandmarkRegion`.
147impl VNFaceLandmarkRegion2D {
148    extern_methods!(
149        #[unsafe(method(new))]
150        #[unsafe(method_family = new)]
151        pub unsafe fn new() -> Retained<Self>;
152
153        #[unsafe(method(init))]
154        #[unsafe(method_family = init)]
155        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
156    );
157}
158
159extern_class!(
160    /// VNFaceLandmarks2D is the result of a face landmarks request. It is an abstract base class.
161    ///
162    /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vnfacelandmarks?language=objc)
163    #[unsafe(super(NSObject))]
164    #[derive(Debug, PartialEq, Eq, Hash)]
165    pub struct VNFaceLandmarks;
166);
167
168extern_conformance!(
169    unsafe impl NSCoding for VNFaceLandmarks {}
170);
171
172extern_conformance!(
173    unsafe impl NSCopying for VNFaceLandmarks {}
174);
175
176unsafe impl CopyingHelper for VNFaceLandmarks {
177    type Result = Self;
178}
179
180extern_conformance!(
181    unsafe impl NSObjectProtocol for VNFaceLandmarks {}
182);
183
184extern_conformance!(
185    unsafe impl NSSecureCoding for VNFaceLandmarks {}
186);
187
188#[cfg(feature = "VNRequestRevisionProviding")]
189extern_conformance!(
190    unsafe impl VNRequestRevisionProviding for VNFaceLandmarks {}
191);
192
193impl VNFaceLandmarks {
194    extern_methods!(
195        #[unsafe(method(init))]
196        #[unsafe(method_family = init)]
197        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
198
199        #[cfg(feature = "VNTypes")]
200        /// a confidence estimate for the returned landmarks.
201        #[unsafe(method(confidence))]
202        #[unsafe(method_family = none)]
203        pub unsafe fn confidence(&self) -> VNConfidence;
204    );
205}
206
207/// Methods declared on superclass `NSObject`.
208impl VNFaceLandmarks {
209    extern_methods!(
210        #[unsafe(method(new))]
211        #[unsafe(method_family = new)]
212        pub unsafe fn new() -> Retained<Self>;
213    );
214}
215
216extern_class!(
217    /// 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.
218    ///
219    /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vnfacelandmarks2d?language=objc)
220    #[unsafe(super(VNFaceLandmarks, NSObject))]
221    #[derive(Debug, PartialEq, Eq, Hash)]
222    pub struct VNFaceLandmarks2D;
223);
224
225extern_conformance!(
226    unsafe impl NSCoding for VNFaceLandmarks2D {}
227);
228
229extern_conformance!(
230    unsafe impl NSCopying for VNFaceLandmarks2D {}
231);
232
233unsafe impl CopyingHelper for VNFaceLandmarks2D {
234    type Result = Self;
235}
236
237extern_conformance!(
238    unsafe impl NSObjectProtocol for VNFaceLandmarks2D {}
239);
240
241extern_conformance!(
242    unsafe impl NSSecureCoding for VNFaceLandmarks2D {}
243);
244
245#[cfg(feature = "VNRequestRevisionProviding")]
246extern_conformance!(
247    unsafe impl VNRequestRevisionProviding for VNFaceLandmarks2D {}
248);
249
250impl VNFaceLandmarks2D {
251    extern_methods!(
252        /// allPoints the region containing all face landmark points.
253        #[unsafe(method(allPoints))]
254        #[unsafe(method_family = none)]
255        pub unsafe fn allPoints(&self) -> Option<Retained<VNFaceLandmarkRegion2D>>;
256
257        /// faceContour the region containing the points that describe the face contour from cheek over chin to cheek.
258        #[unsafe(method(faceContour))]
259        #[unsafe(method_family = none)]
260        pub unsafe fn faceContour(&self) -> Option<Retained<VNFaceLandmarkRegion2D>>;
261
262        /// leftEye the region containing the points describing the outline of the left eye.
263        #[unsafe(method(leftEye))]
264        #[unsafe(method_family = none)]
265        pub unsafe fn leftEye(&self) -> Option<Retained<VNFaceLandmarkRegion2D>>;
266
267        /// rightEye the region containing the points describing the outline of the right eye.
268        #[unsafe(method(rightEye))]
269        #[unsafe(method_family = none)]
270        pub unsafe fn rightEye(&self) -> Option<Retained<VNFaceLandmarkRegion2D>>;
271
272        /// leftEyebrow the region containing the points describing the trace of the left eyebrow.
273        #[unsafe(method(leftEyebrow))]
274        #[unsafe(method_family = none)]
275        pub unsafe fn leftEyebrow(&self) -> Option<Retained<VNFaceLandmarkRegion2D>>;
276
277        /// rightEyebrow the region containing the points describing the trace of the right eyebrow.
278        #[unsafe(method(rightEyebrow))]
279        #[unsafe(method_family = none)]
280        pub unsafe fn rightEyebrow(&self) -> Option<Retained<VNFaceLandmarkRegion2D>>;
281
282        /// nose the region containing the points describing the outline of the nose.
283        #[unsafe(method(nose))]
284        #[unsafe(method_family = none)]
285        pub unsafe fn nose(&self) -> Option<Retained<VNFaceLandmarkRegion2D>>;
286
287        /// noseCrest the region containing the points describing the trace of the center crest of the nose.
288        #[unsafe(method(noseCrest))]
289        #[unsafe(method_family = none)]
290        pub unsafe fn noseCrest(&self) -> Option<Retained<VNFaceLandmarkRegion2D>>;
291
292        /// medianLine the region containing the points describing the trace of the center line of the face.
293        #[unsafe(method(medianLine))]
294        #[unsafe(method_family = none)]
295        pub unsafe fn medianLine(&self) -> Option<Retained<VNFaceLandmarkRegion2D>>;
296
297        /// outer lips the region containing the points describing the outline of the outside of the lips.
298        #[unsafe(method(outerLips))]
299        #[unsafe(method_family = none)]
300        pub unsafe fn outerLips(&self) -> Option<Retained<VNFaceLandmarkRegion2D>>;
301
302        /// innerLips the region containing the points describing the outline of the space between the of the lips.
303        #[unsafe(method(innerLips))]
304        #[unsafe(method_family = none)]
305        pub unsafe fn innerLips(&self) -> Option<Retained<VNFaceLandmarkRegion2D>>;
306
307        /// leftPupil the region containing the point where the left pupil is located.  This value may be inaccurate if
308        /// the face isBlinking.
309        #[unsafe(method(leftPupil))]
310        #[unsafe(method_family = none)]
311        pub unsafe fn leftPupil(&self) -> Option<Retained<VNFaceLandmarkRegion2D>>;
312
313        /// rightPupil the region containing the point where the right pupil is located.  This value may be inaccurate if
314        /// the face isBlinking.
315        #[unsafe(method(rightPupil))]
316        #[unsafe(method_family = none)]
317        pub unsafe fn rightPupil(&self) -> Option<Retained<VNFaceLandmarkRegion2D>>;
318    );
319}
320
321/// Methods declared on superclass `VNFaceLandmarks`.
322impl VNFaceLandmarks2D {
323    extern_methods!(
324        #[unsafe(method(init))]
325        #[unsafe(method_family = init)]
326        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
327    );
328}
329
330/// Methods declared on superclass `NSObject`.
331impl VNFaceLandmarks2D {
332    extern_methods!(
333        #[unsafe(method(new))]
334        #[unsafe(method_family = new)]
335        pub unsafe fn new() -> Retained<Self>;
336    );
337}