//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
/// 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.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vnrequestfacelandmarksconstellation?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct VNRequestFaceLandmarksConstellation(pub NSUInteger);
impl VNRequestFaceLandmarksConstellation {
#[doc(alias = "VNRequestFaceLandmarksConstellationNotDefined")]
pub const ConstellationNotDefined: Self = Self(0);
#[doc(alias = "VNRequestFaceLandmarksConstellation65Points")]
pub const Constellation65Points: Self = Self(1);
#[doc(alias = "VNRequestFaceLandmarksConstellation76Points")]
pub const Constellation76Points: Self = Self(2);
}
unsafe impl Encode for VNRequestFaceLandmarksConstellation {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for VNRequestFaceLandmarksConstellation {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
/// A request that will produce face landmark information.
///
///
/// 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.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vndetectfacelandmarksrequest?language=objc)
#[unsafe(super(VNImageBasedRequest, VNRequest, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "VNRequest")]
pub struct VNDetectFaceLandmarksRequest;
);
#[cfg(feature = "VNRequest")]
extern_conformance!(
unsafe impl NSCopying for VNDetectFaceLandmarksRequest {}
);
#[cfg(feature = "VNRequest")]
unsafe impl CopyingHelper for VNDetectFaceLandmarksRequest {
type Result = Self;
}
#[cfg(feature = "VNRequest")]
extern_conformance!(
unsafe impl NSObjectProtocol for VNDetectFaceLandmarksRequest {}
);
#[cfg(all(feature = "VNFaceObservationAccepting", feature = "VNRequest"))]
extern_conformance!(
unsafe impl VNFaceObservationAccepting for VNDetectFaceLandmarksRequest {}
);
#[cfg(feature = "VNRequest")]
impl VNDetectFaceLandmarksRequest {
extern_methods!(
#[unsafe(method(revision:supportsConstellation:))]
#[unsafe(method_family = none)]
pub unsafe fn revision_supportsConstellation(
request_revision: NSUInteger,
constellation: VNRequestFaceLandmarksConstellation,
) -> bool;
/// 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.
#[unsafe(method(constellation))]
#[unsafe(method_family = none)]
pub unsafe fn constellation(&self) -> VNRequestFaceLandmarksConstellation;
/// Setter for [`constellation`][Self::constellation].
#[unsafe(method(setConstellation:))]
#[unsafe(method_family = none)]
pub unsafe fn setConstellation(&self, constellation: VNRequestFaceLandmarksConstellation);
#[cfg(feature = "VNObservation")]
/// VNFaceObservation with populated landmarks-related properties results.
#[unsafe(method(results))]
#[unsafe(method_family = none)]
pub unsafe fn results(&self) -> Option<Retained<NSArray<VNFaceObservation>>>;
);
}
/// Methods declared on superclass `VNRequest`.
#[cfg(feature = "VNRequest")]
impl VNDetectFaceLandmarksRequest {
extern_methods!(
/// Creates a new VNRequest with no completion handler.
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[cfg(feature = "block2")]
/// Creates a new VNRequest with an optional completion handler.
///
///
/// 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.
///
/// # Safety
///
/// `completion_handler` must be a valid pointer or null.
#[unsafe(method(initWithCompletionHandler:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCompletionHandler(
this: Allocated<Self>,
completion_handler: VNRequestCompletionHandler,
) -> Retained<Self>;
);
}
/// Methods declared on superclass `NSObject`.
#[cfg(feature = "VNRequest")]
impl VNDetectFaceLandmarksRequest {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
/// [Apple's documentation](https://developer.apple.com/documentation/vision/vndetectfacelandmarksrequestrevision1?language=objc)
#[deprecated]
pub static VNDetectFaceLandmarksRequestRevision1: NSUInteger = 1;
/// [Apple's documentation](https://developer.apple.com/documentation/vision/vndetectfacelandmarksrequestrevision2?language=objc)
pub static VNDetectFaceLandmarksRequestRevision2: NSUInteger = 2;
/// [Apple's documentation](https://developer.apple.com/documentation/vision/vndetectfacelandmarksrequestrevision3?language=objc)
pub static VNDetectFaceLandmarksRequestRevision3: NSUInteger = 3;