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!(
    /// Detects specific landmark points on animal bodies.
    ///
    /// This request will produce a collection of VNAnimalBodyPoseObservation objects which describe the pose of each detected animal body.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vndetectanimalbodyposerequest?language=objc)
    #[unsafe(super(VNImageBasedRequest, VNRequest, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "VNRequest")]
    pub struct VNDetectAnimalBodyPoseRequest;
);

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

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

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

#[cfg(feature = "VNRequest")]
impl VNDetectAnimalBodyPoseRequest {
    extern_methods!(
        #[cfg(feature = "VNTypes")]
        /// Obtain the collection of animal body joint names that are supported by a request object configured with a request revision.
        ///
        /// Parameter `error`: The address of a variable that will be populated with an error upon failure.  If the caller does not need this information, NULL can be passed.
        ///
        /// Returns: An array of VNAnimalBodyPoseObservationJointName symbols that are supported by the request, or nil if a failure occurs.
        #[unsafe(method(supportedJointNamesAndReturnError:_))]
        #[unsafe(method_family = none)]
        pub unsafe fn supportedJointNamesAndReturnError(
            &self,
        ) -> Result<Retained<NSArray<VNAnimalBodyPoseObservationJointName>>, Retained<NSError>>;

        #[cfg(feature = "VNTypes")]
        /// Obtain the collection of animal body joints group names that are supported by a request object configured with a request revision.
        ///
        /// Parameter `error`: The address of a variable that will be populated with an error upon failure.  If the caller does not need this information, NULL can be passed.
        ///
        /// Returns: An array of VNAnimalBodyPoseObservationJointsGroupName symbols that are supported by the request, or nil if a failure occurs.
        #[unsafe(method(supportedJointsGroupNamesAndReturnError:_))]
        #[unsafe(method_family = none)]
        pub unsafe fn supportedJointsGroupNamesAndReturnError(
            &self,
        ) -> Result<Retained<NSArray<VNAnimalBodyPoseObservationJointsGroupName>>, Retained<NSError>>;

        #[cfg(feature = "VNObservation")]
        /// VNAnimalBodyPoseObservation results.
        #[unsafe(method(results))]
        #[unsafe(method_family = none)]
        pub unsafe fn results(&self) -> Option<Retained<NSArray<VNAnimalBodyPoseObservation>>>;
    );
}

/// Methods declared on superclass `VNRequest`.
#[cfg(feature = "VNRequest")]
impl VNDetectAnimalBodyPoseRequest {
    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 VNDetectAnimalBodyPoseRequest {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}

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