objc2_vision/generated/
VNTrackRectangleRequest.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    /// VNTrackRectangleRequest tracks a rectangle in a sequence of images.
11    ///
12    /// The VNTrackRectangleRequest is a special tracker to track rectangular shape objects. The VNTrackRectangleRequest is initialized with a VNRectangleObservation object that contains a rectangle bounding box and four corners locations. VNRectangleObservation can be obtained by running rectangle detector  (VNDetectRectanglesRequest). The VNTrackRectangleRequest is processed using one of the [VNSequenceRequestHandler performRequests:...] methods.
13    ///
14    /// Note: The rectangular object doesn't have to look like a rectangle when projected into the plane of the image of interest. For example, it may look like trapezoid.
15    ///
16    /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vntrackrectanglerequest?language=objc)
17    #[unsafe(super(VNTrackingRequest, VNImageBasedRequest, VNRequest, NSObject))]
18    #[derive(Debug, PartialEq, Eq, Hash)]
19    #[cfg(all(feature = "VNRequest", feature = "VNTrackingRequest"))]
20    pub struct VNTrackRectangleRequest;
21);
22
23#[cfg(all(feature = "VNRequest", feature = "VNTrackingRequest"))]
24extern_conformance!(
25    unsafe impl NSCopying for VNTrackRectangleRequest {}
26);
27
28#[cfg(all(feature = "VNRequest", feature = "VNTrackingRequest"))]
29unsafe impl CopyingHelper for VNTrackRectangleRequest {
30    type Result = Self;
31}
32
33#[cfg(all(feature = "VNRequest", feature = "VNTrackingRequest"))]
34extern_conformance!(
35    unsafe impl NSObjectProtocol for VNTrackRectangleRequest {}
36);
37
38#[cfg(all(feature = "VNRequest", feature = "VNTrackingRequest"))]
39impl VNTrackRectangleRequest {
40    extern_methods!(
41        #[cfg(feature = "VNObservation")]
42        /// Create a new rectangle tracking request with rectangle observation.
43        ///
44        ///
45        /// Parameter `observation`: Rectangle observation with bounding box and rectangle corners location info.
46        #[unsafe(method(initWithRectangleObservation:))]
47        #[unsafe(method_family = init)]
48        pub unsafe fn initWithRectangleObservation(
49            this: Allocated<Self>,
50            observation: &VNRectangleObservation,
51        ) -> Retained<Self>;
52
53        #[cfg(all(feature = "VNObservation", feature = "block2"))]
54        /// Create a new rectangle tracking request with rectangle observation.
55        ///
56        ///
57        /// Parameter `observation`: Rectangle observation with bounding box and rectangle corners location info.
58        ///
59        /// Parameter `completionHandler`: The block that is invoked when the request has been performed.
60        ///
61        /// # Safety
62        ///
63        /// `completion_handler` must be a valid pointer or null.
64        #[unsafe(method(initWithRectangleObservation:completionHandler:))]
65        #[unsafe(method_family = init)]
66        pub unsafe fn initWithRectangleObservation_completionHandler(
67            this: Allocated<Self>,
68            observation: &VNRectangleObservation,
69            completion_handler: VNRequestCompletionHandler,
70        ) -> Retained<Self>;
71
72        #[unsafe(method(init))]
73        #[unsafe(method_family = init)]
74        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
75
76        #[cfg(feature = "block2")]
77        /// # Safety
78        ///
79        /// `completion_handler` must be a valid pointer or null.
80        #[unsafe(method(initWithCompletionHandler:))]
81        #[unsafe(method_family = init)]
82        pub unsafe fn initWithCompletionHandler(
83            this: Allocated<Self>,
84            completion_handler: VNRequestCompletionHandler,
85        ) -> Retained<Self>;
86    );
87}
88
89/// Methods declared on superclass `NSObject`.
90#[cfg(all(feature = "VNRequest", feature = "VNTrackingRequest"))]
91impl VNTrackRectangleRequest {
92    extern_methods!(
93        #[unsafe(method(new))]
94        #[unsafe(method_family = new)]
95        pub unsafe fn new() -> Retained<Self>;
96    );
97}
98
99/// [Apple's documentation](https://developer.apple.com/documentation/vision/vntrackrectanglerequestrevision1?language=objc)
100pub static VNTrackRectangleRequestRevision1: NSUInteger = 1;