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")]
24extern_conformance!(
25    unsafe impl NSCopying for VNDetectHumanRectanglesRequest {}
26);
27
28#[cfg(feature = "VNRequest")]
29unsafe impl CopyingHelper for VNDetectHumanRectanglesRequest {
30    type Result = Self;
31}
32
33#[cfg(feature = "VNRequest")]
34extern_conformance!(
35    unsafe impl NSObjectProtocol for VNDetectHumanRectanglesRequest {}
36);
37
38#[cfg(feature = "VNRequest")]
39impl VNDetectHumanRectanglesRequest {
40    extern_methods!(
41        /// 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
42        #[unsafe(method(upperBodyOnly))]
43        #[unsafe(method_family = none)]
44        pub unsafe fn upperBodyOnly(&self) -> bool;
45
46        /// Setter for [`upperBodyOnly`][Self::upperBodyOnly].
47        #[unsafe(method(setUpperBodyOnly:))]
48        #[unsafe(method_family = none)]
49        pub unsafe fn setUpperBodyOnly(&self, upper_body_only: bool);
50
51        #[cfg(feature = "VNObservation")]
52        /// VNHumanObservation results.
53        #[unsafe(method(results))]
54        #[unsafe(method_family = none)]
55        pub unsafe fn results(&self) -> Option<Retained<NSArray<VNHumanObservation>>>;
56    );
57}
58
59/// Methods declared on superclass `VNRequest`.
60#[cfg(feature = "VNRequest")]
61impl VNDetectHumanRectanglesRequest {
62    extern_methods!(
63        /// Creates a new VNRequest with no completion handler.
64        #[unsafe(method(init))]
65        #[unsafe(method_family = init)]
66        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
67
68        #[cfg(feature = "block2")]
69        /// Creates a new VNRequest with an optional completion handler.
70        ///
71        ///
72        /// 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.
73        #[unsafe(method(initWithCompletionHandler:))]
74        #[unsafe(method_family = init)]
75        pub unsafe fn initWithCompletionHandler(
76            this: Allocated<Self>,
77            completion_handler: VNRequestCompletionHandler,
78        ) -> Retained<Self>;
79    );
80}
81
82/// Methods declared on superclass `NSObject`.
83#[cfg(feature = "VNRequest")]
84impl VNDetectHumanRectanglesRequest {
85    extern_methods!(
86        #[unsafe(method(new))]
87        #[unsafe(method_family = new)]
88        pub unsafe fn new() -> Retained<Self>;
89    );
90}
91
92/// This request revsion can detect human upper body only
93///
94/// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vndetecthumanrectanglesrequestrevision1?language=objc)
95pub static VNDetectHumanRectanglesRequestRevision1: NSUInteger = 1;
96
97/// 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
98///
99/// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vndetecthumanrectanglesrequestrevision2?language=objc)
100pub static VNDetectHumanRectanglesRequestRevision2: NSUInteger = 2;