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