objc2_vision/generated/
VNDetectHumanRectanglesRequest.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// A request that will detect human Torsos in an image.
12    ///
13    ///
14    /// This request will generate VNHumanObservation objects with defined boundingBox and confidence score.
15    ///
16    /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vndetecthumanrectanglesrequest?language=objc)
17    #[unsafe(super(VNImageBasedRequest, VNRequest, NSObject))]
18    #[derive(Debug, PartialEq, Eq, Hash)]
19    #[cfg(feature = "VNRequest")]
20    pub struct VNDetectHumanRectanglesRequest;
21);
22
23#[cfg(feature = "VNRequest")]
24unsafe impl NSCopying for VNDetectHumanRectanglesRequest {}
25
26#[cfg(feature = "VNRequest")]
27unsafe impl CopyingHelper for VNDetectHumanRectanglesRequest {
28    type Result = Self;
29}
30
31#[cfg(feature = "VNRequest")]
32unsafe impl NSObjectProtocol for VNDetectHumanRectanglesRequest {}
33
34#[cfg(feature = "VNRequest")]
35impl VNDetectHumanRectanglesRequest {
36    extern_methods!(
37        /// Boolean property to specify whether the human upper body or full body needs to be detected. The default is YES, meaning the request is setup to detect upper body only
38        #[unsafe(method(upperBodyOnly))]
39        #[unsafe(method_family = none)]
40        pub unsafe fn upperBodyOnly(&self) -> bool;
41
42        /// Setter for [`upperBodyOnly`][Self::upperBodyOnly].
43        #[unsafe(method(setUpperBodyOnly:))]
44        #[unsafe(method_family = none)]
45        pub unsafe fn setUpperBodyOnly(&self, upper_body_only: bool);
46
47        #[cfg(feature = "VNObservation")]
48        /// VNHumanObservation results.
49        #[unsafe(method(results))]
50        #[unsafe(method_family = none)]
51        pub unsafe fn results(&self) -> Option<Retained<NSArray<VNHumanObservation>>>;
52    );
53}
54
55/// Methods declared on superclass `VNRequest`.
56#[cfg(feature = "VNRequest")]
57impl VNDetectHumanRectanglesRequest {
58    extern_methods!(
59        /// Creates a new VNRequest with no completion handler.
60        #[unsafe(method(init))]
61        #[unsafe(method_family = init)]
62        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
63
64        #[cfg(feature = "block2")]
65        /// Creates a new VNRequest with an optional completion handler.
66        ///
67        ///
68        /// 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.
69        #[unsafe(method(initWithCompletionHandler:))]
70        #[unsafe(method_family = init)]
71        pub unsafe fn initWithCompletionHandler(
72            this: Allocated<Self>,
73            completion_handler: VNRequestCompletionHandler,
74        ) -> Retained<Self>;
75    );
76}
77
78/// Methods declared on superclass `NSObject`.
79#[cfg(feature = "VNRequest")]
80impl VNDetectHumanRectanglesRequest {
81    extern_methods!(
82        #[unsafe(method(new))]
83        #[unsafe(method_family = new)]
84        pub unsafe fn new() -> Retained<Self>;
85    );
86}
87
88/// This request revsion can detect human upper body only
89///
90/// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vndetecthumanrectanglesrequestrevision1?language=objc)
91pub static VNDetectHumanRectanglesRequestRevision1: NSUInteger = 1;
92
93/// This request revsion can detect human full body in addition to upper body only in the previous revision. The choice is controlled by [VNDetectHumanRectanglesRequest -upperBodyOnly] property, which is by default set to YES
94///
95/// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vndetecthumanrectanglesrequestrevision2?language=objc)
96pub static VNDetectHumanRectanglesRequestRevision2: NSUInteger = 2;