objc2_vision/generated/VNImageRegistrationRequest.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#[cfg(feature = "objc2-image-io")]
15use objc2_image_io::*;
16
17use crate::*;
18
19extern_class!(
20 /// A request that will calculate a transformation for morphing a "floating" image onto an unchanging "reference" image.
21 ///
22 ///
23 /// The request is created with the targeted image acting as the floating image. Processing the request will calculate the transformations that morph the floating image onto the reference image.
24 ///
25 /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vnimageregistrationrequest?language=objc)
26 #[unsafe(super(VNTargetedImageRequest, VNImageBasedRequest, VNRequest, NSObject))]
27 #[derive(Debug, PartialEq, Eq, Hash)]
28 #[cfg(all(feature = "VNRequest", feature = "VNTargetedImageRequest"))]
29 pub struct VNImageRegistrationRequest;
30);
31
32#[cfg(all(feature = "VNRequest", feature = "VNTargetedImageRequest"))]
33extern_conformance!(
34 unsafe impl NSCopying for VNImageRegistrationRequest {}
35);
36
37#[cfg(all(feature = "VNRequest", feature = "VNTargetedImageRequest"))]
38unsafe impl CopyingHelper for VNImageRegistrationRequest {
39 type Result = Self;
40}
41
42#[cfg(all(feature = "VNRequest", feature = "VNTargetedImageRequest"))]
43extern_conformance!(
44 unsafe impl NSObjectProtocol for VNImageRegistrationRequest {}
45);
46
47#[cfg(all(feature = "VNRequest", feature = "VNTargetedImageRequest"))]
48impl VNImageRegistrationRequest {
49 extern_methods!();
50}
51
52/// Methods declared on superclass `VNTargetedImageRequest`.
53#[cfg(all(feature = "VNRequest", feature = "VNTargetedImageRequest"))]
54impl VNImageRegistrationRequest {
55 extern_methods!(
56 #[unsafe(method(init))]
57 #[unsafe(method_family = init)]
58 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
59
60 #[cfg(feature = "block2")]
61 /// # Safety
62 ///
63 /// `completion_handler` must be a valid pointer or null.
64 #[unsafe(method(initWithCompletionHandler:))]
65 #[unsafe(method_family = init)]
66 pub unsafe fn initWithCompletionHandler(
67 this: Allocated<Self>,
68 completion_handler: VNRequestCompletionHandler,
69 ) -> Retained<Self>;
70
71 #[cfg(all(feature = "VNRequestHandler", feature = "objc2-core-video"))]
72 /// Create a new request that targets an image in a pixel buffer.
73 ///
74 ///
75 /// Parameter `pixelBuffer`: The pixel buffer containing the targeted image.
76 ///
77 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
78 ///
79 /// # Safety
80 ///
81 /// `options` generic should be of the correct type.
82 #[unsafe(method(initWithTargetedCVPixelBuffer:options:))]
83 #[unsafe(method_family = init)]
84 pub unsafe fn initWithTargetedCVPixelBuffer_options(
85 this: Allocated<Self>,
86 pixel_buffer: &CVPixelBuffer,
87 options: &NSDictionary<VNImageOption, AnyObject>,
88 ) -> Retained<Self>;
89
90 #[cfg(all(
91 feature = "VNRequestHandler",
92 feature = "block2",
93 feature = "objc2-core-video"
94 ))]
95 /// Create a new request that targets an image in a pixel buffer.
96 ///
97 ///
98 /// Parameter `pixelBuffer`: The pixel buffer containing the targeted image.
99 ///
100 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
101 ///
102 /// Parameter `completionHandler`: The block that is invoked when the request has been performed.
103 ///
104 /// # Safety
105 ///
106 /// - `options` generic should be of the correct type.
107 /// - `completion_handler` must be a valid pointer or null.
108 #[unsafe(method(initWithTargetedCVPixelBuffer:options:completionHandler:))]
109 #[unsafe(method_family = init)]
110 pub unsafe fn initWithTargetedCVPixelBuffer_options_completionHandler(
111 this: Allocated<Self>,
112 pixel_buffer: &CVPixelBuffer,
113 options: &NSDictionary<VNImageOption, AnyObject>,
114 completion_handler: VNRequestCompletionHandler,
115 ) -> Retained<Self>;
116
117 #[cfg(all(
118 feature = "VNRequestHandler",
119 feature = "objc2-core-video",
120 feature = "objc2-image-io"
121 ))]
122 /// Create a new request that targets an image in a pixel buffer.
123 ///
124 ///
125 /// Parameter `pixelBuffer`: The pixel buffer containing the targeted image.
126 ///
127 /// Parameter `orientation`: The orientation of the image/buffer based on the EXIF specification. For details see kCGImagePropertyOrientation. The value has to be an integer from 1 to 8. This supersedes every other orientation information.
128 ///
129 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
130 ///
131 /// # Safety
132 ///
133 /// `options` generic should be of the correct type.
134 #[unsafe(method(initWithTargetedCVPixelBuffer:orientation:options:))]
135 #[unsafe(method_family = init)]
136 pub unsafe fn initWithTargetedCVPixelBuffer_orientation_options(
137 this: Allocated<Self>,
138 pixel_buffer: &CVPixelBuffer,
139 orientation: CGImagePropertyOrientation,
140 options: &NSDictionary<VNImageOption, AnyObject>,
141 ) -> Retained<Self>;
142
143 #[cfg(all(
144 feature = "VNRequestHandler",
145 feature = "block2",
146 feature = "objc2-core-video",
147 feature = "objc2-image-io"
148 ))]
149 /// Create a new request that targets an image in a pixel buffer.
150 ///
151 ///
152 /// Parameter `pixelBuffer`: The pixel buffer containing the targeted image.
153 ///
154 /// Parameter `orientation`: The orientation of the image/buffer based on the EXIF specification. For details see kCGImagePropertyOrientation. The value has to be an integer from 1 to 8. This supersedes every other orientation information.
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 ///
160 /// # Safety
161 ///
162 /// - `options` generic should be of the correct type.
163 /// - `completion_handler` must be a valid pointer or null.
164 #[unsafe(method(initWithTargetedCVPixelBuffer:orientation:options:completionHandler:))]
165 #[unsafe(method_family = init)]
166 pub unsafe fn initWithTargetedCVPixelBuffer_orientation_options_completionHandler(
167 this: Allocated<Self>,
168 pixel_buffer: &CVPixelBuffer,
169 orientation: CGImagePropertyOrientation,
170 options: &NSDictionary<VNImageOption, AnyObject>,
171 completion_handler: VNRequestCompletionHandler,
172 ) -> Retained<Self>;
173
174 #[cfg(all(feature = "VNRequestHandler", feature = "objc2-core-graphics"))]
175 /// Create a new request with a targeted CGImage.
176 ///
177 ///
178 /// Parameter `cgImage`: The CGImageRef of the targeted image.
179 ///
180 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
181 ///
182 /// # Safety
183 ///
184 /// `options` generic should be of the correct type.
185 #[unsafe(method(initWithTargetedCGImage:options:))]
186 #[unsafe(method_family = init)]
187 pub unsafe fn initWithTargetedCGImage_options(
188 this: Allocated<Self>,
189 cg_image: &CGImage,
190 options: &NSDictionary<VNImageOption, AnyObject>,
191 ) -> Retained<Self>;
192
193 #[cfg(all(
194 feature = "VNRequestHandler",
195 feature = "block2",
196 feature = "objc2-core-graphics"
197 ))]
198 /// Create a new request with a targeted CGImage.
199 ///
200 ///
201 /// Parameter `cgImage`: The CGImageRef of the targeted image.
202 ///
203 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
204 ///
205 /// Parameter `completionHandler`: The block that is invoked when the request has been performed.
206 ///
207 /// # Safety
208 ///
209 /// - `options` generic should be of the correct type.
210 /// - `completion_handler` must be a valid pointer or null.
211 #[unsafe(method(initWithTargetedCGImage:options:completionHandler:))]
212 #[unsafe(method_family = init)]
213 pub unsafe fn initWithTargetedCGImage_options_completionHandler(
214 this: Allocated<Self>,
215 cg_image: &CGImage,
216 options: &NSDictionary<VNImageOption, AnyObject>,
217 completion_handler: VNRequestCompletionHandler,
218 ) -> Retained<Self>;
219
220 #[cfg(all(
221 feature = "VNRequestHandler",
222 feature = "objc2-core-graphics",
223 feature = "objc2-image-io"
224 ))]
225 /// Create a new request with a targeted CGImage.
226 ///
227 ///
228 /// Parameter `cgImage`: The CGImageRef of the targeted image.
229 ///
230 /// Parameter `orientation`: The orientation of the image/buffer based on the EXIF specification. For details see kCGImagePropertyOrientation. The value has to be an integer from 1 to 8. This supersedes every other orientation information.
231 ///
232 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
233 ///
234 /// # Safety
235 ///
236 /// `options` generic should be of the correct type.
237 #[unsafe(method(initWithTargetedCGImage:orientation:options:))]
238 #[unsafe(method_family = init)]
239 pub unsafe fn initWithTargetedCGImage_orientation_options(
240 this: Allocated<Self>,
241 cg_image: &CGImage,
242 orientation: CGImagePropertyOrientation,
243 options: &NSDictionary<VNImageOption, AnyObject>,
244 ) -> Retained<Self>;
245
246 #[cfg(all(
247 feature = "VNRequestHandler",
248 feature = "block2",
249 feature = "objc2-core-graphics",
250 feature = "objc2-image-io"
251 ))]
252 /// Create a new request with a targeted CGImage.
253 ///
254 ///
255 /// Parameter `cgImage`: The CGImageRef of the targeted image.
256 ///
257 /// Parameter `orientation`: The orientation of the image/buffer based on the EXIF specification. For details see kCGImagePropertyOrientation. The value has to be an integer from 1 to 8. This supersedes every other orientation information.
258 ///
259 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
260 ///
261 /// Parameter `completionHandler`: The block that is invoked when the request has been performed.
262 ///
263 /// # Safety
264 ///
265 /// - `options` generic should be of the correct type.
266 /// - `completion_handler` must be a valid pointer or null.
267 #[unsafe(method(initWithTargetedCGImage:orientation:options:completionHandler:))]
268 #[unsafe(method_family = init)]
269 pub unsafe fn initWithTargetedCGImage_orientation_options_completionHandler(
270 this: Allocated<Self>,
271 cg_image: &CGImage,
272 orientation: CGImagePropertyOrientation,
273 options: &NSDictionary<VNImageOption, AnyObject>,
274 completion_handler: VNRequestCompletionHandler,
275 ) -> Retained<Self>;
276
277 #[cfg(all(feature = "VNRequestHandler", feature = "objc2-core-image"))]
278 /// Create a new request with a targeted CIImage.
279 ///
280 ///
281 /// Parameter `ciImage`: The CIImage of the targeted image.
282 ///
283 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
284 ///
285 /// # Safety
286 ///
287 /// `options` generic should be of the correct type.
288 #[unsafe(method(initWithTargetedCIImage:options:))]
289 #[unsafe(method_family = init)]
290 pub unsafe fn initWithTargetedCIImage_options(
291 this: Allocated<Self>,
292 ci_image: &CIImage,
293 options: &NSDictionary<VNImageOption, AnyObject>,
294 ) -> Retained<Self>;
295
296 #[cfg(all(
297 feature = "VNRequestHandler",
298 feature = "block2",
299 feature = "objc2-core-image"
300 ))]
301 /// Create a new request with a targeted CIImage.
302 ///
303 ///
304 /// Parameter `ciImage`: The CIImage of the targeted image.
305 ///
306 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
307 ///
308 /// Parameter `completionHandler`: The block that is invoked when the request has been performed.
309 ///
310 /// # Safety
311 ///
312 /// - `options` generic should be of the correct type.
313 /// - `completion_handler` must be a valid pointer or null.
314 #[unsafe(method(initWithTargetedCIImage:options:completionHandler:))]
315 #[unsafe(method_family = init)]
316 pub unsafe fn initWithTargetedCIImage_options_completionHandler(
317 this: Allocated<Self>,
318 ci_image: &CIImage,
319 options: &NSDictionary<VNImageOption, AnyObject>,
320 completion_handler: VNRequestCompletionHandler,
321 ) -> Retained<Self>;
322
323 #[cfg(all(
324 feature = "VNRequestHandler",
325 feature = "objc2-core-image",
326 feature = "objc2-image-io"
327 ))]
328 /// Create a new request with a targeted CIImage.
329 ///
330 ///
331 /// Parameter `ciImage`: The CIImage of the targeted image.
332 ///
333 /// Parameter `orientation`: The orientation of the image/buffer based on the EXIF specification. For details see kCGImagePropertyOrientation. The value has to be an integer from 1 to 8. This supersedes every other orientation information.
334 ///
335 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
336 ///
337 /// # Safety
338 ///
339 /// `options` generic should be of the correct type.
340 #[unsafe(method(initWithTargetedCIImage:orientation:options:))]
341 #[unsafe(method_family = init)]
342 pub unsafe fn initWithTargetedCIImage_orientation_options(
343 this: Allocated<Self>,
344 ci_image: &CIImage,
345 orientation: CGImagePropertyOrientation,
346 options: &NSDictionary<VNImageOption, AnyObject>,
347 ) -> Retained<Self>;
348
349 #[cfg(all(
350 feature = "VNRequestHandler",
351 feature = "block2",
352 feature = "objc2-core-image",
353 feature = "objc2-image-io"
354 ))]
355 /// Create a new request with a targeted CIImage.
356 ///
357 ///
358 /// Parameter `ciImage`: The CIImage of the targeted image.
359 ///
360 /// Parameter `orientation`: The orientation of the image/buffer based on the EXIF specification. For details see kCGImagePropertyOrientation. The value has to be an integer from 1 to 8. This supersedes every other orientation information.
361 ///
362 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
363 ///
364 /// Parameter `completionHandler`: The block that is invoked when the request has been performed.
365 ///
366 /// # Safety
367 ///
368 /// - `options` generic should be of the correct type.
369 /// - `completion_handler` must be a valid pointer or null.
370 #[unsafe(method(initWithTargetedCIImage:orientation:options:completionHandler:))]
371 #[unsafe(method_family = init)]
372 pub unsafe fn initWithTargetedCIImage_orientation_options_completionHandler(
373 this: Allocated<Self>,
374 ci_image: &CIImage,
375 orientation: CGImagePropertyOrientation,
376 options: &NSDictionary<VNImageOption, AnyObject>,
377 completion_handler: VNRequestCompletionHandler,
378 ) -> Retained<Self>;
379
380 #[cfg(feature = "VNRequestHandler")]
381 /// Create a new request with a targeted image URL.
382 ///
383 ///
384 /// Parameter `imageURL`: The URL of the targeted image.
385 ///
386 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
387 ///
388 /// # Safety
389 ///
390 /// `options` generic should be of the correct type.
391 #[unsafe(method(initWithTargetedImageURL:options:))]
392 #[unsafe(method_family = init)]
393 pub unsafe fn initWithTargetedImageURL_options(
394 this: Allocated<Self>,
395 image_url: &NSURL,
396 options: &NSDictionary<VNImageOption, AnyObject>,
397 ) -> Retained<Self>;
398
399 #[cfg(all(feature = "VNRequestHandler", feature = "block2"))]
400 /// Create a new request with a targeted image URL.
401 ///
402 ///
403 /// Parameter `imageURL`: The URL of the targeted image.
404 ///
405 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
406 ///
407 /// Parameter `completionHandler`: The block that is invoked when the request has been performed.
408 ///
409 /// # Safety
410 ///
411 /// - `options` generic should be of the correct type.
412 /// - `completion_handler` must be a valid pointer or null.
413 #[unsafe(method(initWithTargetedImageURL:options:completionHandler:))]
414 #[unsafe(method_family = init)]
415 pub unsafe fn initWithTargetedImageURL_options_completionHandler(
416 this: Allocated<Self>,
417 image_url: &NSURL,
418 options: &NSDictionary<VNImageOption, AnyObject>,
419 completion_handler: VNRequestCompletionHandler,
420 ) -> Retained<Self>;
421
422 #[cfg(all(feature = "VNRequestHandler", feature = "objc2-image-io"))]
423 /// Create a new request with a targeted image URL.
424 ///
425 ///
426 /// Parameter `imageURL`: The URL of the targeted image.
427 ///
428 /// Parameter `orientation`: The orientation of the image/buffer based on the EXIF specification. For details see kCGImagePropertyOrientation. The value has to be an integer from 1 to 8. This supersedes every other orientation information.
429 ///
430 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
431 ///
432 /// # Safety
433 ///
434 /// `options` generic should be of the correct type.
435 #[unsafe(method(initWithTargetedImageURL:orientation:options:))]
436 #[unsafe(method_family = init)]
437 pub unsafe fn initWithTargetedImageURL_orientation_options(
438 this: Allocated<Self>,
439 image_url: &NSURL,
440 orientation: CGImagePropertyOrientation,
441 options: &NSDictionary<VNImageOption, AnyObject>,
442 ) -> Retained<Self>;
443
444 #[cfg(all(
445 feature = "VNRequestHandler",
446 feature = "block2",
447 feature = "objc2-image-io"
448 ))]
449 /// Create a new request with a targeted image URL.
450 ///
451 ///
452 /// Parameter `imageURL`: The URL of the targeted image.
453 ///
454 /// Parameter `orientation`: The orientation of the image/buffer based on the EXIF specification. For details see kCGImagePropertyOrientation. The value has to be an integer from 1 to 8. This supersedes every other orientation information.
455 ///
456 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
457 ///
458 /// Parameter `completionHandler`: The block that is invoked when the request has been performed.
459 ///
460 /// # Safety
461 ///
462 /// - `options` generic should be of the correct type.
463 /// - `completion_handler` must be a valid pointer or null.
464 #[unsafe(method(initWithTargetedImageURL:orientation:options:completionHandler:))]
465 #[unsafe(method_family = init)]
466 pub unsafe fn initWithTargetedImageURL_orientation_options_completionHandler(
467 this: Allocated<Self>,
468 image_url: &NSURL,
469 orientation: CGImagePropertyOrientation,
470 options: &NSDictionary<VNImageOption, AnyObject>,
471 completion_handler: VNRequestCompletionHandler,
472 ) -> Retained<Self>;
473
474 #[cfg(feature = "VNRequestHandler")]
475 /// Create a new request with a targeted image data.
476 ///
477 ///
478 /// Parameter `imageData`: The data of the targeted image.
479 ///
480 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
481 ///
482 /// # Safety
483 ///
484 /// `options` generic should be of the correct type.
485 #[unsafe(method(initWithTargetedImageData:options:))]
486 #[unsafe(method_family = init)]
487 pub unsafe fn initWithTargetedImageData_options(
488 this: Allocated<Self>,
489 image_data: &NSData,
490 options: &NSDictionary<VNImageOption, AnyObject>,
491 ) -> Retained<Self>;
492
493 #[cfg(all(feature = "VNRequestHandler", feature = "block2"))]
494 /// Create a new request with a targeted image data.
495 ///
496 ///
497 /// Parameter `imageData`: The data of the targeted image.
498 ///
499 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
500 ///
501 /// Parameter `completionHandler`: The block that is invoked when the request has been performed.
502 ///
503 /// # Safety
504 ///
505 /// - `options` generic should be of the correct type.
506 /// - `completion_handler` must be a valid pointer or null.
507 #[unsafe(method(initWithTargetedImageData:options:completionHandler:))]
508 #[unsafe(method_family = init)]
509 pub unsafe fn initWithTargetedImageData_options_completionHandler(
510 this: Allocated<Self>,
511 image_data: &NSData,
512 options: &NSDictionary<VNImageOption, AnyObject>,
513 completion_handler: VNRequestCompletionHandler,
514 ) -> Retained<Self>;
515
516 #[cfg(all(feature = "VNRequestHandler", feature = "objc2-image-io"))]
517 /// Create a new request with a targeted image data.
518 ///
519 ///
520 /// Parameter `imageData`: The data of the targeted image.
521 ///
522 /// Parameter `orientation`: The orientation of the image/buffer based on the EXIF specification. For details see kCGImagePropertyOrientation. The value has to be an integer from 1 to 8. This supersedes every other orientation information.
523 ///
524 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
525 ///
526 /// # Safety
527 ///
528 /// `options` generic should be of the correct type.
529 #[unsafe(method(initWithTargetedImageData:orientation:options:))]
530 #[unsafe(method_family = init)]
531 pub unsafe fn initWithTargetedImageData_orientation_options(
532 this: Allocated<Self>,
533 image_data: &NSData,
534 orientation: CGImagePropertyOrientation,
535 options: &NSDictionary<VNImageOption, AnyObject>,
536 ) -> Retained<Self>;
537
538 #[cfg(all(
539 feature = "VNRequestHandler",
540 feature = "block2",
541 feature = "objc2-image-io"
542 ))]
543 /// Create a new request with a targeted image data.
544 ///
545 ///
546 /// Parameter `imageData`: The data of the targeted image.
547 ///
548 /// Parameter `orientation`: The orientation of the image/buffer based on the EXIF specification. For details see kCGImagePropertyOrientation. The value has to be an integer from 1 to 8. This supersedes every other orientation information.
549 ///
550 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
551 ///
552 /// Parameter `completionHandler`: The block that is invoked when the request has been performed.
553 ///
554 /// # Safety
555 ///
556 /// - `options` generic should be of the correct type.
557 /// - `completion_handler` must be a valid pointer or null.
558 #[unsafe(method(initWithTargetedImageData:orientation:options:completionHandler:))]
559 #[unsafe(method_family = init)]
560 pub unsafe fn initWithTargetedImageData_orientation_options_completionHandler(
561 this: Allocated<Self>,
562 image_data: &NSData,
563 orientation: CGImagePropertyOrientation,
564 options: &NSDictionary<VNImageOption, AnyObject>,
565 completion_handler: VNRequestCompletionHandler,
566 ) -> Retained<Self>;
567
568 #[cfg(all(feature = "VNRequestHandler", feature = "objc2-core-media"))]
569 /// Create a new request with a targeted CMSampleBuffer.
570 ///
571 ///
572 /// Parameter `sampleBuffer`: The CMSampleBuffer containing the CVImageBuffer to be used by the request.
573 ///
574 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
575 ///
576 /// # Safety
577 ///
578 /// `options` generic should be of the correct type.
579 #[unsafe(method(initWithTargetedCMSampleBuffer:options:))]
580 #[unsafe(method_family = init)]
581 pub unsafe fn initWithTargetedCMSampleBuffer_options(
582 this: Allocated<Self>,
583 sample_buffer: &CMSampleBuffer,
584 options: &NSDictionary<VNImageOption, AnyObject>,
585 ) -> Retained<Self>;
586
587 #[cfg(all(
588 feature = "VNRequestHandler",
589 feature = "block2",
590 feature = "objc2-core-media"
591 ))]
592 /// Create a new request with a targeted CMSampleBuffer.
593 ///
594 ///
595 /// Parameter `sampleBuffer`: The CMSampleBuffer containing the CVImageBuffer to be used by the request.
596 ///
597 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
598 ///
599 /// Parameter `completionHandler`: The block that is invoked after the request has been performed.
600 ///
601 /// # Safety
602 ///
603 /// - `options` generic should be of the correct type.
604 /// - `completion_handler` must be a valid pointer or null.
605 #[unsafe(method(initWithTargetedCMSampleBuffer:options:completionHandler:))]
606 #[unsafe(method_family = init)]
607 pub unsafe fn initWithTargetedCMSampleBuffer_options_completionHandler(
608 this: Allocated<Self>,
609 sample_buffer: &CMSampleBuffer,
610 options: &NSDictionary<VNImageOption, AnyObject>,
611 completion_handler: VNRequestCompletionHandler,
612 ) -> Retained<Self>;
613
614 #[cfg(all(
615 feature = "VNRequestHandler",
616 feature = "objc2-core-media",
617 feature = "objc2-image-io"
618 ))]
619 /// Create a new request with a targeted CMSampleBuffer.
620 ///
621 ///
622 /// Parameter `sampleBuffer`: The CMSampleBuffer containing the CVImageBuffer to be used by the request.
623 ///
624 /// Parameter `orientation`: The orientation of the image/buffer based on the EXIF specification. For details see kCGImagePropertyOrientation. The value has to be an integer from 1 to 8. This supersedes every other orientation information.
625 ///
626 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
627 ///
628 /// # Safety
629 ///
630 /// `options` generic should be of the correct type.
631 #[unsafe(method(initWithTargetedCMSampleBuffer:orientation:options:))]
632 #[unsafe(method_family = init)]
633 pub unsafe fn initWithTargetedCMSampleBuffer_orientation_options(
634 this: Allocated<Self>,
635 sample_buffer: &CMSampleBuffer,
636 orientation: CGImagePropertyOrientation,
637 options: &NSDictionary<VNImageOption, AnyObject>,
638 ) -> Retained<Self>;
639
640 #[cfg(all(
641 feature = "VNRequestHandler",
642 feature = "block2",
643 feature = "objc2-core-media",
644 feature = "objc2-image-io"
645 ))]
646 /// Create a new request with a targeted CMSampleBuffer.
647 ///
648 ///
649 /// Parameter `sampleBuffer`: The CMSampleBuffer containing the CVImageBuffer to be used by the request.
650 ///
651 /// Parameter `orientation`: The orientation of the image/buffer based on the EXIF specification. For details see kCGImagePropertyOrientation. The value has to be an integer from 1 to 8. This supersedes every other orientation information.
652 ///
653 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
654 ///
655 /// Parameter `completionHandler`: The block that is invoked after the request has been performed.
656 ///
657 /// # Safety
658 ///
659 /// - `options` generic should be of the correct type.
660 /// - `completion_handler` must be a valid pointer or null.
661 #[unsafe(method(initWithTargetedCMSampleBuffer:orientation:options:completionHandler:))]
662 #[unsafe(method_family = init)]
663 pub unsafe fn initWithTargetedCMSampleBuffer_orientation_options_completionHandler(
664 this: Allocated<Self>,
665 sample_buffer: &CMSampleBuffer,
666 orientation: CGImagePropertyOrientation,
667 options: &NSDictionary<VNImageOption, AnyObject>,
668 completion_handler: VNRequestCompletionHandler,
669 ) -> Retained<Self>;
670 );
671}
672
673/// Methods declared on superclass `NSObject`.
674#[cfg(all(feature = "VNRequest", feature = "VNTargetedImageRequest"))]
675impl VNImageRegistrationRequest {
676 extern_methods!(
677 #[unsafe(method(new))]
678 #[unsafe(method_family = new)]
679 pub unsafe fn new() -> Retained<Self>;
680 );
681}
682
683extern_class!(
684 /// An image registration request that will calculate a translational transformation for morphing a "floating" image onto an unchanging "reference" image.
685 ///
686 ///
687 /// The request is created with the targeted image acting as the floating image. Processing the request will calculate the affine transformations that morph the floating image onto the reference image.
688 ///
689 /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vntranslationalimageregistrationrequest?language=objc)
690 #[unsafe(super(
691 VNImageRegistrationRequest,
692 VNTargetedImageRequest,
693 VNImageBasedRequest,
694 VNRequest,
695 NSObject
696 ))]
697 #[derive(Debug, PartialEq, Eq, Hash)]
698 #[cfg(all(feature = "VNRequest", feature = "VNTargetedImageRequest"))]
699 pub struct VNTranslationalImageRegistrationRequest;
700);
701
702#[cfg(all(feature = "VNRequest", feature = "VNTargetedImageRequest"))]
703extern_conformance!(
704 unsafe impl NSCopying for VNTranslationalImageRegistrationRequest {}
705);
706
707#[cfg(all(feature = "VNRequest", feature = "VNTargetedImageRequest"))]
708unsafe impl CopyingHelper for VNTranslationalImageRegistrationRequest {
709 type Result = Self;
710}
711
712#[cfg(all(feature = "VNRequest", feature = "VNTargetedImageRequest"))]
713extern_conformance!(
714 unsafe impl NSObjectProtocol for VNTranslationalImageRegistrationRequest {}
715);
716
717#[cfg(all(feature = "VNRequest", feature = "VNTargetedImageRequest"))]
718impl VNTranslationalImageRegistrationRequest {
719 extern_methods!(
720 #[cfg(feature = "VNObservation")]
721 /// VNImageTranslationAlignmentObservation results.
722 #[unsafe(method(results))]
723 #[unsafe(method_family = none)]
724 pub unsafe fn results(
725 &self,
726 ) -> Option<Retained<NSArray<VNImageTranslationAlignmentObservation>>>;
727 );
728}
729
730/// Methods declared on superclass `VNTargetedImageRequest`.
731#[cfg(all(feature = "VNRequest", feature = "VNTargetedImageRequest"))]
732impl VNTranslationalImageRegistrationRequest {
733 extern_methods!(
734 #[unsafe(method(init))]
735 #[unsafe(method_family = init)]
736 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
737
738 #[cfg(feature = "block2")]
739 /// # Safety
740 ///
741 /// `completion_handler` must be a valid pointer or null.
742 #[unsafe(method(initWithCompletionHandler:))]
743 #[unsafe(method_family = init)]
744 pub unsafe fn initWithCompletionHandler(
745 this: Allocated<Self>,
746 completion_handler: VNRequestCompletionHandler,
747 ) -> Retained<Self>;
748
749 #[cfg(all(feature = "VNRequestHandler", feature = "objc2-core-video"))]
750 /// Create a new request that targets an image in a pixel buffer.
751 ///
752 ///
753 /// Parameter `pixelBuffer`: The pixel buffer containing the targeted image.
754 ///
755 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
756 ///
757 /// # Safety
758 ///
759 /// `options` generic should be of the correct type.
760 #[unsafe(method(initWithTargetedCVPixelBuffer:options:))]
761 #[unsafe(method_family = init)]
762 pub unsafe fn initWithTargetedCVPixelBuffer_options(
763 this: Allocated<Self>,
764 pixel_buffer: &CVPixelBuffer,
765 options: &NSDictionary<VNImageOption, AnyObject>,
766 ) -> Retained<Self>;
767
768 #[cfg(all(
769 feature = "VNRequestHandler",
770 feature = "block2",
771 feature = "objc2-core-video"
772 ))]
773 /// Create a new request that targets an image in a pixel buffer.
774 ///
775 ///
776 /// Parameter `pixelBuffer`: The pixel buffer containing the targeted image.
777 ///
778 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
779 ///
780 /// Parameter `completionHandler`: The block that is invoked when the request has been performed.
781 ///
782 /// # Safety
783 ///
784 /// - `options` generic should be of the correct type.
785 /// - `completion_handler` must be a valid pointer or null.
786 #[unsafe(method(initWithTargetedCVPixelBuffer:options:completionHandler:))]
787 #[unsafe(method_family = init)]
788 pub unsafe fn initWithTargetedCVPixelBuffer_options_completionHandler(
789 this: Allocated<Self>,
790 pixel_buffer: &CVPixelBuffer,
791 options: &NSDictionary<VNImageOption, AnyObject>,
792 completion_handler: VNRequestCompletionHandler,
793 ) -> Retained<Self>;
794
795 #[cfg(all(
796 feature = "VNRequestHandler",
797 feature = "objc2-core-video",
798 feature = "objc2-image-io"
799 ))]
800 /// Create a new request that targets an image in a pixel buffer.
801 ///
802 ///
803 /// Parameter `pixelBuffer`: The pixel buffer containing the targeted image.
804 ///
805 /// Parameter `orientation`: The orientation of the image/buffer based on the EXIF specification. For details see kCGImagePropertyOrientation. The value has to be an integer from 1 to 8. This supersedes every other orientation information.
806 ///
807 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
808 ///
809 /// # Safety
810 ///
811 /// `options` generic should be of the correct type.
812 #[unsafe(method(initWithTargetedCVPixelBuffer:orientation:options:))]
813 #[unsafe(method_family = init)]
814 pub unsafe fn initWithTargetedCVPixelBuffer_orientation_options(
815 this: Allocated<Self>,
816 pixel_buffer: &CVPixelBuffer,
817 orientation: CGImagePropertyOrientation,
818 options: &NSDictionary<VNImageOption, AnyObject>,
819 ) -> Retained<Self>;
820
821 #[cfg(all(
822 feature = "VNRequestHandler",
823 feature = "block2",
824 feature = "objc2-core-video",
825 feature = "objc2-image-io"
826 ))]
827 /// Create a new request that targets an image in a pixel buffer.
828 ///
829 ///
830 /// Parameter `pixelBuffer`: The pixel buffer containing the targeted image.
831 ///
832 /// Parameter `orientation`: The orientation of the image/buffer based on the EXIF specification. For details see kCGImagePropertyOrientation. The value has to be an integer from 1 to 8. This supersedes every other orientation information.
833 ///
834 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
835 ///
836 /// Parameter `completionHandler`: The block that is invoked when the request has been performed.
837 ///
838 /// # Safety
839 ///
840 /// - `options` generic should be of the correct type.
841 /// - `completion_handler` must be a valid pointer or null.
842 #[unsafe(method(initWithTargetedCVPixelBuffer:orientation:options:completionHandler:))]
843 #[unsafe(method_family = init)]
844 pub unsafe fn initWithTargetedCVPixelBuffer_orientation_options_completionHandler(
845 this: Allocated<Self>,
846 pixel_buffer: &CVPixelBuffer,
847 orientation: CGImagePropertyOrientation,
848 options: &NSDictionary<VNImageOption, AnyObject>,
849 completion_handler: VNRequestCompletionHandler,
850 ) -> Retained<Self>;
851
852 #[cfg(all(feature = "VNRequestHandler", feature = "objc2-core-graphics"))]
853 /// Create a new request with a targeted CGImage.
854 ///
855 ///
856 /// Parameter `cgImage`: The CGImageRef of the targeted image.
857 ///
858 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
859 ///
860 /// # Safety
861 ///
862 /// `options` generic should be of the correct type.
863 #[unsafe(method(initWithTargetedCGImage:options:))]
864 #[unsafe(method_family = init)]
865 pub unsafe fn initWithTargetedCGImage_options(
866 this: Allocated<Self>,
867 cg_image: &CGImage,
868 options: &NSDictionary<VNImageOption, AnyObject>,
869 ) -> Retained<Self>;
870
871 #[cfg(all(
872 feature = "VNRequestHandler",
873 feature = "block2",
874 feature = "objc2-core-graphics"
875 ))]
876 /// Create a new request with a targeted CGImage.
877 ///
878 ///
879 /// Parameter `cgImage`: The CGImageRef of the targeted image.
880 ///
881 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
882 ///
883 /// Parameter `completionHandler`: The block that is invoked when the request has been performed.
884 ///
885 /// # Safety
886 ///
887 /// - `options` generic should be of the correct type.
888 /// - `completion_handler` must be a valid pointer or null.
889 #[unsafe(method(initWithTargetedCGImage:options:completionHandler:))]
890 #[unsafe(method_family = init)]
891 pub unsafe fn initWithTargetedCGImage_options_completionHandler(
892 this: Allocated<Self>,
893 cg_image: &CGImage,
894 options: &NSDictionary<VNImageOption, AnyObject>,
895 completion_handler: VNRequestCompletionHandler,
896 ) -> Retained<Self>;
897
898 #[cfg(all(
899 feature = "VNRequestHandler",
900 feature = "objc2-core-graphics",
901 feature = "objc2-image-io"
902 ))]
903 /// Create a new request with a targeted CGImage.
904 ///
905 ///
906 /// Parameter `cgImage`: The CGImageRef of the targeted image.
907 ///
908 /// Parameter `orientation`: The orientation of the image/buffer based on the EXIF specification. For details see kCGImagePropertyOrientation. The value has to be an integer from 1 to 8. This supersedes every other orientation information.
909 ///
910 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
911 ///
912 /// # Safety
913 ///
914 /// `options` generic should be of the correct type.
915 #[unsafe(method(initWithTargetedCGImage:orientation:options:))]
916 #[unsafe(method_family = init)]
917 pub unsafe fn initWithTargetedCGImage_orientation_options(
918 this: Allocated<Self>,
919 cg_image: &CGImage,
920 orientation: CGImagePropertyOrientation,
921 options: &NSDictionary<VNImageOption, AnyObject>,
922 ) -> Retained<Self>;
923
924 #[cfg(all(
925 feature = "VNRequestHandler",
926 feature = "block2",
927 feature = "objc2-core-graphics",
928 feature = "objc2-image-io"
929 ))]
930 /// Create a new request with a targeted CGImage.
931 ///
932 ///
933 /// Parameter `cgImage`: The CGImageRef of the targeted image.
934 ///
935 /// Parameter `orientation`: The orientation of the image/buffer based on the EXIF specification. For details see kCGImagePropertyOrientation. The value has to be an integer from 1 to 8. This supersedes every other orientation information.
936 ///
937 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
938 ///
939 /// Parameter `completionHandler`: The block that is invoked when the request has been performed.
940 ///
941 /// # Safety
942 ///
943 /// - `options` generic should be of the correct type.
944 /// - `completion_handler` must be a valid pointer or null.
945 #[unsafe(method(initWithTargetedCGImage:orientation:options:completionHandler:))]
946 #[unsafe(method_family = init)]
947 pub unsafe fn initWithTargetedCGImage_orientation_options_completionHandler(
948 this: Allocated<Self>,
949 cg_image: &CGImage,
950 orientation: CGImagePropertyOrientation,
951 options: &NSDictionary<VNImageOption, AnyObject>,
952 completion_handler: VNRequestCompletionHandler,
953 ) -> Retained<Self>;
954
955 #[cfg(all(feature = "VNRequestHandler", feature = "objc2-core-image"))]
956 /// Create a new request with a targeted CIImage.
957 ///
958 ///
959 /// Parameter `ciImage`: The CIImage of the targeted image.
960 ///
961 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
962 ///
963 /// # Safety
964 ///
965 /// `options` generic should be of the correct type.
966 #[unsafe(method(initWithTargetedCIImage:options:))]
967 #[unsafe(method_family = init)]
968 pub unsafe fn initWithTargetedCIImage_options(
969 this: Allocated<Self>,
970 ci_image: &CIImage,
971 options: &NSDictionary<VNImageOption, AnyObject>,
972 ) -> Retained<Self>;
973
974 #[cfg(all(
975 feature = "VNRequestHandler",
976 feature = "block2",
977 feature = "objc2-core-image"
978 ))]
979 /// Create a new request with a targeted CIImage.
980 ///
981 ///
982 /// Parameter `ciImage`: The CIImage of the targeted image.
983 ///
984 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
985 ///
986 /// Parameter `completionHandler`: The block that is invoked when the request has been performed.
987 ///
988 /// # Safety
989 ///
990 /// - `options` generic should be of the correct type.
991 /// - `completion_handler` must be a valid pointer or null.
992 #[unsafe(method(initWithTargetedCIImage:options:completionHandler:))]
993 #[unsafe(method_family = init)]
994 pub unsafe fn initWithTargetedCIImage_options_completionHandler(
995 this: Allocated<Self>,
996 ci_image: &CIImage,
997 options: &NSDictionary<VNImageOption, AnyObject>,
998 completion_handler: VNRequestCompletionHandler,
999 ) -> Retained<Self>;
1000
1001 #[cfg(all(
1002 feature = "VNRequestHandler",
1003 feature = "objc2-core-image",
1004 feature = "objc2-image-io"
1005 ))]
1006 /// Create a new request with a targeted CIImage.
1007 ///
1008 ///
1009 /// Parameter `ciImage`: The CIImage of the targeted image.
1010 ///
1011 /// Parameter `orientation`: The orientation of the image/buffer based on the EXIF specification. For details see kCGImagePropertyOrientation. The value has to be an integer from 1 to 8. This supersedes every other orientation information.
1012 ///
1013 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
1014 ///
1015 /// # Safety
1016 ///
1017 /// `options` generic should be of the correct type.
1018 #[unsafe(method(initWithTargetedCIImage:orientation:options:))]
1019 #[unsafe(method_family = init)]
1020 pub unsafe fn initWithTargetedCIImage_orientation_options(
1021 this: Allocated<Self>,
1022 ci_image: &CIImage,
1023 orientation: CGImagePropertyOrientation,
1024 options: &NSDictionary<VNImageOption, AnyObject>,
1025 ) -> Retained<Self>;
1026
1027 #[cfg(all(
1028 feature = "VNRequestHandler",
1029 feature = "block2",
1030 feature = "objc2-core-image",
1031 feature = "objc2-image-io"
1032 ))]
1033 /// Create a new request with a targeted CIImage.
1034 ///
1035 ///
1036 /// Parameter `ciImage`: The CIImage of the targeted image.
1037 ///
1038 /// Parameter `orientation`: The orientation of the image/buffer based on the EXIF specification. For details see kCGImagePropertyOrientation. The value has to be an integer from 1 to 8. This supersedes every other orientation information.
1039 ///
1040 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
1041 ///
1042 /// Parameter `completionHandler`: The block that is invoked when the request has been performed.
1043 ///
1044 /// # Safety
1045 ///
1046 /// - `options` generic should be of the correct type.
1047 /// - `completion_handler` must be a valid pointer or null.
1048 #[unsafe(method(initWithTargetedCIImage:orientation:options:completionHandler:))]
1049 #[unsafe(method_family = init)]
1050 pub unsafe fn initWithTargetedCIImage_orientation_options_completionHandler(
1051 this: Allocated<Self>,
1052 ci_image: &CIImage,
1053 orientation: CGImagePropertyOrientation,
1054 options: &NSDictionary<VNImageOption, AnyObject>,
1055 completion_handler: VNRequestCompletionHandler,
1056 ) -> Retained<Self>;
1057
1058 #[cfg(feature = "VNRequestHandler")]
1059 /// Create a new request with a targeted image URL.
1060 ///
1061 ///
1062 /// Parameter `imageURL`: The URL of the targeted image.
1063 ///
1064 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
1065 ///
1066 /// # Safety
1067 ///
1068 /// `options` generic should be of the correct type.
1069 #[unsafe(method(initWithTargetedImageURL:options:))]
1070 #[unsafe(method_family = init)]
1071 pub unsafe fn initWithTargetedImageURL_options(
1072 this: Allocated<Self>,
1073 image_url: &NSURL,
1074 options: &NSDictionary<VNImageOption, AnyObject>,
1075 ) -> Retained<Self>;
1076
1077 #[cfg(all(feature = "VNRequestHandler", feature = "block2"))]
1078 /// Create a new request with a targeted image URL.
1079 ///
1080 ///
1081 /// Parameter `imageURL`: The URL of the targeted image.
1082 ///
1083 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
1084 ///
1085 /// Parameter `completionHandler`: The block that is invoked when the request has been performed.
1086 ///
1087 /// # Safety
1088 ///
1089 /// - `options` generic should be of the correct type.
1090 /// - `completion_handler` must be a valid pointer or null.
1091 #[unsafe(method(initWithTargetedImageURL:options:completionHandler:))]
1092 #[unsafe(method_family = init)]
1093 pub unsafe fn initWithTargetedImageURL_options_completionHandler(
1094 this: Allocated<Self>,
1095 image_url: &NSURL,
1096 options: &NSDictionary<VNImageOption, AnyObject>,
1097 completion_handler: VNRequestCompletionHandler,
1098 ) -> Retained<Self>;
1099
1100 #[cfg(all(feature = "VNRequestHandler", feature = "objc2-image-io"))]
1101 /// Create a new request with a targeted image URL.
1102 ///
1103 ///
1104 /// Parameter `imageURL`: The URL of the targeted image.
1105 ///
1106 /// Parameter `orientation`: The orientation of the image/buffer based on the EXIF specification. For details see kCGImagePropertyOrientation. The value has to be an integer from 1 to 8. This supersedes every other orientation information.
1107 ///
1108 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
1109 ///
1110 /// # Safety
1111 ///
1112 /// `options` generic should be of the correct type.
1113 #[unsafe(method(initWithTargetedImageURL:orientation:options:))]
1114 #[unsafe(method_family = init)]
1115 pub unsafe fn initWithTargetedImageURL_orientation_options(
1116 this: Allocated<Self>,
1117 image_url: &NSURL,
1118 orientation: CGImagePropertyOrientation,
1119 options: &NSDictionary<VNImageOption, AnyObject>,
1120 ) -> Retained<Self>;
1121
1122 #[cfg(all(
1123 feature = "VNRequestHandler",
1124 feature = "block2",
1125 feature = "objc2-image-io"
1126 ))]
1127 /// Create a new request with a targeted image URL.
1128 ///
1129 ///
1130 /// Parameter `imageURL`: The URL of the targeted image.
1131 ///
1132 /// Parameter `orientation`: The orientation of the image/buffer based on the EXIF specification. For details see kCGImagePropertyOrientation. The value has to be an integer from 1 to 8. This supersedes every other orientation information.
1133 ///
1134 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
1135 ///
1136 /// Parameter `completionHandler`: The block that is invoked when the request has been performed.
1137 ///
1138 /// # Safety
1139 ///
1140 /// - `options` generic should be of the correct type.
1141 /// - `completion_handler` must be a valid pointer or null.
1142 #[unsafe(method(initWithTargetedImageURL:orientation:options:completionHandler:))]
1143 #[unsafe(method_family = init)]
1144 pub unsafe fn initWithTargetedImageURL_orientation_options_completionHandler(
1145 this: Allocated<Self>,
1146 image_url: &NSURL,
1147 orientation: CGImagePropertyOrientation,
1148 options: &NSDictionary<VNImageOption, AnyObject>,
1149 completion_handler: VNRequestCompletionHandler,
1150 ) -> Retained<Self>;
1151
1152 #[cfg(feature = "VNRequestHandler")]
1153 /// Create a new request with a targeted image data.
1154 ///
1155 ///
1156 /// Parameter `imageData`: The data of the targeted image.
1157 ///
1158 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
1159 ///
1160 /// # Safety
1161 ///
1162 /// `options` generic should be of the correct type.
1163 #[unsafe(method(initWithTargetedImageData:options:))]
1164 #[unsafe(method_family = init)]
1165 pub unsafe fn initWithTargetedImageData_options(
1166 this: Allocated<Self>,
1167 image_data: &NSData,
1168 options: &NSDictionary<VNImageOption, AnyObject>,
1169 ) -> Retained<Self>;
1170
1171 #[cfg(all(feature = "VNRequestHandler", feature = "block2"))]
1172 /// Create a new request with a targeted image data.
1173 ///
1174 ///
1175 /// Parameter `imageData`: The data of the targeted image.
1176 ///
1177 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
1178 ///
1179 /// Parameter `completionHandler`: The block that is invoked when the request has been performed.
1180 ///
1181 /// # Safety
1182 ///
1183 /// - `options` generic should be of the correct type.
1184 /// - `completion_handler` must be a valid pointer or null.
1185 #[unsafe(method(initWithTargetedImageData:options:completionHandler:))]
1186 #[unsafe(method_family = init)]
1187 pub unsafe fn initWithTargetedImageData_options_completionHandler(
1188 this: Allocated<Self>,
1189 image_data: &NSData,
1190 options: &NSDictionary<VNImageOption, AnyObject>,
1191 completion_handler: VNRequestCompletionHandler,
1192 ) -> Retained<Self>;
1193
1194 #[cfg(all(feature = "VNRequestHandler", feature = "objc2-image-io"))]
1195 /// Create a new request with a targeted image data.
1196 ///
1197 ///
1198 /// Parameter `imageData`: The data of the targeted image.
1199 ///
1200 /// Parameter `orientation`: The orientation of the image/buffer based on the EXIF specification. For details see kCGImagePropertyOrientation. The value has to be an integer from 1 to 8. This supersedes every other orientation information.
1201 ///
1202 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
1203 ///
1204 /// # Safety
1205 ///
1206 /// `options` generic should be of the correct type.
1207 #[unsafe(method(initWithTargetedImageData:orientation:options:))]
1208 #[unsafe(method_family = init)]
1209 pub unsafe fn initWithTargetedImageData_orientation_options(
1210 this: Allocated<Self>,
1211 image_data: &NSData,
1212 orientation: CGImagePropertyOrientation,
1213 options: &NSDictionary<VNImageOption, AnyObject>,
1214 ) -> Retained<Self>;
1215
1216 #[cfg(all(
1217 feature = "VNRequestHandler",
1218 feature = "block2",
1219 feature = "objc2-image-io"
1220 ))]
1221 /// Create a new request with a targeted image data.
1222 ///
1223 ///
1224 /// Parameter `imageData`: The data of the targeted image.
1225 ///
1226 /// Parameter `orientation`: The orientation of the image/buffer based on the EXIF specification. For details see kCGImagePropertyOrientation. The value has to be an integer from 1 to 8. This supersedes every other orientation information.
1227 ///
1228 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
1229 ///
1230 /// Parameter `completionHandler`: The block that is invoked when the request has been performed.
1231 ///
1232 /// # Safety
1233 ///
1234 /// - `options` generic should be of the correct type.
1235 /// - `completion_handler` must be a valid pointer or null.
1236 #[unsafe(method(initWithTargetedImageData:orientation:options:completionHandler:))]
1237 #[unsafe(method_family = init)]
1238 pub unsafe fn initWithTargetedImageData_orientation_options_completionHandler(
1239 this: Allocated<Self>,
1240 image_data: &NSData,
1241 orientation: CGImagePropertyOrientation,
1242 options: &NSDictionary<VNImageOption, AnyObject>,
1243 completion_handler: VNRequestCompletionHandler,
1244 ) -> Retained<Self>;
1245
1246 #[cfg(all(feature = "VNRequestHandler", feature = "objc2-core-media"))]
1247 /// Create a new request with a targeted CMSampleBuffer.
1248 ///
1249 ///
1250 /// Parameter `sampleBuffer`: The CMSampleBuffer containing the CVImageBuffer to be used by the request.
1251 ///
1252 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
1253 ///
1254 /// # Safety
1255 ///
1256 /// `options` generic should be of the correct type.
1257 #[unsafe(method(initWithTargetedCMSampleBuffer:options:))]
1258 #[unsafe(method_family = init)]
1259 pub unsafe fn initWithTargetedCMSampleBuffer_options(
1260 this: Allocated<Self>,
1261 sample_buffer: &CMSampleBuffer,
1262 options: &NSDictionary<VNImageOption, AnyObject>,
1263 ) -> Retained<Self>;
1264
1265 #[cfg(all(
1266 feature = "VNRequestHandler",
1267 feature = "block2",
1268 feature = "objc2-core-media"
1269 ))]
1270 /// Create a new request with a targeted CMSampleBuffer.
1271 ///
1272 ///
1273 /// Parameter `sampleBuffer`: The CMSampleBuffer containing the CVImageBuffer to be used by the request.
1274 ///
1275 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
1276 ///
1277 /// Parameter `completionHandler`: The block that is invoked after the request has been performed.
1278 ///
1279 /// # Safety
1280 ///
1281 /// - `options` generic should be of the correct type.
1282 /// - `completion_handler` must be a valid pointer or null.
1283 #[unsafe(method(initWithTargetedCMSampleBuffer:options:completionHandler:))]
1284 #[unsafe(method_family = init)]
1285 pub unsafe fn initWithTargetedCMSampleBuffer_options_completionHandler(
1286 this: Allocated<Self>,
1287 sample_buffer: &CMSampleBuffer,
1288 options: &NSDictionary<VNImageOption, AnyObject>,
1289 completion_handler: VNRequestCompletionHandler,
1290 ) -> Retained<Self>;
1291
1292 #[cfg(all(
1293 feature = "VNRequestHandler",
1294 feature = "objc2-core-media",
1295 feature = "objc2-image-io"
1296 ))]
1297 /// Create a new request with a targeted CMSampleBuffer.
1298 ///
1299 ///
1300 /// Parameter `sampleBuffer`: The CMSampleBuffer containing the CVImageBuffer to be used by the request.
1301 ///
1302 /// Parameter `orientation`: The orientation of the image/buffer based on the EXIF specification. For details see kCGImagePropertyOrientation. The value has to be an integer from 1 to 8. This supersedes every other orientation information.
1303 ///
1304 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
1305 ///
1306 /// # Safety
1307 ///
1308 /// `options` generic should be of the correct type.
1309 #[unsafe(method(initWithTargetedCMSampleBuffer:orientation:options:))]
1310 #[unsafe(method_family = init)]
1311 pub unsafe fn initWithTargetedCMSampleBuffer_orientation_options(
1312 this: Allocated<Self>,
1313 sample_buffer: &CMSampleBuffer,
1314 orientation: CGImagePropertyOrientation,
1315 options: &NSDictionary<VNImageOption, AnyObject>,
1316 ) -> Retained<Self>;
1317
1318 #[cfg(all(
1319 feature = "VNRequestHandler",
1320 feature = "block2",
1321 feature = "objc2-core-media",
1322 feature = "objc2-image-io"
1323 ))]
1324 /// Create a new request with a targeted CMSampleBuffer.
1325 ///
1326 ///
1327 /// Parameter `sampleBuffer`: The CMSampleBuffer containing the CVImageBuffer to be used by the request.
1328 ///
1329 /// Parameter `orientation`: The orientation of the image/buffer based on the EXIF specification. For details see kCGImagePropertyOrientation. The value has to be an integer from 1 to 8. This supersedes every other orientation information.
1330 ///
1331 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
1332 ///
1333 /// Parameter `completionHandler`: The block that is invoked after the request has been performed.
1334 ///
1335 /// # Safety
1336 ///
1337 /// - `options` generic should be of the correct type.
1338 /// - `completion_handler` must be a valid pointer or null.
1339 #[unsafe(method(initWithTargetedCMSampleBuffer:orientation:options:completionHandler:))]
1340 #[unsafe(method_family = init)]
1341 pub unsafe fn initWithTargetedCMSampleBuffer_orientation_options_completionHandler(
1342 this: Allocated<Self>,
1343 sample_buffer: &CMSampleBuffer,
1344 orientation: CGImagePropertyOrientation,
1345 options: &NSDictionary<VNImageOption, AnyObject>,
1346 completion_handler: VNRequestCompletionHandler,
1347 ) -> Retained<Self>;
1348 );
1349}
1350
1351/// Methods declared on superclass `NSObject`.
1352#[cfg(all(feature = "VNRequest", feature = "VNTargetedImageRequest"))]
1353impl VNTranslationalImageRegistrationRequest {
1354 extern_methods!(
1355 #[unsafe(method(new))]
1356 #[unsafe(method_family = new)]
1357 pub unsafe fn new() -> Retained<Self>;
1358 );
1359}
1360
1361/// [Apple's documentation](https://developer.apple.com/documentation/vision/vntranslationalimageregistrationrequestrevision1?language=objc)
1362pub static VNTranslationalImageRegistrationRequestRevision1: NSUInteger = 1;
1363
1364extern_class!(
1365 /// An image registration request that will calculate a homographic transformation for morphing a "floating" image onto an unchanging "reference" image.
1366 ///
1367 ///
1368 /// The request is created with the targeted image acting as the floating image. Processing the request will calculate the matrix warp transform that morph the floating image onto the reference image.
1369 /// Note that the request will fail unless the pixel dimensions of the reference image do not exactly match the resolved region of interest of the floating image.
1370 ///
1371 /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vnhomographicimageregistrationrequest?language=objc)
1372 #[unsafe(super(
1373 VNImageRegistrationRequest,
1374 VNTargetedImageRequest,
1375 VNImageBasedRequest,
1376 VNRequest,
1377 NSObject
1378 ))]
1379 #[derive(Debug, PartialEq, Eq, Hash)]
1380 #[cfg(all(feature = "VNRequest", feature = "VNTargetedImageRequest"))]
1381 pub struct VNHomographicImageRegistrationRequest;
1382);
1383
1384#[cfg(all(feature = "VNRequest", feature = "VNTargetedImageRequest"))]
1385extern_conformance!(
1386 unsafe impl NSCopying for VNHomographicImageRegistrationRequest {}
1387);
1388
1389#[cfg(all(feature = "VNRequest", feature = "VNTargetedImageRequest"))]
1390unsafe impl CopyingHelper for VNHomographicImageRegistrationRequest {
1391 type Result = Self;
1392}
1393
1394#[cfg(all(feature = "VNRequest", feature = "VNTargetedImageRequest"))]
1395extern_conformance!(
1396 unsafe impl NSObjectProtocol for VNHomographicImageRegistrationRequest {}
1397);
1398
1399#[cfg(all(feature = "VNRequest", feature = "VNTargetedImageRequest"))]
1400impl VNHomographicImageRegistrationRequest {
1401 extern_methods!(
1402 #[cfg(feature = "VNObservation")]
1403 /// VNImageHomographicAlignmentObservation results.
1404 #[unsafe(method(results))]
1405 #[unsafe(method_family = none)]
1406 pub unsafe fn results(
1407 &self,
1408 ) -> Option<Retained<NSArray<VNImageHomographicAlignmentObservation>>>;
1409 );
1410}
1411
1412/// Methods declared on superclass `VNTargetedImageRequest`.
1413#[cfg(all(feature = "VNRequest", feature = "VNTargetedImageRequest"))]
1414impl VNHomographicImageRegistrationRequest {
1415 extern_methods!(
1416 #[unsafe(method(init))]
1417 #[unsafe(method_family = init)]
1418 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1419
1420 #[cfg(feature = "block2")]
1421 /// # Safety
1422 ///
1423 /// `completion_handler` must be a valid pointer or null.
1424 #[unsafe(method(initWithCompletionHandler:))]
1425 #[unsafe(method_family = init)]
1426 pub unsafe fn initWithCompletionHandler(
1427 this: Allocated<Self>,
1428 completion_handler: VNRequestCompletionHandler,
1429 ) -> Retained<Self>;
1430
1431 #[cfg(all(feature = "VNRequestHandler", feature = "objc2-core-video"))]
1432 /// Create a new request that targets an image in a pixel buffer.
1433 ///
1434 ///
1435 /// Parameter `pixelBuffer`: The pixel buffer containing the targeted image.
1436 ///
1437 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
1438 ///
1439 /// # Safety
1440 ///
1441 /// `options` generic should be of the correct type.
1442 #[unsafe(method(initWithTargetedCVPixelBuffer:options:))]
1443 #[unsafe(method_family = init)]
1444 pub unsafe fn initWithTargetedCVPixelBuffer_options(
1445 this: Allocated<Self>,
1446 pixel_buffer: &CVPixelBuffer,
1447 options: &NSDictionary<VNImageOption, AnyObject>,
1448 ) -> Retained<Self>;
1449
1450 #[cfg(all(
1451 feature = "VNRequestHandler",
1452 feature = "block2",
1453 feature = "objc2-core-video"
1454 ))]
1455 /// Create a new request that targets an image in a pixel buffer.
1456 ///
1457 ///
1458 /// Parameter `pixelBuffer`: The pixel buffer containing the targeted image.
1459 ///
1460 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
1461 ///
1462 /// Parameter `completionHandler`: The block that is invoked when the request has been performed.
1463 ///
1464 /// # Safety
1465 ///
1466 /// - `options` generic should be of the correct type.
1467 /// - `completion_handler` must be a valid pointer or null.
1468 #[unsafe(method(initWithTargetedCVPixelBuffer:options:completionHandler:))]
1469 #[unsafe(method_family = init)]
1470 pub unsafe fn initWithTargetedCVPixelBuffer_options_completionHandler(
1471 this: Allocated<Self>,
1472 pixel_buffer: &CVPixelBuffer,
1473 options: &NSDictionary<VNImageOption, AnyObject>,
1474 completion_handler: VNRequestCompletionHandler,
1475 ) -> Retained<Self>;
1476
1477 #[cfg(all(
1478 feature = "VNRequestHandler",
1479 feature = "objc2-core-video",
1480 feature = "objc2-image-io"
1481 ))]
1482 /// Create a new request that targets an image in a pixel buffer.
1483 ///
1484 ///
1485 /// Parameter `pixelBuffer`: The pixel buffer containing the targeted image.
1486 ///
1487 /// Parameter `orientation`: The orientation of the image/buffer based on the EXIF specification. For details see kCGImagePropertyOrientation. The value has to be an integer from 1 to 8. This supersedes every other orientation information.
1488 ///
1489 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
1490 ///
1491 /// # Safety
1492 ///
1493 /// `options` generic should be of the correct type.
1494 #[unsafe(method(initWithTargetedCVPixelBuffer:orientation:options:))]
1495 #[unsafe(method_family = init)]
1496 pub unsafe fn initWithTargetedCVPixelBuffer_orientation_options(
1497 this: Allocated<Self>,
1498 pixel_buffer: &CVPixelBuffer,
1499 orientation: CGImagePropertyOrientation,
1500 options: &NSDictionary<VNImageOption, AnyObject>,
1501 ) -> Retained<Self>;
1502
1503 #[cfg(all(
1504 feature = "VNRequestHandler",
1505 feature = "block2",
1506 feature = "objc2-core-video",
1507 feature = "objc2-image-io"
1508 ))]
1509 /// Create a new request that targets an image in a pixel buffer.
1510 ///
1511 ///
1512 /// Parameter `pixelBuffer`: The pixel buffer containing the targeted image.
1513 ///
1514 /// Parameter `orientation`: The orientation of the image/buffer based on the EXIF specification. For details see kCGImagePropertyOrientation. The value has to be an integer from 1 to 8. This supersedes every other orientation information.
1515 ///
1516 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
1517 ///
1518 /// Parameter `completionHandler`: The block that is invoked when the request has been performed.
1519 ///
1520 /// # Safety
1521 ///
1522 /// - `options` generic should be of the correct type.
1523 /// - `completion_handler` must be a valid pointer or null.
1524 #[unsafe(method(initWithTargetedCVPixelBuffer:orientation:options:completionHandler:))]
1525 #[unsafe(method_family = init)]
1526 pub unsafe fn initWithTargetedCVPixelBuffer_orientation_options_completionHandler(
1527 this: Allocated<Self>,
1528 pixel_buffer: &CVPixelBuffer,
1529 orientation: CGImagePropertyOrientation,
1530 options: &NSDictionary<VNImageOption, AnyObject>,
1531 completion_handler: VNRequestCompletionHandler,
1532 ) -> Retained<Self>;
1533
1534 #[cfg(all(feature = "VNRequestHandler", feature = "objc2-core-graphics"))]
1535 /// Create a new request with a targeted CGImage.
1536 ///
1537 ///
1538 /// Parameter `cgImage`: The CGImageRef of the targeted image.
1539 ///
1540 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
1541 ///
1542 /// # Safety
1543 ///
1544 /// `options` generic should be of the correct type.
1545 #[unsafe(method(initWithTargetedCGImage:options:))]
1546 #[unsafe(method_family = init)]
1547 pub unsafe fn initWithTargetedCGImage_options(
1548 this: Allocated<Self>,
1549 cg_image: &CGImage,
1550 options: &NSDictionary<VNImageOption, AnyObject>,
1551 ) -> Retained<Self>;
1552
1553 #[cfg(all(
1554 feature = "VNRequestHandler",
1555 feature = "block2",
1556 feature = "objc2-core-graphics"
1557 ))]
1558 /// Create a new request with a targeted CGImage.
1559 ///
1560 ///
1561 /// Parameter `cgImage`: The CGImageRef of the targeted image.
1562 ///
1563 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
1564 ///
1565 /// Parameter `completionHandler`: The block that is invoked when the request has been performed.
1566 ///
1567 /// # Safety
1568 ///
1569 /// - `options` generic should be of the correct type.
1570 /// - `completion_handler` must be a valid pointer or null.
1571 #[unsafe(method(initWithTargetedCGImage:options:completionHandler:))]
1572 #[unsafe(method_family = init)]
1573 pub unsafe fn initWithTargetedCGImage_options_completionHandler(
1574 this: Allocated<Self>,
1575 cg_image: &CGImage,
1576 options: &NSDictionary<VNImageOption, AnyObject>,
1577 completion_handler: VNRequestCompletionHandler,
1578 ) -> Retained<Self>;
1579
1580 #[cfg(all(
1581 feature = "VNRequestHandler",
1582 feature = "objc2-core-graphics",
1583 feature = "objc2-image-io"
1584 ))]
1585 /// Create a new request with a targeted CGImage.
1586 ///
1587 ///
1588 /// Parameter `cgImage`: The CGImageRef of the targeted image.
1589 ///
1590 /// Parameter `orientation`: The orientation of the image/buffer based on the EXIF specification. For details see kCGImagePropertyOrientation. The value has to be an integer from 1 to 8. This supersedes every other orientation information.
1591 ///
1592 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
1593 ///
1594 /// # Safety
1595 ///
1596 /// `options` generic should be of the correct type.
1597 #[unsafe(method(initWithTargetedCGImage:orientation:options:))]
1598 #[unsafe(method_family = init)]
1599 pub unsafe fn initWithTargetedCGImage_orientation_options(
1600 this: Allocated<Self>,
1601 cg_image: &CGImage,
1602 orientation: CGImagePropertyOrientation,
1603 options: &NSDictionary<VNImageOption, AnyObject>,
1604 ) -> Retained<Self>;
1605
1606 #[cfg(all(
1607 feature = "VNRequestHandler",
1608 feature = "block2",
1609 feature = "objc2-core-graphics",
1610 feature = "objc2-image-io"
1611 ))]
1612 /// Create a new request with a targeted CGImage.
1613 ///
1614 ///
1615 /// Parameter `cgImage`: The CGImageRef of the targeted image.
1616 ///
1617 /// Parameter `orientation`: The orientation of the image/buffer based on the EXIF specification. For details see kCGImagePropertyOrientation. The value has to be an integer from 1 to 8. This supersedes every other orientation information.
1618 ///
1619 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
1620 ///
1621 /// Parameter `completionHandler`: The block that is invoked when the request has been performed.
1622 ///
1623 /// # Safety
1624 ///
1625 /// - `options` generic should be of the correct type.
1626 /// - `completion_handler` must be a valid pointer or null.
1627 #[unsafe(method(initWithTargetedCGImage:orientation:options:completionHandler:))]
1628 #[unsafe(method_family = init)]
1629 pub unsafe fn initWithTargetedCGImage_orientation_options_completionHandler(
1630 this: Allocated<Self>,
1631 cg_image: &CGImage,
1632 orientation: CGImagePropertyOrientation,
1633 options: &NSDictionary<VNImageOption, AnyObject>,
1634 completion_handler: VNRequestCompletionHandler,
1635 ) -> Retained<Self>;
1636
1637 #[cfg(all(feature = "VNRequestHandler", feature = "objc2-core-image"))]
1638 /// Create a new request with a targeted CIImage.
1639 ///
1640 ///
1641 /// Parameter `ciImage`: The CIImage of the targeted image.
1642 ///
1643 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
1644 ///
1645 /// # Safety
1646 ///
1647 /// `options` generic should be of the correct type.
1648 #[unsafe(method(initWithTargetedCIImage:options:))]
1649 #[unsafe(method_family = init)]
1650 pub unsafe fn initWithTargetedCIImage_options(
1651 this: Allocated<Self>,
1652 ci_image: &CIImage,
1653 options: &NSDictionary<VNImageOption, AnyObject>,
1654 ) -> Retained<Self>;
1655
1656 #[cfg(all(
1657 feature = "VNRequestHandler",
1658 feature = "block2",
1659 feature = "objc2-core-image"
1660 ))]
1661 /// Create a new request with a targeted CIImage.
1662 ///
1663 ///
1664 /// Parameter `ciImage`: The CIImage of the targeted image.
1665 ///
1666 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
1667 ///
1668 /// Parameter `completionHandler`: The block that is invoked when the request has been performed.
1669 ///
1670 /// # Safety
1671 ///
1672 /// - `options` generic should be of the correct type.
1673 /// - `completion_handler` must be a valid pointer or null.
1674 #[unsafe(method(initWithTargetedCIImage:options:completionHandler:))]
1675 #[unsafe(method_family = init)]
1676 pub unsafe fn initWithTargetedCIImage_options_completionHandler(
1677 this: Allocated<Self>,
1678 ci_image: &CIImage,
1679 options: &NSDictionary<VNImageOption, AnyObject>,
1680 completion_handler: VNRequestCompletionHandler,
1681 ) -> Retained<Self>;
1682
1683 #[cfg(all(
1684 feature = "VNRequestHandler",
1685 feature = "objc2-core-image",
1686 feature = "objc2-image-io"
1687 ))]
1688 /// Create a new request with a targeted CIImage.
1689 ///
1690 ///
1691 /// Parameter `ciImage`: The CIImage of the targeted image.
1692 ///
1693 /// Parameter `orientation`: The orientation of the image/buffer based on the EXIF specification. For details see kCGImagePropertyOrientation. The value has to be an integer from 1 to 8. This supersedes every other orientation information.
1694 ///
1695 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
1696 ///
1697 /// # Safety
1698 ///
1699 /// `options` generic should be of the correct type.
1700 #[unsafe(method(initWithTargetedCIImage:orientation:options:))]
1701 #[unsafe(method_family = init)]
1702 pub unsafe fn initWithTargetedCIImage_orientation_options(
1703 this: Allocated<Self>,
1704 ci_image: &CIImage,
1705 orientation: CGImagePropertyOrientation,
1706 options: &NSDictionary<VNImageOption, AnyObject>,
1707 ) -> Retained<Self>;
1708
1709 #[cfg(all(
1710 feature = "VNRequestHandler",
1711 feature = "block2",
1712 feature = "objc2-core-image",
1713 feature = "objc2-image-io"
1714 ))]
1715 /// Create a new request with a targeted CIImage.
1716 ///
1717 ///
1718 /// Parameter `ciImage`: The CIImage of the targeted image.
1719 ///
1720 /// Parameter `orientation`: The orientation of the image/buffer based on the EXIF specification. For details see kCGImagePropertyOrientation. The value has to be an integer from 1 to 8. This supersedes every other orientation information.
1721 ///
1722 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
1723 ///
1724 /// Parameter `completionHandler`: The block that is invoked when the request has been performed.
1725 ///
1726 /// # Safety
1727 ///
1728 /// - `options` generic should be of the correct type.
1729 /// - `completion_handler` must be a valid pointer or null.
1730 #[unsafe(method(initWithTargetedCIImage:orientation:options:completionHandler:))]
1731 #[unsafe(method_family = init)]
1732 pub unsafe fn initWithTargetedCIImage_orientation_options_completionHandler(
1733 this: Allocated<Self>,
1734 ci_image: &CIImage,
1735 orientation: CGImagePropertyOrientation,
1736 options: &NSDictionary<VNImageOption, AnyObject>,
1737 completion_handler: VNRequestCompletionHandler,
1738 ) -> Retained<Self>;
1739
1740 #[cfg(feature = "VNRequestHandler")]
1741 /// Create a new request with a targeted image URL.
1742 ///
1743 ///
1744 /// Parameter `imageURL`: The URL of the targeted image.
1745 ///
1746 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
1747 ///
1748 /// # Safety
1749 ///
1750 /// `options` generic should be of the correct type.
1751 #[unsafe(method(initWithTargetedImageURL:options:))]
1752 #[unsafe(method_family = init)]
1753 pub unsafe fn initWithTargetedImageURL_options(
1754 this: Allocated<Self>,
1755 image_url: &NSURL,
1756 options: &NSDictionary<VNImageOption, AnyObject>,
1757 ) -> Retained<Self>;
1758
1759 #[cfg(all(feature = "VNRequestHandler", feature = "block2"))]
1760 /// Create a new request with a targeted image URL.
1761 ///
1762 ///
1763 /// Parameter `imageURL`: The URL of the targeted image.
1764 ///
1765 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
1766 ///
1767 /// Parameter `completionHandler`: The block that is invoked when the request has been performed.
1768 ///
1769 /// # Safety
1770 ///
1771 /// - `options` generic should be of the correct type.
1772 /// - `completion_handler` must be a valid pointer or null.
1773 #[unsafe(method(initWithTargetedImageURL:options:completionHandler:))]
1774 #[unsafe(method_family = init)]
1775 pub unsafe fn initWithTargetedImageURL_options_completionHandler(
1776 this: Allocated<Self>,
1777 image_url: &NSURL,
1778 options: &NSDictionary<VNImageOption, AnyObject>,
1779 completion_handler: VNRequestCompletionHandler,
1780 ) -> Retained<Self>;
1781
1782 #[cfg(all(feature = "VNRequestHandler", feature = "objc2-image-io"))]
1783 /// Create a new request with a targeted image URL.
1784 ///
1785 ///
1786 /// Parameter `imageURL`: The URL of the targeted image.
1787 ///
1788 /// Parameter `orientation`: The orientation of the image/buffer based on the EXIF specification. For details see kCGImagePropertyOrientation. The value has to be an integer from 1 to 8. This supersedes every other orientation information.
1789 ///
1790 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
1791 ///
1792 /// # Safety
1793 ///
1794 /// `options` generic should be of the correct type.
1795 #[unsafe(method(initWithTargetedImageURL:orientation:options:))]
1796 #[unsafe(method_family = init)]
1797 pub unsafe fn initWithTargetedImageURL_orientation_options(
1798 this: Allocated<Self>,
1799 image_url: &NSURL,
1800 orientation: CGImagePropertyOrientation,
1801 options: &NSDictionary<VNImageOption, AnyObject>,
1802 ) -> Retained<Self>;
1803
1804 #[cfg(all(
1805 feature = "VNRequestHandler",
1806 feature = "block2",
1807 feature = "objc2-image-io"
1808 ))]
1809 /// Create a new request with a targeted image URL.
1810 ///
1811 ///
1812 /// Parameter `imageURL`: The URL of the targeted image.
1813 ///
1814 /// Parameter `orientation`: The orientation of the image/buffer based on the EXIF specification. For details see kCGImagePropertyOrientation. The value has to be an integer from 1 to 8. This supersedes every other orientation information.
1815 ///
1816 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
1817 ///
1818 /// Parameter `completionHandler`: The block that is invoked when the request has been performed.
1819 ///
1820 /// # Safety
1821 ///
1822 /// - `options` generic should be of the correct type.
1823 /// - `completion_handler` must be a valid pointer or null.
1824 #[unsafe(method(initWithTargetedImageURL:orientation:options:completionHandler:))]
1825 #[unsafe(method_family = init)]
1826 pub unsafe fn initWithTargetedImageURL_orientation_options_completionHandler(
1827 this: Allocated<Self>,
1828 image_url: &NSURL,
1829 orientation: CGImagePropertyOrientation,
1830 options: &NSDictionary<VNImageOption, AnyObject>,
1831 completion_handler: VNRequestCompletionHandler,
1832 ) -> Retained<Self>;
1833
1834 #[cfg(feature = "VNRequestHandler")]
1835 /// Create a new request with a targeted image data.
1836 ///
1837 ///
1838 /// Parameter `imageData`: The data of the targeted image.
1839 ///
1840 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
1841 ///
1842 /// # Safety
1843 ///
1844 /// `options` generic should be of the correct type.
1845 #[unsafe(method(initWithTargetedImageData:options:))]
1846 #[unsafe(method_family = init)]
1847 pub unsafe fn initWithTargetedImageData_options(
1848 this: Allocated<Self>,
1849 image_data: &NSData,
1850 options: &NSDictionary<VNImageOption, AnyObject>,
1851 ) -> Retained<Self>;
1852
1853 #[cfg(all(feature = "VNRequestHandler", feature = "block2"))]
1854 /// Create a new request with a targeted image data.
1855 ///
1856 ///
1857 /// Parameter `imageData`: The data of the targeted image.
1858 ///
1859 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
1860 ///
1861 /// Parameter `completionHandler`: The block that is invoked when the request has been performed.
1862 ///
1863 /// # Safety
1864 ///
1865 /// - `options` generic should be of the correct type.
1866 /// - `completion_handler` must be a valid pointer or null.
1867 #[unsafe(method(initWithTargetedImageData:options:completionHandler:))]
1868 #[unsafe(method_family = init)]
1869 pub unsafe fn initWithTargetedImageData_options_completionHandler(
1870 this: Allocated<Self>,
1871 image_data: &NSData,
1872 options: &NSDictionary<VNImageOption, AnyObject>,
1873 completion_handler: VNRequestCompletionHandler,
1874 ) -> Retained<Self>;
1875
1876 #[cfg(all(feature = "VNRequestHandler", feature = "objc2-image-io"))]
1877 /// Create a new request with a targeted image data.
1878 ///
1879 ///
1880 /// Parameter `imageData`: The data of the targeted image.
1881 ///
1882 /// Parameter `orientation`: The orientation of the image/buffer based on the EXIF specification. For details see kCGImagePropertyOrientation. The value has to be an integer from 1 to 8. This supersedes every other orientation information.
1883 ///
1884 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
1885 ///
1886 /// # Safety
1887 ///
1888 /// `options` generic should be of the correct type.
1889 #[unsafe(method(initWithTargetedImageData:orientation:options:))]
1890 #[unsafe(method_family = init)]
1891 pub unsafe fn initWithTargetedImageData_orientation_options(
1892 this: Allocated<Self>,
1893 image_data: &NSData,
1894 orientation: CGImagePropertyOrientation,
1895 options: &NSDictionary<VNImageOption, AnyObject>,
1896 ) -> Retained<Self>;
1897
1898 #[cfg(all(
1899 feature = "VNRequestHandler",
1900 feature = "block2",
1901 feature = "objc2-image-io"
1902 ))]
1903 /// Create a new request with a targeted image data.
1904 ///
1905 ///
1906 /// Parameter `imageData`: The data of the targeted image.
1907 ///
1908 /// Parameter `orientation`: The orientation of the image/buffer based on the EXIF specification. For details see kCGImagePropertyOrientation. The value has to be an integer from 1 to 8. This supersedes every other orientation information.
1909 ///
1910 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
1911 ///
1912 /// Parameter `completionHandler`: The block that is invoked when the request has been performed.
1913 ///
1914 /// # Safety
1915 ///
1916 /// - `options` generic should be of the correct type.
1917 /// - `completion_handler` must be a valid pointer or null.
1918 #[unsafe(method(initWithTargetedImageData:orientation:options:completionHandler:))]
1919 #[unsafe(method_family = init)]
1920 pub unsafe fn initWithTargetedImageData_orientation_options_completionHandler(
1921 this: Allocated<Self>,
1922 image_data: &NSData,
1923 orientation: CGImagePropertyOrientation,
1924 options: &NSDictionary<VNImageOption, AnyObject>,
1925 completion_handler: VNRequestCompletionHandler,
1926 ) -> Retained<Self>;
1927
1928 #[cfg(all(feature = "VNRequestHandler", feature = "objc2-core-media"))]
1929 /// Create a new request with a targeted CMSampleBuffer.
1930 ///
1931 ///
1932 /// Parameter `sampleBuffer`: The CMSampleBuffer containing the CVImageBuffer to be used by the request.
1933 ///
1934 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
1935 ///
1936 /// # Safety
1937 ///
1938 /// `options` generic should be of the correct type.
1939 #[unsafe(method(initWithTargetedCMSampleBuffer:options:))]
1940 #[unsafe(method_family = init)]
1941 pub unsafe fn initWithTargetedCMSampleBuffer_options(
1942 this: Allocated<Self>,
1943 sample_buffer: &CMSampleBuffer,
1944 options: &NSDictionary<VNImageOption, AnyObject>,
1945 ) -> Retained<Self>;
1946
1947 #[cfg(all(
1948 feature = "VNRequestHandler",
1949 feature = "block2",
1950 feature = "objc2-core-media"
1951 ))]
1952 /// Create a new request with a targeted CMSampleBuffer.
1953 ///
1954 ///
1955 /// Parameter `sampleBuffer`: The CMSampleBuffer containing the CVImageBuffer to be used by the request.
1956 ///
1957 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
1958 ///
1959 /// Parameter `completionHandler`: The block that is invoked after the request has been performed.
1960 ///
1961 /// # Safety
1962 ///
1963 /// - `options` generic should be of the correct type.
1964 /// - `completion_handler` must be a valid pointer or null.
1965 #[unsafe(method(initWithTargetedCMSampleBuffer:options:completionHandler:))]
1966 #[unsafe(method_family = init)]
1967 pub unsafe fn initWithTargetedCMSampleBuffer_options_completionHandler(
1968 this: Allocated<Self>,
1969 sample_buffer: &CMSampleBuffer,
1970 options: &NSDictionary<VNImageOption, AnyObject>,
1971 completion_handler: VNRequestCompletionHandler,
1972 ) -> Retained<Self>;
1973
1974 #[cfg(all(
1975 feature = "VNRequestHandler",
1976 feature = "objc2-core-media",
1977 feature = "objc2-image-io"
1978 ))]
1979 /// Create a new request with a targeted CMSampleBuffer.
1980 ///
1981 ///
1982 /// Parameter `sampleBuffer`: The CMSampleBuffer containing the CVImageBuffer to be used by the request.
1983 ///
1984 /// Parameter `orientation`: The orientation of the image/buffer based on the EXIF specification. For details see kCGImagePropertyOrientation. The value has to be an integer from 1 to 8. This supersedes every other orientation information.
1985 ///
1986 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
1987 ///
1988 /// # Safety
1989 ///
1990 /// `options` generic should be of the correct type.
1991 #[unsafe(method(initWithTargetedCMSampleBuffer:orientation:options:))]
1992 #[unsafe(method_family = init)]
1993 pub unsafe fn initWithTargetedCMSampleBuffer_orientation_options(
1994 this: Allocated<Self>,
1995 sample_buffer: &CMSampleBuffer,
1996 orientation: CGImagePropertyOrientation,
1997 options: &NSDictionary<VNImageOption, AnyObject>,
1998 ) -> Retained<Self>;
1999
2000 #[cfg(all(
2001 feature = "VNRequestHandler",
2002 feature = "block2",
2003 feature = "objc2-core-media",
2004 feature = "objc2-image-io"
2005 ))]
2006 /// Create a new request with a targeted CMSampleBuffer.
2007 ///
2008 ///
2009 /// Parameter `sampleBuffer`: The CMSampleBuffer containing the CVImageBuffer to be used by the request.
2010 ///
2011 /// Parameter `orientation`: The orientation of the image/buffer based on the EXIF specification. For details see kCGImagePropertyOrientation. The value has to be an integer from 1 to 8. This supersedes every other orientation information.
2012 ///
2013 /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
2014 ///
2015 /// Parameter `completionHandler`: The block that is invoked after the request has been performed.
2016 ///
2017 /// # Safety
2018 ///
2019 /// - `options` generic should be of the correct type.
2020 /// - `completion_handler` must be a valid pointer or null.
2021 #[unsafe(method(initWithTargetedCMSampleBuffer:orientation:options:completionHandler:))]
2022 #[unsafe(method_family = init)]
2023 pub unsafe fn initWithTargetedCMSampleBuffer_orientation_options_completionHandler(
2024 this: Allocated<Self>,
2025 sample_buffer: &CMSampleBuffer,
2026 orientation: CGImagePropertyOrientation,
2027 options: &NSDictionary<VNImageOption, AnyObject>,
2028 completion_handler: VNRequestCompletionHandler,
2029 ) -> Retained<Self>;
2030 );
2031}
2032
2033/// Methods declared on superclass `NSObject`.
2034#[cfg(all(feature = "VNRequest", feature = "VNTargetedImageRequest"))]
2035impl VNHomographicImageRegistrationRequest {
2036 extern_methods!(
2037 #[unsafe(method(new))]
2038 #[unsafe(method_family = new)]
2039 pub unsafe fn new() -> Retained<Self>;
2040 );
2041}
2042
2043/// [Apple's documentation](https://developer.apple.com/documentation/vision/vnhomographicimageregistrationrequestrevision1?language=objc)
2044pub static VNHomographicImageRegistrationRequestRevision1: NSUInteger = 1;