objc2_vision/generated/
VNDetectTextRectanglesRequest.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 regions of text in an image.
12    ///
13    ///
14    /// This request will generate VNTextObservation objects describing the locations of text detected in an image.
15    ///
16    /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vndetecttextrectanglesrequest?language=objc)
17    #[unsafe(super(VNImageBasedRequest, VNRequest, NSObject))]
18    #[derive(Debug, PartialEq, Eq, Hash)]
19    #[cfg(feature = "VNRequest")]
20    pub struct VNDetectTextRectanglesRequest;
21);
22
23#[cfg(feature = "VNRequest")]
24extern_conformance!(
25    unsafe impl NSCopying for VNDetectTextRectanglesRequest {}
26);
27
28#[cfg(feature = "VNRequest")]
29unsafe impl CopyingHelper for VNDetectTextRectanglesRequest {
30    type Result = Self;
31}
32
33#[cfg(feature = "VNRequest")]
34extern_conformance!(
35    unsafe impl NSObjectProtocol for VNDetectTextRectanglesRequest {}
36);
37
38#[cfg(feature = "VNRequest")]
39impl VNDetectTextRectanglesRequest {
40    extern_methods!(
41        /// Specify whether or not the bounding boxes of individual characters should also be returned in the resultant VNTextObservations. Default is NO.
42        #[unsafe(method(reportCharacterBoxes))]
43        #[unsafe(method_family = none)]
44        pub unsafe fn reportCharacterBoxes(&self) -> bool;
45
46        /// Setter for [`reportCharacterBoxes`][Self::reportCharacterBoxes].
47        #[unsafe(method(setReportCharacterBoxes:))]
48        #[unsafe(method_family = none)]
49        pub unsafe fn setReportCharacterBoxes(&self, report_character_boxes: bool);
50
51        #[cfg(feature = "VNObservation")]
52        /// VNTextObservation results.
53        #[unsafe(method(results))]
54        #[unsafe(method_family = none)]
55        pub unsafe fn results(&self) -> Option<Retained<NSArray<VNTextObservation>>>;
56    );
57}
58
59/// Methods declared on superclass `VNRequest`.
60#[cfg(feature = "VNRequest")]
61impl VNDetectTextRectanglesRequest {
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 VNDetectTextRectanglesRequest {
85    extern_methods!(
86        #[unsafe(method(new))]
87        #[unsafe(method_family = new)]
88        pub unsafe fn new() -> Retained<Self>;
89    );
90}
91
92/// [Apple's documentation](https://developer.apple.com/documentation/vision/vndetecttextrectanglesrequestrevision1?language=objc)
93pub static VNDetectTextRectanglesRequestRevision1: NSUInteger = 1;