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