objc2_vision/generated/
VNDetectRectanglesRequest.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 rectangles in an image.
12    ///
13    ///
14    /// This request will generate VNRectangleObservation objects describing the location of rectangles detected in an image.
15    ///
16    /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vndetectrectanglesrequest?language=objc)
17    #[unsafe(super(VNImageBasedRequest, VNRequest, NSObject))]
18    #[derive(Debug, PartialEq, Eq, Hash)]
19    #[cfg(feature = "VNRequest")]
20    pub struct VNDetectRectanglesRequest;
21);
22
23#[cfg(feature = "VNRequest")]
24unsafe impl NSCopying for VNDetectRectanglesRequest {}
25
26#[cfg(feature = "VNRequest")]
27unsafe impl CopyingHelper for VNDetectRectanglesRequest {
28    type Result = Self;
29}
30
31#[cfg(feature = "VNRequest")]
32unsafe impl NSObjectProtocol for VNDetectRectanglesRequest {}
33
34#[cfg(feature = "VNRequest")]
35impl VNDetectRectanglesRequest {
36    extern_methods!(
37        #[cfg(feature = "VNTypes")]
38        /// Specifies the minimum aspect ratio of the rectangle(s) to look for, range [0.0, 1.0], default 0.5
39        #[unsafe(method(minimumAspectRatio))]
40        #[unsafe(method_family = none)]
41        pub unsafe fn minimumAspectRatio(&self) -> VNAspectRatio;
42
43        #[cfg(feature = "VNTypes")]
44        /// Setter for [`minimumAspectRatio`][Self::minimumAspectRatio].
45        #[unsafe(method(setMinimumAspectRatio:))]
46        #[unsafe(method_family = none)]
47        pub unsafe fn setMinimumAspectRatio(&self, minimum_aspect_ratio: VNAspectRatio);
48
49        #[cfg(feature = "VNTypes")]
50        /// Specifies the maximum aspect ratio of the rectangle(s) to look for, range [0.0, 1.0], default 1.0
51        #[unsafe(method(maximumAspectRatio))]
52        #[unsafe(method_family = none)]
53        pub unsafe fn maximumAspectRatio(&self) -> VNAspectRatio;
54
55        #[cfg(feature = "VNTypes")]
56        /// Setter for [`maximumAspectRatio`][Self::maximumAspectRatio].
57        #[unsafe(method(setMaximumAspectRatio:))]
58        #[unsafe(method_family = none)]
59        pub unsafe fn setMaximumAspectRatio(&self, maximum_aspect_ratio: VNAspectRatio);
60
61        #[cfg(feature = "VNTypes")]
62        /// Specifies the maximum number of degrees a rectangle corner angle can deviate from 90 degrees, range [0,45], default 30
63        #[unsafe(method(quadratureTolerance))]
64        #[unsafe(method_family = none)]
65        pub unsafe fn quadratureTolerance(&self) -> VNDegrees;
66
67        #[cfg(feature = "VNTypes")]
68        /// Setter for [`quadratureTolerance`][Self::quadratureTolerance].
69        #[unsafe(method(setQuadratureTolerance:))]
70        #[unsafe(method_family = none)]
71        pub unsafe fn setQuadratureTolerance(&self, quadrature_tolerance: VNDegrees);
72
73        /// Specifies the minimum size of the rectangle to be detected, as a proportion of the smallest dimension, range [0.0, 1.0], default .2. Any smaller rectangles that may have been detected will not be returned.
74        #[unsafe(method(minimumSize))]
75        #[unsafe(method_family = none)]
76        pub unsafe fn minimumSize(&self) -> c_float;
77
78        /// Setter for [`minimumSize`][Self::minimumSize].
79        #[unsafe(method(setMinimumSize:))]
80        #[unsafe(method_family = none)]
81        pub unsafe fn setMinimumSize(&self, minimum_size: c_float);
82
83        #[cfg(feature = "VNTypes")]
84        /// Specifies a minimum confidence score, range [0.0, 1.0], default 0.0. Any rectangles with a lower confidence score will not be returned.
85        #[unsafe(method(minimumConfidence))]
86        #[unsafe(method_family = none)]
87        pub unsafe fn minimumConfidence(&self) -> VNConfidence;
88
89        #[cfg(feature = "VNTypes")]
90        /// Setter for [`minimumConfidence`][Self::minimumConfidence].
91        #[unsafe(method(setMinimumConfidence:))]
92        #[unsafe(method_family = none)]
93        pub unsafe fn setMinimumConfidence(&self, minimum_confidence: VNConfidence);
94
95        /// Specifies the maximum number of rectangles to be returned.  The default is 1.  Setting this property to 0 will allow an unlimited number of observations to be returned.
96        #[unsafe(method(maximumObservations))]
97        #[unsafe(method_family = none)]
98        pub unsafe fn maximumObservations(&self) -> NSUInteger;
99
100        /// Setter for [`maximumObservations`][Self::maximumObservations].
101        #[unsafe(method(setMaximumObservations:))]
102        #[unsafe(method_family = none)]
103        pub unsafe fn setMaximumObservations(&self, maximum_observations: NSUInteger);
104
105        #[cfg(feature = "VNObservation")]
106        /// VNRectangleObservation results.
107        #[unsafe(method(results))]
108        #[unsafe(method_family = none)]
109        pub unsafe fn results(&self) -> Option<Retained<NSArray<VNRectangleObservation>>>;
110    );
111}
112
113/// Methods declared on superclass `VNRequest`.
114#[cfg(feature = "VNRequest")]
115impl VNDetectRectanglesRequest {
116    extern_methods!(
117        /// Creates a new VNRequest with no completion handler.
118        #[unsafe(method(init))]
119        #[unsafe(method_family = init)]
120        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
121
122        #[cfg(feature = "block2")]
123        /// Creates a new VNRequest with an optional completion handler.
124        ///
125        ///
126        /// 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.
127        #[unsafe(method(initWithCompletionHandler:))]
128        #[unsafe(method_family = init)]
129        pub unsafe fn initWithCompletionHandler(
130            this: Allocated<Self>,
131            completion_handler: VNRequestCompletionHandler,
132        ) -> Retained<Self>;
133    );
134}
135
136/// Methods declared on superclass `NSObject`.
137#[cfg(feature = "VNRequest")]
138impl VNDetectRectanglesRequest {
139    extern_methods!(
140        #[unsafe(method(new))]
141        #[unsafe(method_family = new)]
142        pub unsafe fn new() -> Retained<Self>;
143    );
144}
145
146/// [Apple's documentation](https://developer.apple.com/documentation/vision/vndetectrectanglesrequestrevision1?language=objc)
147pub static VNDetectRectanglesRequestRevision1: NSUInteger = 1;