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!(
    /// VNTrackObjectRequest tracks an object in a sequence of images.
    ///
    /// The VNTrackObjectRequest is a general purpose object tracker. This tracker is used when the tracked entity does not have a special tracker, like VNTrackRectangleRequest. The VNTrackObjectRequest is initialized with VNDetectedObjectObservation that contains bounding box for the object of interest. This tracker is processed using one of the [VNSequenceRequestHandler performRequests:...] methods.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vntrackobjectrequest?language=objc)
    #[unsafe(super(VNTrackingRequest, VNImageBasedRequest, VNRequest, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(all(feature = "VNRequest", feature = "VNTrackingRequest"))]
    pub struct VNTrackObjectRequest;
);

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

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

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

#[cfg(all(feature = "VNRequest", feature = "VNTrackingRequest"))]
impl VNTrackObjectRequest {
    extern_methods!(
        #[cfg(feature = "VNObservation")]
        /// Create a new request with detected object observation.
        ///
        ///
        /// Parameter `observation`: Detected object observation with bounding box info.
        #[unsafe(method(initWithDetectedObjectObservation:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithDetectedObjectObservation(
            this: Allocated<Self>,
            observation: &VNDetectedObjectObservation,
        ) -> Retained<Self>;

        #[cfg(all(feature = "VNObservation", feature = "block2"))]
        /// Create a new request with detected object observation.
        ///
        ///
        /// Parameter `observation`: Detected object observation with bounding box info.
        ///
        /// Parameter `completionHandler`: The block that is invoked when the request has been performed.
        ///
        /// # Safety
        ///
        /// `completion_handler` must be a valid pointer or null.
        #[unsafe(method(initWithDetectedObjectObservation:completionHandler:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithDetectedObjectObservation_completionHandler(
            this: Allocated<Self>,
            observation: &VNDetectedObjectObservation,
            completion_handler: VNRequestCompletionHandler,
        ) -> Retained<Self>;

        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[cfg(feature = "block2")]
        /// # 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(all(feature = "VNRequest", feature = "VNTrackingRequest"))]
impl VNTrackObjectRequest {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}

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

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