objc2_vision/generated/
VNTrackObjectRequest.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern_class!(
10    /// VNTrackObjectRequest tracks an object in a sequence of images.
11    ///
12    /// 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.
13    ///
14    /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vntrackobjectrequest?language=objc)
15    #[unsafe(super(VNTrackingRequest, VNImageBasedRequest, VNRequest, NSObject))]
16    #[derive(Debug, PartialEq, Eq, Hash)]
17    #[cfg(all(feature = "VNRequest", feature = "VNTrackingRequest"))]
18    pub struct VNTrackObjectRequest;
19);
20
21#[cfg(all(feature = "VNRequest", feature = "VNTrackingRequest"))]
22extern_conformance!(
23    unsafe impl NSCopying for VNTrackObjectRequest {}
24);
25
26#[cfg(all(feature = "VNRequest", feature = "VNTrackingRequest"))]
27unsafe impl CopyingHelper for VNTrackObjectRequest {
28    type Result = Self;
29}
30
31#[cfg(all(feature = "VNRequest", feature = "VNTrackingRequest"))]
32extern_conformance!(
33    unsafe impl NSObjectProtocol for VNTrackObjectRequest {}
34);
35
36#[cfg(all(feature = "VNRequest", feature = "VNTrackingRequest"))]
37impl VNTrackObjectRequest {
38    extern_methods!(
39        #[cfg(feature = "VNObservation")]
40        /// Create a new request with detected object observation.
41        ///
42        ///
43        /// Parameter `observation`: Detected object observation with bounding box info.
44        #[unsafe(method(initWithDetectedObjectObservation:))]
45        #[unsafe(method_family = init)]
46        pub unsafe fn initWithDetectedObjectObservation(
47            this: Allocated<Self>,
48            observation: &VNDetectedObjectObservation,
49        ) -> Retained<Self>;
50
51        #[cfg(all(feature = "VNObservation", feature = "block2"))]
52        /// Create a new request with detected object observation.
53        ///
54        ///
55        /// Parameter `observation`: Detected object observation with bounding box info.
56        ///
57        /// Parameter `completionHandler`: The block that is invoked when the request has been performed.
58        ///
59        /// # Safety
60        ///
61        /// `completion_handler` must be a valid pointer or null.
62        #[unsafe(method(initWithDetectedObjectObservation:completionHandler:))]
63        #[unsafe(method_family = init)]
64        pub unsafe fn initWithDetectedObjectObservation_completionHandler(
65            this: Allocated<Self>,
66            observation: &VNDetectedObjectObservation,
67            completion_handler: VNRequestCompletionHandler,
68        ) -> Retained<Self>;
69
70        #[unsafe(method(init))]
71        #[unsafe(method_family = init)]
72        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
73
74        #[cfg(feature = "block2")]
75        /// # Safety
76        ///
77        /// `completion_handler` must be a valid pointer or null.
78        #[unsafe(method(initWithCompletionHandler:))]
79        #[unsafe(method_family = init)]
80        pub unsafe fn initWithCompletionHandler(
81            this: Allocated<Self>,
82            completion_handler: VNRequestCompletionHandler,
83        ) -> Retained<Self>;
84    );
85}
86
87/// Methods declared on superclass `NSObject`.
88#[cfg(all(feature = "VNRequest", feature = "VNTrackingRequest"))]
89impl VNTrackObjectRequest {
90    extern_methods!(
91        #[unsafe(method(new))]
92        #[unsafe(method_family = new)]
93        pub unsafe fn new() -> Retained<Self>;
94    );
95}
96
97/// [Apple's documentation](https://developer.apple.com/documentation/vision/vntrackobjectrequestrevision1?language=objc)
98pub static VNTrackObjectRequestRevision1: NSUInteger = 1;
99
100/// [Apple's documentation](https://developer.apple.com/documentation/vision/vntrackobjectrequestrevision2?language=objc)
101pub static VNTrackObjectRequestRevision2: NSUInteger = 2;