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::*;
#[cfg(feature = "objc2-core-media")]
use objc2_core_media::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// An image registration request that will produce a homographic transformation that can morph one image to another.
    ///
    /// Because this is a stateful request, it must be performed on at least two images in order to produce an observation.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vntrackhomographicimageregistrationrequest?language=objc)
    #[unsafe(super(VNStatefulRequest, VNImageBasedRequest, VNRequest, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(all(feature = "VNRequest", feature = "VNStatefulRequest"))]
    pub struct VNTrackHomographicImageRegistrationRequest;
);

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

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

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

#[cfg(all(feature = "VNRequest", feature = "VNStatefulRequest"))]
impl VNTrackHomographicImageRegistrationRequest {
    extern_methods!(
        /// Create a new request that can statefully track the homographic registration of two images.
        ///
        /// This is a convenience initializer for a frame analysis spacing of kCMTimeZero and a nil completion handler.
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[cfg(feature = "block2")]
        /// Create a new request that can statefully track the homographic registration of two images.
        ///
        /// This is a convenience initializer for a frame analysis spacing of kCMTimeZero.
        ///
        /// # 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>;

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

/// Methods declared on superclass `VNStatefulRequest`.
#[cfg(all(feature = "VNRequest", feature = "VNStatefulRequest"))]
impl VNTrackHomographicImageRegistrationRequest {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;

        #[cfg(all(feature = "block2", feature = "objc2-core-media"))]
        /// Create a new video-based stateful request.
        ///
        ///
        /// Parameter `frameAnalysisSpacing`: The reciprocal of maximum rate at which buffers will be processed. The request will not process buffers that fall within the frameAnalysisSpacing after it has performed the analysis. The analysis is not done by wall time but by analysis of of the time stamps of the samplebuffers being processed.
        ///
        /// 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(initWithFrameAnalysisSpacing:completionHandler:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithFrameAnalysisSpacing_completionHandler(
            this: Allocated<Self>,
            frame_analysis_spacing: CMTime,
            completion_handler: VNRequestCompletionHandler,
        ) -> Retained<Self>;
    );
}

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