objc2-vision 0.3.2

Bindings to the Vision framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// A request that will produce or update a VNFaceObservation's property faceCaptureQuality with a float value.
    /// faceCaptureQuality is a float (wrapped by a NSNumber) that represents the capture quality of a given face in a photo.
    /// The float will be a value between 0 and 1, with 1 being the highest face capture quality and 0 being the lowest.
    /// If the request fails or the face observation has never been processed, the property faceCaptureQuality will be nil.
    ///
    ///
    /// This request will generate VNFaceObservation objects with the face quality variable populated with information .
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vndetectfacecapturequalityrequest?language=objc)
    #[unsafe(super(VNImageBasedRequest, VNRequest, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "VNRequest")]
    pub struct VNDetectFaceCaptureQualityRequest;
);

#[cfg(feature = "VNRequest")]
extern_conformance!(
    unsafe impl NSCopying for VNDetectFaceCaptureQualityRequest {}
);

#[cfg(feature = "VNRequest")]
unsafe impl CopyingHelper for VNDetectFaceCaptureQualityRequest {
    type Result = Self;
}

#[cfg(feature = "VNRequest")]
extern_conformance!(
    unsafe impl NSObjectProtocol for VNDetectFaceCaptureQualityRequest {}
);

#[cfg(all(feature = "VNFaceObservationAccepting", feature = "VNRequest"))]
extern_conformance!(
    unsafe impl VNFaceObservationAccepting for VNDetectFaceCaptureQualityRequest {}
);

#[cfg(feature = "VNRequest")]
impl VNDetectFaceCaptureQualityRequest {
    extern_methods!(
        #[cfg(feature = "VNObservation")]
        /// VNFaceObservation with populated faceCaptureQuality property 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 VNDetectFaceCaptureQualityRequest {
    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 VNDetectFaceCaptureQualityRequest {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}

/// [Apple's documentation](https://developer.apple.com/documentation/vision/vndetectfacecapturequalityrequestrevision1?language=objc)
pub static VNDetectFaceCaptureQualityRequestRevision1: NSUInteger = 1;

/// [Apple's documentation](https://developer.apple.com/documentation/vision/vndetectfacecapturequalityrequestrevision2?language=objc)
pub static VNDetectFaceCaptureQualityRequestRevision2: NSUInteger = 2;

/// The revision shows better correlation with human judgement on a larger and more diverse dataset. It is also more stable with respect to minor image variations.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vndetectfacecapturequalityrequestrevision3?language=objc)
pub static VNDetectFaceCaptureQualityRequestRevision3: NSUInteger = 3;