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