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")]
48unsafe impl NSCopying for VNDetectFaceLandmarksRequest {}
49
50#[cfg(feature = "VNRequest")]
51unsafe impl CopyingHelper for VNDetectFaceLandmarksRequest {
52    type Result = Self;
53}
54
55#[cfg(feature = "VNRequest")]
56unsafe impl NSObjectProtocol for VNDetectFaceLandmarksRequest {}
57
58#[cfg(all(feature = "VNFaceObservationAccepting", feature = "VNRequest"))]
59unsafe impl VNFaceObservationAccepting for VNDetectFaceLandmarksRequest {}
60
61#[cfg(feature = "VNRequest")]
62impl VNDetectFaceLandmarksRequest {
63    extern_methods!(
64        #[unsafe(method(revision:supportsConstellation:))]
65        #[unsafe(method_family = none)]
66        pub unsafe fn revision_supportsConstellation(
67            request_revision: NSUInteger,
68            constellation: VNRequestFaceLandmarksConstellation,
69        ) -> bool;
70
71        /// 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.
72        #[unsafe(method(constellation))]
73        #[unsafe(method_family = none)]
74        pub unsafe fn constellation(&self) -> VNRequestFaceLandmarksConstellation;
75
76        /// Setter for [`constellation`][Self::constellation].
77        #[unsafe(method(setConstellation:))]
78        #[unsafe(method_family = none)]
79        pub unsafe fn setConstellation(&self, constellation: VNRequestFaceLandmarksConstellation);
80
81        #[cfg(feature = "VNObservation")]
82        /// VNFaceObservation with populated landmarks-related properties results.
83        #[unsafe(method(results))]
84        #[unsafe(method_family = none)]
85        pub unsafe fn results(&self) -> Option<Retained<NSArray<VNFaceObservation>>>;
86    );
87}
88
89/// Methods declared on superclass `VNRequest`.
90#[cfg(feature = "VNRequest")]
91impl VNDetectFaceLandmarksRequest {
92    extern_methods!(
93        /// Creates a new VNRequest with no completion handler.
94        #[unsafe(method(init))]
95        #[unsafe(method_family = init)]
96        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
97
98        #[cfg(feature = "block2")]
99        /// Creates a new VNRequest with an optional completion handler.
100        ///
101        ///
102        /// 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.
103        #[unsafe(method(initWithCompletionHandler:))]
104        #[unsafe(method_family = init)]
105        pub unsafe fn initWithCompletionHandler(
106            this: Allocated<Self>,
107            completion_handler: VNRequestCompletionHandler,
108        ) -> Retained<Self>;
109    );
110}
111
112/// Methods declared on superclass `NSObject`.
113#[cfg(feature = "VNRequest")]
114impl VNDetectFaceLandmarksRequest {
115    extern_methods!(
116        #[unsafe(method(new))]
117        #[unsafe(method_family = new)]
118        pub unsafe fn new() -> Retained<Self>;
119    );
120}
121
122/// [Apple's documentation](https://developer.apple.com/documentation/vision/vndetectfacelandmarksrequestrevision1?language=objc)
123pub static VNDetectFaceLandmarksRequestRevision1: NSUInteger = 1;
124
125/// [Apple's documentation](https://developer.apple.com/documentation/vision/vndetectfacelandmarksrequestrevision2?language=objc)
126pub static VNDetectFaceLandmarksRequestRevision2: NSUInteger = 2;
127
128/// [Apple's documentation](https://developer.apple.com/documentation/vision/vndetectfacelandmarksrequestrevision3?language=objc)
129pub static VNDetectFaceLandmarksRequestRevision3: NSUInteger = 3;