objc2_vision/generated/
VNTargetedImageRequest.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::*;
5#[cfg(feature = "objc2-core-graphics")]
6use objc2_core_graphics::*;
7#[cfg(feature = "objc2-core-image")]
8use objc2_core_image::*;
9#[cfg(feature = "objc2-core-media")]
10use objc2_core_media::*;
11#[cfg(feature = "objc2-core-video")]
12use objc2_core_video::*;
13use objc2_foundation::*;
14
15use crate::*;
16
17extern_class!(
18    /// A request that requires an initial image as a starting point for its work.
19    ///
20    /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vntargetedimagerequest?language=objc)
21    #[unsafe(super(VNImageBasedRequest, VNRequest, NSObject))]
22    #[derive(Debug, PartialEq, Eq, Hash)]
23    #[cfg(feature = "VNRequest")]
24    pub struct VNTargetedImageRequest;
25);
26
27#[cfg(feature = "VNRequest")]
28extern_conformance!(
29    unsafe impl NSCopying for VNTargetedImageRequest {}
30);
31
32#[cfg(feature = "VNRequest")]
33unsafe impl CopyingHelper for VNTargetedImageRequest {
34    type Result = Self;
35}
36
37#[cfg(feature = "VNRequest")]
38extern_conformance!(
39    unsafe impl NSObjectProtocol for VNTargetedImageRequest {}
40);
41
42#[cfg(feature = "VNRequest")]
43impl VNTargetedImageRequest {
44    extern_methods!(
45        #[unsafe(method(init))]
46        #[unsafe(method_family = init)]
47        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
48
49        #[cfg(feature = "block2")]
50        #[unsafe(method(initWithCompletionHandler:))]
51        #[unsafe(method_family = init)]
52        pub unsafe fn initWithCompletionHandler(
53            this: Allocated<Self>,
54            completion_handler: VNRequestCompletionHandler,
55        ) -> Retained<Self>;
56
57        #[cfg(all(feature = "VNRequestHandler", feature = "objc2-core-video"))]
58        /// Create a new request that targets an image in a pixel buffer.
59        ///
60        ///
61        /// Parameter `pixelBuffer`: The pixel buffer containing the targeted image.
62        ///
63        /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
64        #[unsafe(method(initWithTargetedCVPixelBuffer:options:))]
65        #[unsafe(method_family = init)]
66        pub unsafe fn initWithTargetedCVPixelBuffer_options(
67            this: Allocated<Self>,
68            pixel_buffer: &CVPixelBuffer,
69            options: &NSDictionary<VNImageOption, AnyObject>,
70        ) -> Retained<Self>;
71
72        #[cfg(all(
73            feature = "VNRequestHandler",
74            feature = "block2",
75            feature = "objc2-core-video"
76        ))]
77        /// Create a new request that targets an image in a pixel buffer.
78        ///
79        ///
80        /// Parameter `pixelBuffer`: The pixel buffer containing the targeted image.
81        ///
82        /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
83        ///
84        /// Parameter `completionHandler`: The block that is invoked when the request has been performed.
85        #[unsafe(method(initWithTargetedCVPixelBuffer:options:completionHandler:))]
86        #[unsafe(method_family = init)]
87        pub unsafe fn initWithTargetedCVPixelBuffer_options_completionHandler(
88            this: Allocated<Self>,
89            pixel_buffer: &CVPixelBuffer,
90            options: &NSDictionary<VNImageOption, AnyObject>,
91            completion_handler: VNRequestCompletionHandler,
92        ) -> Retained<Self>;
93
94        #[cfg(all(feature = "VNRequestHandler", feature = "objc2-core-graphics"))]
95        /// Create a new request with a targeted CGImage.
96        ///
97        ///
98        /// Parameter `cgImage`: The CGImageRef of the targeted image.
99        ///
100        /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
101        #[unsafe(method(initWithTargetedCGImage:options:))]
102        #[unsafe(method_family = init)]
103        pub unsafe fn initWithTargetedCGImage_options(
104            this: Allocated<Self>,
105            cg_image: &CGImage,
106            options: &NSDictionary<VNImageOption, AnyObject>,
107        ) -> Retained<Self>;
108
109        #[cfg(all(
110            feature = "VNRequestHandler",
111            feature = "block2",
112            feature = "objc2-core-graphics"
113        ))]
114        /// Create a new request with a targeted CGImage.
115        ///
116        ///
117        /// Parameter `cgImage`: The CGImageRef of the targeted image.
118        ///
119        /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
120        ///
121        /// Parameter `completionHandler`: The block that is invoked when the request has been performed.
122        #[unsafe(method(initWithTargetedCGImage:options:completionHandler:))]
123        #[unsafe(method_family = init)]
124        pub unsafe fn initWithTargetedCGImage_options_completionHandler(
125            this: Allocated<Self>,
126            cg_image: &CGImage,
127            options: &NSDictionary<VNImageOption, AnyObject>,
128            completion_handler: VNRequestCompletionHandler,
129        ) -> Retained<Self>;
130
131        #[cfg(all(feature = "VNRequestHandler", feature = "objc2-core-image"))]
132        /// Create a new request with a targeted CIImage.
133        ///
134        ///
135        /// Parameter `ciImage`: The CIImage of the targeted image.
136        ///
137        /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
138        #[unsafe(method(initWithTargetedCIImage:options:))]
139        #[unsafe(method_family = init)]
140        pub unsafe fn initWithTargetedCIImage_options(
141            this: Allocated<Self>,
142            ci_image: &CIImage,
143            options: &NSDictionary<VNImageOption, AnyObject>,
144        ) -> Retained<Self>;
145
146        #[cfg(all(
147            feature = "VNRequestHandler",
148            feature = "block2",
149            feature = "objc2-core-image"
150        ))]
151        /// Create a new request with a targeted CIImage.
152        ///
153        ///
154        /// Parameter `ciImage`: The CIImage of the targeted image.
155        ///
156        /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
157        ///
158        /// Parameter `completionHandler`: The block that is invoked when the request has been performed.
159        #[unsafe(method(initWithTargetedCIImage:options:completionHandler:))]
160        #[unsafe(method_family = init)]
161        pub unsafe fn initWithTargetedCIImage_options_completionHandler(
162            this: Allocated<Self>,
163            ci_image: &CIImage,
164            options: &NSDictionary<VNImageOption, AnyObject>,
165            completion_handler: VNRequestCompletionHandler,
166        ) -> Retained<Self>;
167
168        #[cfg(feature = "VNRequestHandler")]
169        /// Create a new request with a targeted image URL.
170        ///
171        ///
172        /// Parameter `imageURL`: The URL of the targeted image.
173        ///
174        /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
175        #[unsafe(method(initWithTargetedImageURL:options:))]
176        #[unsafe(method_family = init)]
177        pub unsafe fn initWithTargetedImageURL_options(
178            this: Allocated<Self>,
179            image_url: &NSURL,
180            options: &NSDictionary<VNImageOption, AnyObject>,
181        ) -> Retained<Self>;
182
183        #[cfg(all(feature = "VNRequestHandler", feature = "block2"))]
184        /// Create a new request with a targeted image URL.
185        ///
186        ///
187        /// Parameter `imageURL`: The URL of the targeted image.
188        ///
189        /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
190        ///
191        /// Parameter `completionHandler`: The block that is invoked when the request has been performed.
192        #[unsafe(method(initWithTargetedImageURL:options:completionHandler:))]
193        #[unsafe(method_family = init)]
194        pub unsafe fn initWithTargetedImageURL_options_completionHandler(
195            this: Allocated<Self>,
196            image_url: &NSURL,
197            options: &NSDictionary<VNImageOption, AnyObject>,
198            completion_handler: VNRequestCompletionHandler,
199        ) -> Retained<Self>;
200
201        #[cfg(feature = "VNRequestHandler")]
202        /// Create a new request with a targeted image data.
203        ///
204        ///
205        /// Parameter `imageData`: The data of the targeted image.
206        ///
207        /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
208        #[unsafe(method(initWithTargetedImageData:options:))]
209        #[unsafe(method_family = init)]
210        pub unsafe fn initWithTargetedImageData_options(
211            this: Allocated<Self>,
212            image_data: &NSData,
213            options: &NSDictionary<VNImageOption, AnyObject>,
214        ) -> Retained<Self>;
215
216        #[cfg(all(feature = "VNRequestHandler", feature = "block2"))]
217        /// Create a new request with a targeted image data.
218        ///
219        ///
220        /// Parameter `imageData`: The data of the targeted image.
221        ///
222        /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
223        ///
224        /// Parameter `completionHandler`: The block that is invoked when the request has been performed.
225        #[unsafe(method(initWithTargetedImageData:options:completionHandler:))]
226        #[unsafe(method_family = init)]
227        pub unsafe fn initWithTargetedImageData_options_completionHandler(
228            this: Allocated<Self>,
229            image_data: &NSData,
230            options: &NSDictionary<VNImageOption, AnyObject>,
231            completion_handler: VNRequestCompletionHandler,
232        ) -> Retained<Self>;
233
234        #[cfg(all(feature = "VNRequestHandler", feature = "objc2-core-media"))]
235        /// Create a new request with a targeted CMSampleBuffer.
236        ///
237        ///
238        /// Parameter `sampleBuffer`: The CMSampleBuffer containing the CVImageBuffer to be used by the request.
239        ///
240        /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
241        #[unsafe(method(initWithTargetedCMSampleBuffer:options:))]
242        #[unsafe(method_family = init)]
243        pub unsafe fn initWithTargetedCMSampleBuffer_options(
244            this: Allocated<Self>,
245            sample_buffer: &CMSampleBuffer,
246            options: &NSDictionary<VNImageOption, AnyObject>,
247        ) -> Retained<Self>;
248
249        #[cfg(all(
250            feature = "VNRequestHandler",
251            feature = "block2",
252            feature = "objc2-core-media"
253        ))]
254        /// Create a new request with a targeted CMSampleBuffer.
255        ///
256        ///
257        /// Parameter `sampleBuffer`: The CMSampleBuffer containing the CVImageBuffer to be used by the request.
258        ///
259        /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
260        ///
261        /// Parameter `completionHandler`: The block that is invoked after the request has been performed.
262        #[unsafe(method(initWithTargetedCMSampleBuffer:options:completionHandler:))]
263        #[unsafe(method_family = init)]
264        pub unsafe fn initWithTargetedCMSampleBuffer_options_completionHandler(
265            this: Allocated<Self>,
266            sample_buffer: &CMSampleBuffer,
267            options: &NSDictionary<VNImageOption, AnyObject>,
268            completion_handler: VNRequestCompletionHandler,
269        ) -> Retained<Self>;
270    );
271}
272
273/// Methods declared on superclass `NSObject`.
274#[cfg(feature = "VNRequest")]
275impl VNTargetedImageRequest {
276    extern_methods!(
277        #[unsafe(method(new))]
278        #[unsafe(method_family = new)]
279        pub unsafe fn new() -> Retained<Self>;
280    );
281}