objc2_vision/generated/
VNGenerateForegroundInstanceMaskRequest.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    /// A request that generates an instance mask of salient objects that can be separated from the background.
11    ///
12    /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vngenerateforegroundinstancemaskrequest?language=objc)
13    #[unsafe(super(VNImageBasedRequest, VNRequest, NSObject))]
14    #[derive(Debug, PartialEq, Eq, Hash)]
15    #[cfg(feature = "VNRequest")]
16    pub struct VNGenerateForegroundInstanceMaskRequest;
17);
18
19#[cfg(feature = "VNRequest")]
20extern_conformance!(
21    unsafe impl NSCopying for VNGenerateForegroundInstanceMaskRequest {}
22);
23
24#[cfg(feature = "VNRequest")]
25unsafe impl CopyingHelper for VNGenerateForegroundInstanceMaskRequest {
26    type Result = Self;
27}
28
29#[cfg(feature = "VNRequest")]
30extern_conformance!(
31    unsafe impl NSObjectProtocol for VNGenerateForegroundInstanceMaskRequest {}
32);
33
34#[cfg(feature = "VNRequest")]
35impl VNGenerateForegroundInstanceMaskRequest {
36    extern_methods!(
37        #[cfg(feature = "VNObservation")]
38        /// VNObservation results.
39        #[unsafe(method(results))]
40        #[unsafe(method_family = none)]
41        pub unsafe fn results(&self) -> Option<Retained<NSArray<VNInstanceMaskObservation>>>;
42    );
43}
44
45/// Methods declared on superclass `VNRequest`.
46#[cfg(feature = "VNRequest")]
47impl VNGenerateForegroundInstanceMaskRequest {
48    extern_methods!(
49        /// Creates a new VNRequest with no completion handler.
50        #[unsafe(method(init))]
51        #[unsafe(method_family = init)]
52        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
53
54        #[cfg(feature = "block2")]
55        /// Creates a new VNRequest with an optional completion handler.
56        ///
57        ///
58        /// 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.
59        #[unsafe(method(initWithCompletionHandler:))]
60        #[unsafe(method_family = init)]
61        pub unsafe fn initWithCompletionHandler(
62            this: Allocated<Self>,
63            completion_handler: VNRequestCompletionHandler,
64        ) -> Retained<Self>;
65    );
66}
67
68/// Methods declared on superclass `NSObject`.
69#[cfg(feature = "VNRequest")]
70impl VNGenerateForegroundInstanceMaskRequest {
71    extern_methods!(
72        #[unsafe(method(new))]
73        #[unsafe(method_family = new)]
74        pub unsafe fn new() -> Retained<Self>;
75    );
76}
77
78/// [Apple's documentation](https://developer.apple.com/documentation/vision/vngenerateforegroundinstancemaskrequestrevision1?language=objc)
79pub static VNGenerateForegroundInstanceMaskRequestRevision1: NSUInteger = 1;