1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-image")]
use objc2_core_image::*;
use objc2_foundation::*;

use crate::*;

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct VNGenerateOpticalFlowRequestComputationAccuracy(pub NSUInteger);
impl VNGenerateOpticalFlowRequestComputationAccuracy {
    #[doc(alias = "VNGenerateOpticalFlowRequestComputationAccuracyLow")]
    pub const Low: Self = Self(0);
    #[doc(alias = "VNGenerateOpticalFlowRequestComputationAccuracyMedium")]
    pub const Medium: Self = Self(1);
    #[doc(alias = "VNGenerateOpticalFlowRequestComputationAccuracyHigh")]
    pub const High: Self = Self(2);
    #[doc(alias = "VNGenerateOpticalFlowRequestComputationAccuracyVeryHigh")]
    pub const VeryHigh: Self = Self(3);
}

unsafe impl Encode for VNGenerateOpticalFlowRequestComputationAccuracy {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

unsafe impl RefEncode for VNGenerateOpticalFlowRequestComputationAccuracy {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(all(feature = "VNRequest", feature = "VNTargetedImageRequest"))]
    pub struct VNGenerateOpticalFlowRequest;

    #[cfg(all(feature = "VNRequest", feature = "VNTargetedImageRequest"))]
    unsafe impl ClassType for VNGenerateOpticalFlowRequest {
        #[inherits(VNImageBasedRequest, VNRequest, NSObject)]
        type Super = VNTargetedImageRequest;
        type Mutability = InteriorMutable;
    }
);

#[cfg(all(feature = "VNRequest", feature = "VNTargetedImageRequest"))]
unsafe impl NSCopying for VNGenerateOpticalFlowRequest {}

#[cfg(all(feature = "VNRequest", feature = "VNTargetedImageRequest"))]
unsafe impl NSObjectProtocol for VNGenerateOpticalFlowRequest {}

extern_methods!(
    #[cfg(all(feature = "VNRequest", feature = "VNTargetedImageRequest"))]
    unsafe impl VNGenerateOpticalFlowRequest {
        #[method(computationAccuracy)]
        pub unsafe fn computationAccuracy(&self)
            -> VNGenerateOpticalFlowRequestComputationAccuracy;

        #[method(setComputationAccuracy:)]
        pub unsafe fn setComputationAccuracy(
            &self,
            computation_accuracy: VNGenerateOpticalFlowRequestComputationAccuracy,
        );

        #[method(outputPixelFormat)]
        pub unsafe fn outputPixelFormat(&self) -> OSType;

        #[method(setOutputPixelFormat:)]
        pub unsafe fn setOutputPixelFormat(&self, output_pixel_format: OSType);

        #[method(keepNetworkOutput)]
        pub unsafe fn keepNetworkOutput(&self) -> bool;

        #[method(setKeepNetworkOutput:)]
        pub unsafe fn setKeepNetworkOutput(&self, keep_network_output: bool);

        #[cfg(feature = "VNObservation")]
        #[method_id(@__retain_semantics Other results)]
        pub unsafe fn results(&self) -> Option<Retained<NSArray<VNPixelBufferObservation>>>;
    }
);

extern_methods!(
    /// Methods declared on superclass `VNTargetedImageRequest`
    #[cfg(all(feature = "VNRequest", feature = "VNTargetedImageRequest"))]
    unsafe impl VNGenerateOpticalFlowRequest {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[cfg(feature = "block2")]
        #[method_id(@__retain_semantics Init initWithCompletionHandler:)]
        pub unsafe fn initWithCompletionHandler(
            this: Allocated<Self>,
            completion_handler: VNRequestCompletionHandler,
        ) -> Retained<Self>;

        #[cfg(all(feature = "VNRequestHandler", feature = "objc2-core-image"))]
        #[method_id(@__retain_semantics Init initWithTargetedCIImage:options:)]
        pub unsafe fn initWithTargetedCIImage_options(
            this: Allocated<Self>,
            ci_image: &CIImage,
            options: &NSDictionary<VNImageOption, AnyObject>,
        ) -> Retained<Self>;

        #[cfg(all(
            feature = "VNRequestHandler",
            feature = "block2",
            feature = "objc2-core-image"
        ))]
        #[method_id(@__retain_semantics Init initWithTargetedCIImage:options:completionHandler:)]
        pub unsafe fn initWithTargetedCIImage_options_completionHandler(
            this: Allocated<Self>,
            ci_image: &CIImage,
            options: &NSDictionary<VNImageOption, AnyObject>,
            completion_handler: VNRequestCompletionHandler,
        ) -> Retained<Self>;

        #[cfg(feature = "VNRequestHandler")]
        #[method_id(@__retain_semantics Init initWithTargetedImageURL:options:)]
        pub unsafe fn initWithTargetedImageURL_options(
            this: Allocated<Self>,
            image_url: &NSURL,
            options: &NSDictionary<VNImageOption, AnyObject>,
        ) -> Retained<Self>;

        #[cfg(all(feature = "VNRequestHandler", feature = "block2"))]
        #[method_id(@__retain_semantics Init initWithTargetedImageURL:options:completionHandler:)]
        pub unsafe fn initWithTargetedImageURL_options_completionHandler(
            this: Allocated<Self>,
            image_url: &NSURL,
            options: &NSDictionary<VNImageOption, AnyObject>,
            completion_handler: VNRequestCompletionHandler,
        ) -> Retained<Self>;

        #[cfg(feature = "VNRequestHandler")]
        #[method_id(@__retain_semantics Init initWithTargetedImageData:options:)]
        pub unsafe fn initWithTargetedImageData_options(
            this: Allocated<Self>,
            image_data: &NSData,
            options: &NSDictionary<VNImageOption, AnyObject>,
        ) -> Retained<Self>;

        #[cfg(all(feature = "VNRequestHandler", feature = "block2"))]
        #[method_id(@__retain_semantics Init initWithTargetedImageData:options:completionHandler:)]
        pub unsafe fn initWithTargetedImageData_options_completionHandler(
            this: Allocated<Self>,
            image_data: &NSData,
            options: &NSDictionary<VNImageOption, AnyObject>,
            completion_handler: VNRequestCompletionHandler,
        ) -> Retained<Self>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    #[cfg(all(feature = "VNRequest", feature = "VNTargetedImageRequest"))]
    unsafe impl VNGenerateOpticalFlowRequest {
        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Retained<Self>;
    }
);

pub static VNGenerateOpticalFlowRequestRevision1: NSUInteger = 1;

pub static VNGenerateOpticalFlowRequestRevision2: NSUInteger = 2;