objc2_vision/generated/
VNDetectFaceLandmarksRequest.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10/// Constellation type defines how many landmark points are used to map a face. Revisions 1, 2, and 3 support 65 points, where Rev3 also supports 76 points.
11///
12/// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vnrequestfacelandmarksconstellation?language=objc)
13// NS_ENUM
14#[repr(transparent)]
15#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
16pub struct VNRequestFaceLandmarksConstellation(pub NSUInteger);
17impl VNRequestFaceLandmarksConstellation {
18    #[doc(alias = "VNRequestFaceLandmarksConstellationNotDefined")]
19    pub const ConstellationNotDefined: Self = Self(0);
20    #[doc(alias = "VNRequestFaceLandmarksConstellation65Points")]
21    pub const Constellation65Points: Self = Self(1);
22    #[doc(alias = "VNRequestFaceLandmarksConstellation76Points")]
23    pub const Constellation76Points: Self = Self(2);
24}
25
26unsafe impl Encode for VNRequestFaceLandmarksConstellation {
27    const ENCODING: Encoding = NSUInteger::ENCODING;
28}
29
30unsafe impl RefEncode for VNRequestFaceLandmarksConstellation {
31    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
32}
33
34extern_class!(
35    /// A request that will produce face landmark information.
36    ///
37    ///
38    /// This request will generate VNFaceObservation objects with the landmarks property populated with information describing face landmarks. If VNFaceObservations are provided via the VNFaceObservationAccepting protocol without the landmarks property populated, new observations will be created as copies of the input VNFaceObservations with the landmarks property populated. If the landmarks property has already been populated, the original VNFaceObservations will be returned. If no VNFaceObservations are provided, face detection will be run first.
39    ///
40    /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vndetectfacelandmarksrequest?language=objc)
41    #[unsafe(super(VNImageBasedRequest, VNRequest, NSObject))]
42    #[derive(Debug, PartialEq, Eq, Hash)]
43    #[cfg(feature = "VNRequest")]
44    pub struct VNDetectFaceLandmarksRequest;
45);
46
47#[cfg(feature = "VNRequest")]
48extern_conformance!(
49    unsafe impl NSCopying for VNDetectFaceLandmarksRequest {}
50);
51
52#[cfg(feature = "VNRequest")]
53unsafe impl CopyingHelper for VNDetectFaceLandmarksRequest {
54    type Result = Self;
55}
56
57#[cfg(feature = "VNRequest")]
58extern_conformance!(
59    unsafe impl NSObjectProtocol for VNDetectFaceLandmarksRequest {}
60);
61
62#[cfg(all(feature = "VNFaceObservationAccepting", feature = "VNRequest"))]
63extern_conformance!(
64    unsafe impl VNFaceObservationAccepting for VNDetectFaceLandmarksRequest {}
65);
66
67#[cfg(feature = "VNRequest")]
68impl VNDetectFaceLandmarksRequest {
69    extern_methods!(
70        #[unsafe(method(revision:supportsConstellation:))]
71        #[unsafe(method_family = none)]
72        pub unsafe fn revision_supportsConstellation(
73            request_revision: NSUInteger,
74            constellation: VNRequestFaceLandmarksConstellation,
75        ) -> bool;
76
77        /// Constellation type defines how many landmark points are used to map a face. Revisions 1, 2, and 3 of the request support 65 points, where Revision 3 also supports 76 points.
78        #[unsafe(method(constellation))]
79        #[unsafe(method_family = none)]
80        pub unsafe fn constellation(&self) -> VNRequestFaceLandmarksConstellation;
81
82        /// Setter for [`constellation`][Self::constellation].
83        #[unsafe(method(setConstellation:))]
84        #[unsafe(method_family = none)]
85        pub unsafe fn setConstellation(&self, constellation: VNRequestFaceLandmarksConstellation);
86
87        #[cfg(feature = "VNObservation")]
88        /// VNFaceObservation with populated landmarks-related properties results.
89        #[unsafe(method(results))]
90        #[unsafe(method_family = none)]
91        pub unsafe fn results(&self) -> Option<Retained<NSArray<VNFaceObservation>>>;
92    );
93}
94
95/// Methods declared on superclass `VNRequest`.
96#[cfg(feature = "VNRequest")]
97impl VNDetectFaceLandmarksRequest {
98    extern_methods!(
99        /// Creates a new VNRequest with no completion handler.
100        #[unsafe(method(init))]
101        #[unsafe(method_family = init)]
102        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
103
104        #[cfg(feature = "block2")]
105        /// Creates a new VNRequest with an optional completion handler.
106        ///
107        ///
108        /// Parameter `completionHandler`: The block to be invoked after the request has completed its processing. The completion handler gets executed on the same dispatch queue as the request being executed.
109        #[unsafe(method(initWithCompletionHandler:))]
110        #[unsafe(method_family = init)]
111        pub unsafe fn initWithCompletionHandler(
112            this: Allocated<Self>,
113            completion_handler: VNRequestCompletionHandler,
114        ) -> Retained<Self>;
115    );
116}
117
118/// Methods declared on superclass `NSObject`.
119#[cfg(feature = "VNRequest")]
120impl VNDetectFaceLandmarksRequest {
121    extern_methods!(
122        #[unsafe(method(new))]
123        #[unsafe(method_family = new)]
124        pub unsafe fn new() -> Retained<Self>;
125    );
126}
127
128/// [Apple's documentation](https://developer.apple.com/documentation/vision/vndetectfacelandmarksrequestrevision1?language=objc)
129pub static VNDetectFaceLandmarksRequestRevision1: NSUInteger = 1;
130
131/// [Apple's documentation](https://developer.apple.com/documentation/vision/vndetectfacelandmarksrequestrevision2?language=objc)
132pub static VNDetectFaceLandmarksRequestRevision2: NSUInteger = 2;
133
134/// [Apple's documentation](https://developer.apple.com/documentation/vision/vndetectfacelandmarksrequestrevision3?language=objc)
135pub static VNDetectFaceLandmarksRequestRevision3: NSUInteger = 3;