objc2_vision/generated/
VNDetectHorizonRequest.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern_class!(
10    /// Determine what the horizon tilt of an image is.
11    ///
12    ///
13    /// If the horizon tilt is detected in an image, the request will provide a VNHorizonObservation in the results which describe how to transform the image so that the horizon line becomes level.
14    ///
15    /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vndetecthorizonrequest?language=objc)
16    #[unsafe(super(VNImageBasedRequest, VNRequest, NSObject))]
17    #[derive(Debug, PartialEq, Eq, Hash)]
18    #[cfg(feature = "VNRequest")]
19    pub struct VNDetectHorizonRequest;
20);
21
22#[cfg(feature = "VNRequest")]
23unsafe impl NSCopying for VNDetectHorizonRequest {}
24
25#[cfg(feature = "VNRequest")]
26unsafe impl CopyingHelper for VNDetectHorizonRequest {
27    type Result = Self;
28}
29
30#[cfg(feature = "VNRequest")]
31unsafe impl NSObjectProtocol for VNDetectHorizonRequest {}
32
33#[cfg(feature = "VNRequest")]
34impl VNDetectHorizonRequest {
35    extern_methods!(
36        #[cfg(feature = "VNObservation")]
37        /// VNHorizonObservation results.
38        #[unsafe(method(results))]
39        #[unsafe(method_family = none)]
40        pub unsafe fn results(&self) -> Option<Retained<NSArray<VNHorizonObservation>>>;
41    );
42}
43
44/// Methods declared on superclass `VNRequest`.
45#[cfg(feature = "VNRequest")]
46impl VNDetectHorizonRequest {
47    extern_methods!(
48        /// Creates a new VNRequest with no completion handler.
49        #[unsafe(method(init))]
50        #[unsafe(method_family = init)]
51        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
52
53        #[cfg(feature = "block2")]
54        /// Creates a new VNRequest with an optional completion handler.
55        ///
56        ///
57        /// 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.
58        #[unsafe(method(initWithCompletionHandler:))]
59        #[unsafe(method_family = init)]
60        pub unsafe fn initWithCompletionHandler(
61            this: Allocated<Self>,
62            completion_handler: VNRequestCompletionHandler,
63        ) -> Retained<Self>;
64    );
65}
66
67/// Methods declared on superclass `NSObject`.
68#[cfg(feature = "VNRequest")]
69impl VNDetectHorizonRequest {
70    extern_methods!(
71        #[unsafe(method(new))]
72        #[unsafe(method_family = new)]
73        pub unsafe fn new() -> Retained<Self>;
74    );
75}
76
77/// [Apple's documentation](https://developer.apple.com/documentation/vision/vndetecthorizonrequestrevision1?language=objc)
78pub static VNDetectHorizonRequestRevision1: NSUInteger = 1;