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")]
23extern_conformance!(
24    unsafe impl NSCopying for VNDetectHorizonRequest {}
25);
26
27#[cfg(feature = "VNRequest")]
28unsafe impl CopyingHelper for VNDetectHorizonRequest {
29    type Result = Self;
30}
31
32#[cfg(feature = "VNRequest")]
33extern_conformance!(
34    unsafe impl NSObjectProtocol for VNDetectHorizonRequest {}
35);
36
37#[cfg(feature = "VNRequest")]
38impl VNDetectHorizonRequest {
39    extern_methods!(
40        #[cfg(feature = "VNObservation")]
41        /// VNHorizonObservation results.
42        #[unsafe(method(results))]
43        #[unsafe(method_family = none)]
44        pub unsafe fn results(&self) -> Option<Retained<NSArray<VNHorizonObservation>>>;
45    );
46}
47
48/// Methods declared on superclass `VNRequest`.
49#[cfg(feature = "VNRequest")]
50impl VNDetectHorizonRequest {
51    extern_methods!(
52        /// Creates a new VNRequest with no completion handler.
53        #[unsafe(method(init))]
54        #[unsafe(method_family = init)]
55        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
56
57        #[cfg(feature = "block2")]
58        /// Creates a new VNRequest with an optional completion handler.
59        ///
60        ///
61        /// 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.
62        #[unsafe(method(initWithCompletionHandler:))]
63        #[unsafe(method_family = init)]
64        pub unsafe fn initWithCompletionHandler(
65            this: Allocated<Self>,
66            completion_handler: VNRequestCompletionHandler,
67        ) -> Retained<Self>;
68    );
69}
70
71/// Methods declared on superclass `NSObject`.
72#[cfg(feature = "VNRequest")]
73impl VNDetectHorizonRequest {
74    extern_methods!(
75        #[unsafe(method(new))]
76        #[unsafe(method_family = new)]
77        pub unsafe fn new() -> Retained<Self>;
78    );
79}
80
81/// [Apple's documentation](https://developer.apple.com/documentation/vision/vndetecthorizonrequestrevision1?language=objc)
82pub static VNDetectHorizonRequestRevision1: NSUInteger = 1;