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
15use crate::*;
16
17extern_class!(
18    /// A request that will calculate a transformation for morphing a "floating" image onto an unchanging "reference" image.
19    ///
20    ///
21    /// 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.
22    ///
23    /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vnimageregistrationrequest?language=objc)
24    #[unsafe(super(VNTargetedImageRequest, VNImageBasedRequest, VNRequest, NSObject))]
25    #[derive(Debug, PartialEq, Eq, Hash)]
26    #[cfg(all(feature = "VNRequest", feature = "VNTargetedImageRequest"))]
27    pub struct VNImageRegistrationRequest;
28);
29
30#[cfg(all(feature = "VNRequest", feature = "VNTargetedImageRequest"))]
31unsafe impl NSCopying for VNImageRegistrationRequest {}
32
33#[cfg(all(feature = "VNRequest", feature = "VNTargetedImageRequest"))]
34unsafe impl CopyingHelper for VNImageRegistrationRequest {
35    type Result = Self;
36}
37
38#[cfg(all(feature = "VNRequest", feature = "VNTargetedImageRequest"))]
39unsafe impl NSObjectProtocol for VNImageRegistrationRequest {}
40
41#[cfg(all(feature = "VNRequest", feature = "VNTargetedImageRequest"))]
42impl VNImageRegistrationRequest {
43    extern_methods!();
44}
45
46/// Methods declared on superclass `VNTargetedImageRequest`.
47#[cfg(all(feature = "VNRequest", feature = "VNTargetedImageRequest"))]
48impl VNImageRegistrationRequest {
49    extern_methods!(
50        #[unsafe(method(init))]
51        #[unsafe(method_family = init)]
52        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
53
54        #[cfg(feature = "block2")]
55        #[unsafe(method(initWithCompletionHandler:))]
56        #[unsafe(method_family = init)]
57        pub unsafe fn initWithCompletionHandler(
58            this: Allocated<Self>,
59            completion_handler: VNRequestCompletionHandler,
60        ) -> Retained<Self>;
61
62        #[cfg(all(feature = "VNRequestHandler", feature = "objc2-core-video"))]
63        /// Create a new request that targets an image in a pixel buffer.
64        ///
65        ///
66        /// Parameter `pixelBuffer`: The pixel buffer containing the targeted image.
67        ///
68        /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
69        #[unsafe(method(initWithTargetedCVPixelBuffer:options:))]
70        #[unsafe(method_family = init)]
71        pub unsafe fn initWithTargetedCVPixelBuffer_options(
72            this: Allocated<Self>,
73            pixel_buffer: &CVPixelBuffer,
74            options: &NSDictionary<VNImageOption, AnyObject>,
75        ) -> Retained<Self>;
76
77        #[cfg(all(
78            feature = "VNRequestHandler",
79            feature = "block2",
80            feature = "objc2-core-video"
81        ))]
82        /// Create a new request that targets an image in a pixel buffer.
83        ///
84        ///
85        /// Parameter `pixelBuffer`: The pixel buffer containing the targeted image.
86        ///
87        /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
88        ///
89        /// Parameter `completionHandler`: The block that is invoked when the request has been performed.
90        #[unsafe(method(initWithTargetedCVPixelBuffer:options:completionHandler:))]
91        #[unsafe(method_family = init)]
92        pub unsafe fn initWithTargetedCVPixelBuffer_options_completionHandler(
93            this: Allocated<Self>,
94            pixel_buffer: &CVPixelBuffer,
95            options: &NSDictionary<VNImageOption, AnyObject>,
96            completion_handler: VNRequestCompletionHandler,
97        ) -> Retained<Self>;
98
99        #[cfg(all(feature = "VNRequestHandler", feature = "objc2-core-graphics"))]
100        /// Create a new request with a targeted CGImage.
101        ///
102        ///
103        /// Parameter `cgImage`: The CGImageRef of the targeted image.
104        ///
105        /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
106        #[unsafe(method(initWithTargetedCGImage:options:))]
107        #[unsafe(method_family = init)]
108        pub unsafe fn initWithTargetedCGImage_options(
109            this: Allocated<Self>,
110            cg_image: &CGImage,
111            options: &NSDictionary<VNImageOption, AnyObject>,
112        ) -> Retained<Self>;
113
114        #[cfg(all(
115            feature = "VNRequestHandler",
116            feature = "block2",
117            feature = "objc2-core-graphics"
118        ))]
119        /// Create a new request with a targeted CGImage.
120        ///
121        ///
122        /// Parameter `cgImage`: The CGImageRef of the targeted image.
123        ///
124        /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
125        ///
126        /// Parameter `completionHandler`: The block that is invoked when the request has been performed.
127        #[unsafe(method(initWithTargetedCGImage:options:completionHandler:))]
128        #[unsafe(method_family = init)]
129        pub unsafe fn initWithTargetedCGImage_options_completionHandler(
130            this: Allocated<Self>,
131            cg_image: &CGImage,
132            options: &NSDictionary<VNImageOption, AnyObject>,
133            completion_handler: VNRequestCompletionHandler,
134        ) -> Retained<Self>;
135
136        #[cfg(all(feature = "VNRequestHandler", feature = "objc2-core-image"))]
137        /// Create a new request with a targeted CIImage.
138        ///
139        ///
140        /// Parameter `ciImage`: The CIImage of the targeted image.
141        ///
142        /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
143        #[unsafe(method(initWithTargetedCIImage:options:))]
144        #[unsafe(method_family = init)]
145        pub unsafe fn initWithTargetedCIImage_options(
146            this: Allocated<Self>,
147            ci_image: &CIImage,
148            options: &NSDictionary<VNImageOption, AnyObject>,
149        ) -> Retained<Self>;
150
151        #[cfg(all(
152            feature = "VNRequestHandler",
153            feature = "block2",
154            feature = "objc2-core-image"
155        ))]
156        /// Create a new request with a targeted CIImage.
157        ///
158        ///
159        /// Parameter `ciImage`: The CIImage of the targeted image.
160        ///
161        /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
162        ///
163        /// Parameter `completionHandler`: The block that is invoked when the request has been performed.
164        #[unsafe(method(initWithTargetedCIImage:options:completionHandler:))]
165        #[unsafe(method_family = init)]
166        pub unsafe fn initWithTargetedCIImage_options_completionHandler(
167            this: Allocated<Self>,
168            ci_image: &CIImage,
169            options: &NSDictionary<VNImageOption, AnyObject>,
170            completion_handler: VNRequestCompletionHandler,
171        ) -> Retained<Self>;
172
173        #[cfg(feature = "VNRequestHandler")]
174        /// Create a new request with a targeted image URL.
175        ///
176        ///
177        /// Parameter `imageURL`: The URL of the targeted image.
178        ///
179        /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
180        #[unsafe(method(initWithTargetedImageURL:options:))]
181        #[unsafe(method_family = init)]
182        pub unsafe fn initWithTargetedImageURL_options(
183            this: Allocated<Self>,
184            image_url: &NSURL,
185            options: &NSDictionary<VNImageOption, AnyObject>,
186        ) -> Retained<Self>;
187
188        #[cfg(all(feature = "VNRequestHandler", feature = "block2"))]
189        /// Create a new request with a targeted image URL.
190        ///
191        ///
192        /// Parameter `imageURL`: The URL of the targeted image.
193        ///
194        /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
195        ///
196        /// Parameter `completionHandler`: The block that is invoked when the request has been performed.
197        #[unsafe(method(initWithTargetedImageURL:options:completionHandler:))]
198        #[unsafe(method_family = init)]
199        pub unsafe fn initWithTargetedImageURL_options_completionHandler(
200            this: Allocated<Self>,
201            image_url: &NSURL,
202            options: &NSDictionary<VNImageOption, AnyObject>,
203            completion_handler: VNRequestCompletionHandler,
204        ) -> Retained<Self>;
205
206        #[cfg(feature = "VNRequestHandler")]
207        /// Create a new request with a targeted image data.
208        ///
209        ///
210        /// Parameter `imageData`: The data of the targeted image.
211        ///
212        /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
213        #[unsafe(method(initWithTargetedImageData:options:))]
214        #[unsafe(method_family = init)]
215        pub unsafe fn initWithTargetedImageData_options(
216            this: Allocated<Self>,
217            image_data: &NSData,
218            options: &NSDictionary<VNImageOption, AnyObject>,
219        ) -> Retained<Self>;
220
221        #[cfg(all(feature = "VNRequestHandler", feature = "block2"))]
222        /// Create a new request with a targeted image data.
223        ///
224        ///
225        /// Parameter `imageData`: The data of the targeted image.
226        ///
227        /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
228        ///
229        /// Parameter `completionHandler`: The block that is invoked when the request has been performed.
230        #[unsafe(method(initWithTargetedImageData:options:completionHandler:))]
231        #[unsafe(method_family = init)]
232        pub unsafe fn initWithTargetedImageData_options_completionHandler(
233            this: Allocated<Self>,
234            image_data: &NSData,
235            options: &NSDictionary<VNImageOption, AnyObject>,
236            completion_handler: VNRequestCompletionHandler,
237        ) -> Retained<Self>;
238
239        #[cfg(all(feature = "VNRequestHandler", feature = "objc2-core-media"))]
240        /// Create a new request with a targeted CMSampleBuffer.
241        ///
242        ///
243        /// Parameter `sampleBuffer`: The CMSampleBuffer containing the CVImageBuffer to be used by the request.
244        ///
245        /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
246        #[unsafe(method(initWithTargetedCMSampleBuffer:options:))]
247        #[unsafe(method_family = init)]
248        pub unsafe fn initWithTargetedCMSampleBuffer_options(
249            this: Allocated<Self>,
250            sample_buffer: &CMSampleBuffer,
251            options: &NSDictionary<VNImageOption, AnyObject>,
252        ) -> Retained<Self>;
253
254        #[cfg(all(
255            feature = "VNRequestHandler",
256            feature = "block2",
257            feature = "objc2-core-media"
258        ))]
259        /// Create a new request with a targeted CMSampleBuffer.
260        ///
261        ///
262        /// Parameter `sampleBuffer`: The CMSampleBuffer containing the CVImageBuffer to be used by the request.
263        ///
264        /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
265        ///
266        /// Parameter `completionHandler`: The block that is invoked after the request has been performed.
267        #[unsafe(method(initWithTargetedCMSampleBuffer:options:completionHandler:))]
268        #[unsafe(method_family = init)]
269        pub unsafe fn initWithTargetedCMSampleBuffer_options_completionHandler(
270            this: Allocated<Self>,
271            sample_buffer: &CMSampleBuffer,
272            options: &NSDictionary<VNImageOption, AnyObject>,
273            completion_handler: VNRequestCompletionHandler,
274        ) -> Retained<Self>;
275    );
276}
277
278/// Methods declared on superclass `NSObject`.
279#[cfg(all(feature = "VNRequest", feature = "VNTargetedImageRequest"))]
280impl VNImageRegistrationRequest {
281    extern_methods!(
282        #[unsafe(method(new))]
283        #[unsafe(method_family = new)]
284        pub unsafe fn new() -> Retained<Self>;
285    );
286}
287
288extern_class!(
289    /// An image registration request that will calculate a translational transformation for morphing a "floating" image onto an unchanging "reference" image.
290    ///
291    ///
292    /// 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.
293    ///
294    /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vntranslationalimageregistrationrequest?language=objc)
295    #[unsafe(super(
296        VNImageRegistrationRequest,
297        VNTargetedImageRequest,
298        VNImageBasedRequest,
299        VNRequest,
300        NSObject
301    ))]
302    #[derive(Debug, PartialEq, Eq, Hash)]
303    #[cfg(all(feature = "VNRequest", feature = "VNTargetedImageRequest"))]
304    pub struct VNTranslationalImageRegistrationRequest;
305);
306
307#[cfg(all(feature = "VNRequest", feature = "VNTargetedImageRequest"))]
308unsafe impl NSCopying for VNTranslationalImageRegistrationRequest {}
309
310#[cfg(all(feature = "VNRequest", feature = "VNTargetedImageRequest"))]
311unsafe impl CopyingHelper for VNTranslationalImageRegistrationRequest {
312    type Result = Self;
313}
314
315#[cfg(all(feature = "VNRequest", feature = "VNTargetedImageRequest"))]
316unsafe impl NSObjectProtocol for VNTranslationalImageRegistrationRequest {}
317
318#[cfg(all(feature = "VNRequest", feature = "VNTargetedImageRequest"))]
319impl VNTranslationalImageRegistrationRequest {
320    extern_methods!(
321        #[cfg(feature = "VNObservation")]
322        /// VNImageTranslationAlignmentObservation results.
323        #[unsafe(method(results))]
324        #[unsafe(method_family = none)]
325        pub unsafe fn results(
326            &self,
327        ) -> Option<Retained<NSArray<VNImageTranslationAlignmentObservation>>>;
328    );
329}
330
331/// Methods declared on superclass `VNTargetedImageRequest`.
332#[cfg(all(feature = "VNRequest", feature = "VNTargetedImageRequest"))]
333impl VNTranslationalImageRegistrationRequest {
334    extern_methods!(
335        #[unsafe(method(init))]
336        #[unsafe(method_family = init)]
337        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
338
339        #[cfg(feature = "block2")]
340        #[unsafe(method(initWithCompletionHandler:))]
341        #[unsafe(method_family = init)]
342        pub unsafe fn initWithCompletionHandler(
343            this: Allocated<Self>,
344            completion_handler: VNRequestCompletionHandler,
345        ) -> Retained<Self>;
346
347        #[cfg(all(feature = "VNRequestHandler", feature = "objc2-core-video"))]
348        /// Create a new request that targets an image in a pixel buffer.
349        ///
350        ///
351        /// Parameter `pixelBuffer`: The pixel buffer containing the targeted image.
352        ///
353        /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
354        #[unsafe(method(initWithTargetedCVPixelBuffer:options:))]
355        #[unsafe(method_family = init)]
356        pub unsafe fn initWithTargetedCVPixelBuffer_options(
357            this: Allocated<Self>,
358            pixel_buffer: &CVPixelBuffer,
359            options: &NSDictionary<VNImageOption, AnyObject>,
360        ) -> Retained<Self>;
361
362        #[cfg(all(
363            feature = "VNRequestHandler",
364            feature = "block2",
365            feature = "objc2-core-video"
366        ))]
367        /// Create a new request that targets an image in a pixel buffer.
368        ///
369        ///
370        /// Parameter `pixelBuffer`: The pixel buffer containing the targeted image.
371        ///
372        /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
373        ///
374        /// Parameter `completionHandler`: The block that is invoked when the request has been performed.
375        #[unsafe(method(initWithTargetedCVPixelBuffer:options:completionHandler:))]
376        #[unsafe(method_family = init)]
377        pub unsafe fn initWithTargetedCVPixelBuffer_options_completionHandler(
378            this: Allocated<Self>,
379            pixel_buffer: &CVPixelBuffer,
380            options: &NSDictionary<VNImageOption, AnyObject>,
381            completion_handler: VNRequestCompletionHandler,
382        ) -> Retained<Self>;
383
384        #[cfg(all(feature = "VNRequestHandler", feature = "objc2-core-graphics"))]
385        /// Create a new request with a targeted CGImage.
386        ///
387        ///
388        /// Parameter `cgImage`: The CGImageRef of the targeted image.
389        ///
390        /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
391        #[unsafe(method(initWithTargetedCGImage:options:))]
392        #[unsafe(method_family = init)]
393        pub unsafe fn initWithTargetedCGImage_options(
394            this: Allocated<Self>,
395            cg_image: &CGImage,
396            options: &NSDictionary<VNImageOption, AnyObject>,
397        ) -> Retained<Self>;
398
399        #[cfg(all(
400            feature = "VNRequestHandler",
401            feature = "block2",
402            feature = "objc2-core-graphics"
403        ))]
404        /// Create a new request with a targeted CGImage.
405        ///
406        ///
407        /// Parameter `cgImage`: The CGImageRef of the targeted image.
408        ///
409        /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
410        ///
411        /// Parameter `completionHandler`: The block that is invoked when the request has been performed.
412        #[unsafe(method(initWithTargetedCGImage:options:completionHandler:))]
413        #[unsafe(method_family = init)]
414        pub unsafe fn initWithTargetedCGImage_options_completionHandler(
415            this: Allocated<Self>,
416            cg_image: &CGImage,
417            options: &NSDictionary<VNImageOption, AnyObject>,
418            completion_handler: VNRequestCompletionHandler,
419        ) -> Retained<Self>;
420
421        #[cfg(all(feature = "VNRequestHandler", feature = "objc2-core-image"))]
422        /// Create a new request with a targeted CIImage.
423        ///
424        ///
425        /// Parameter `ciImage`: The CIImage of the targeted image.
426        ///
427        /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
428        #[unsafe(method(initWithTargetedCIImage:options:))]
429        #[unsafe(method_family = init)]
430        pub unsafe fn initWithTargetedCIImage_options(
431            this: Allocated<Self>,
432            ci_image: &CIImage,
433            options: &NSDictionary<VNImageOption, AnyObject>,
434        ) -> Retained<Self>;
435
436        #[cfg(all(
437            feature = "VNRequestHandler",
438            feature = "block2",
439            feature = "objc2-core-image"
440        ))]
441        /// Create a new request with a targeted CIImage.
442        ///
443        ///
444        /// Parameter `ciImage`: The CIImage of the targeted image.
445        ///
446        /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
447        ///
448        /// Parameter `completionHandler`: The block that is invoked when the request has been performed.
449        #[unsafe(method(initWithTargetedCIImage:options:completionHandler:))]
450        #[unsafe(method_family = init)]
451        pub unsafe fn initWithTargetedCIImage_options_completionHandler(
452            this: Allocated<Self>,
453            ci_image: &CIImage,
454            options: &NSDictionary<VNImageOption, AnyObject>,
455            completion_handler: VNRequestCompletionHandler,
456        ) -> Retained<Self>;
457
458        #[cfg(feature = "VNRequestHandler")]
459        /// Create a new request with a targeted image URL.
460        ///
461        ///
462        /// Parameter `imageURL`: The URL of the targeted image.
463        ///
464        /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
465        #[unsafe(method(initWithTargetedImageURL:options:))]
466        #[unsafe(method_family = init)]
467        pub unsafe fn initWithTargetedImageURL_options(
468            this: Allocated<Self>,
469            image_url: &NSURL,
470            options: &NSDictionary<VNImageOption, AnyObject>,
471        ) -> Retained<Self>;
472
473        #[cfg(all(feature = "VNRequestHandler", feature = "block2"))]
474        /// Create a new request with a targeted image URL.
475        ///
476        ///
477        /// Parameter `imageURL`: The URL of the targeted image.
478        ///
479        /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
480        ///
481        /// Parameter `completionHandler`: The block that is invoked when the request has been performed.
482        #[unsafe(method(initWithTargetedImageURL:options:completionHandler:))]
483        #[unsafe(method_family = init)]
484        pub unsafe fn initWithTargetedImageURL_options_completionHandler(
485            this: Allocated<Self>,
486            image_url: &NSURL,
487            options: &NSDictionary<VNImageOption, AnyObject>,
488            completion_handler: VNRequestCompletionHandler,
489        ) -> Retained<Self>;
490
491        #[cfg(feature = "VNRequestHandler")]
492        /// Create a new request with a targeted image data.
493        ///
494        ///
495        /// Parameter `imageData`: The data of the targeted image.
496        ///
497        /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
498        #[unsafe(method(initWithTargetedImageData:options:))]
499        #[unsafe(method_family = init)]
500        pub unsafe fn initWithTargetedImageData_options(
501            this: Allocated<Self>,
502            image_data: &NSData,
503            options: &NSDictionary<VNImageOption, AnyObject>,
504        ) -> Retained<Self>;
505
506        #[cfg(all(feature = "VNRequestHandler", feature = "block2"))]
507        /// Create a new request with a targeted image data.
508        ///
509        ///
510        /// Parameter `imageData`: The data of the targeted image.
511        ///
512        /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
513        ///
514        /// Parameter `completionHandler`: The block that is invoked when the request has been performed.
515        #[unsafe(method(initWithTargetedImageData:options:completionHandler:))]
516        #[unsafe(method_family = init)]
517        pub unsafe fn initWithTargetedImageData_options_completionHandler(
518            this: Allocated<Self>,
519            image_data: &NSData,
520            options: &NSDictionary<VNImageOption, AnyObject>,
521            completion_handler: VNRequestCompletionHandler,
522        ) -> Retained<Self>;
523
524        #[cfg(all(feature = "VNRequestHandler", feature = "objc2-core-media"))]
525        /// Create a new request with a targeted CMSampleBuffer.
526        ///
527        ///
528        /// Parameter `sampleBuffer`: The CMSampleBuffer containing the CVImageBuffer to be used by the request.
529        ///
530        /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
531        #[unsafe(method(initWithTargetedCMSampleBuffer:options:))]
532        #[unsafe(method_family = init)]
533        pub unsafe fn initWithTargetedCMSampleBuffer_options(
534            this: Allocated<Self>,
535            sample_buffer: &CMSampleBuffer,
536            options: &NSDictionary<VNImageOption, AnyObject>,
537        ) -> Retained<Self>;
538
539        #[cfg(all(
540            feature = "VNRequestHandler",
541            feature = "block2",
542            feature = "objc2-core-media"
543        ))]
544        /// Create a new request with a targeted CMSampleBuffer.
545        ///
546        ///
547        /// Parameter `sampleBuffer`: The CMSampleBuffer containing the CVImageBuffer to be used by the request.
548        ///
549        /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
550        ///
551        /// Parameter `completionHandler`: The block that is invoked after the request has been performed.
552        #[unsafe(method(initWithTargetedCMSampleBuffer:options:completionHandler:))]
553        #[unsafe(method_family = init)]
554        pub unsafe fn initWithTargetedCMSampleBuffer_options_completionHandler(
555            this: Allocated<Self>,
556            sample_buffer: &CMSampleBuffer,
557            options: &NSDictionary<VNImageOption, AnyObject>,
558            completion_handler: VNRequestCompletionHandler,
559        ) -> Retained<Self>;
560    );
561}
562
563/// Methods declared on superclass `NSObject`.
564#[cfg(all(feature = "VNRequest", feature = "VNTargetedImageRequest"))]
565impl VNTranslationalImageRegistrationRequest {
566    extern_methods!(
567        #[unsafe(method(new))]
568        #[unsafe(method_family = new)]
569        pub unsafe fn new() -> Retained<Self>;
570    );
571}
572
573/// [Apple's documentation](https://developer.apple.com/documentation/vision/vntranslationalimageregistrationrequestrevision1?language=objc)
574pub static VNTranslationalImageRegistrationRequestRevision1: NSUInteger = 1;
575
576extern_class!(
577    /// An image registration request that will calculate a homographic transformation for morphing a "floating" image onto an unchanging "reference" image.
578    ///
579    ///
580    /// 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.
581    /// 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.
582    ///
583    /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vnhomographicimageregistrationrequest?language=objc)
584    #[unsafe(super(
585        VNImageRegistrationRequest,
586        VNTargetedImageRequest,
587        VNImageBasedRequest,
588        VNRequest,
589        NSObject
590    ))]
591    #[derive(Debug, PartialEq, Eq, Hash)]
592    #[cfg(all(feature = "VNRequest", feature = "VNTargetedImageRequest"))]
593    pub struct VNHomographicImageRegistrationRequest;
594);
595
596#[cfg(all(feature = "VNRequest", feature = "VNTargetedImageRequest"))]
597unsafe impl NSCopying for VNHomographicImageRegistrationRequest {}
598
599#[cfg(all(feature = "VNRequest", feature = "VNTargetedImageRequest"))]
600unsafe impl CopyingHelper for VNHomographicImageRegistrationRequest {
601    type Result = Self;
602}
603
604#[cfg(all(feature = "VNRequest", feature = "VNTargetedImageRequest"))]
605unsafe impl NSObjectProtocol for VNHomographicImageRegistrationRequest {}
606
607#[cfg(all(feature = "VNRequest", feature = "VNTargetedImageRequest"))]
608impl VNHomographicImageRegistrationRequest {
609    extern_methods!(
610        #[cfg(feature = "VNObservation")]
611        /// VNImageHomographicAlignmentObservation results.
612        #[unsafe(method(results))]
613        #[unsafe(method_family = none)]
614        pub unsafe fn results(
615            &self,
616        ) -> Option<Retained<NSArray<VNImageHomographicAlignmentObservation>>>;
617    );
618}
619
620/// Methods declared on superclass `VNTargetedImageRequest`.
621#[cfg(all(feature = "VNRequest", feature = "VNTargetedImageRequest"))]
622impl VNHomographicImageRegistrationRequest {
623    extern_methods!(
624        #[unsafe(method(init))]
625        #[unsafe(method_family = init)]
626        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
627
628        #[cfg(feature = "block2")]
629        #[unsafe(method(initWithCompletionHandler:))]
630        #[unsafe(method_family = init)]
631        pub unsafe fn initWithCompletionHandler(
632            this: Allocated<Self>,
633            completion_handler: VNRequestCompletionHandler,
634        ) -> Retained<Self>;
635
636        #[cfg(all(feature = "VNRequestHandler", feature = "objc2-core-video"))]
637        /// Create a new request that targets an image in a pixel buffer.
638        ///
639        ///
640        /// Parameter `pixelBuffer`: The pixel buffer containing the targeted image.
641        ///
642        /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
643        #[unsafe(method(initWithTargetedCVPixelBuffer:options:))]
644        #[unsafe(method_family = init)]
645        pub unsafe fn initWithTargetedCVPixelBuffer_options(
646            this: Allocated<Self>,
647            pixel_buffer: &CVPixelBuffer,
648            options: &NSDictionary<VNImageOption, AnyObject>,
649        ) -> Retained<Self>;
650
651        #[cfg(all(
652            feature = "VNRequestHandler",
653            feature = "block2",
654            feature = "objc2-core-video"
655        ))]
656        /// Create a new request that targets an image in a pixel buffer.
657        ///
658        ///
659        /// Parameter `pixelBuffer`: The pixel buffer containing the targeted image.
660        ///
661        /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
662        ///
663        /// Parameter `completionHandler`: The block that is invoked when the request has been performed.
664        #[unsafe(method(initWithTargetedCVPixelBuffer:options:completionHandler:))]
665        #[unsafe(method_family = init)]
666        pub unsafe fn initWithTargetedCVPixelBuffer_options_completionHandler(
667            this: Allocated<Self>,
668            pixel_buffer: &CVPixelBuffer,
669            options: &NSDictionary<VNImageOption, AnyObject>,
670            completion_handler: VNRequestCompletionHandler,
671        ) -> Retained<Self>;
672
673        #[cfg(all(feature = "VNRequestHandler", feature = "objc2-core-graphics"))]
674        /// Create a new request with a targeted CGImage.
675        ///
676        ///
677        /// Parameter `cgImage`: The CGImageRef of the targeted image.
678        ///
679        /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
680        #[unsafe(method(initWithTargetedCGImage:options:))]
681        #[unsafe(method_family = init)]
682        pub unsafe fn initWithTargetedCGImage_options(
683            this: Allocated<Self>,
684            cg_image: &CGImage,
685            options: &NSDictionary<VNImageOption, AnyObject>,
686        ) -> Retained<Self>;
687
688        #[cfg(all(
689            feature = "VNRequestHandler",
690            feature = "block2",
691            feature = "objc2-core-graphics"
692        ))]
693        /// Create a new request with a targeted CGImage.
694        ///
695        ///
696        /// Parameter `cgImage`: The CGImageRef of the targeted image.
697        ///
698        /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
699        ///
700        /// Parameter `completionHandler`: The block that is invoked when the request has been performed.
701        #[unsafe(method(initWithTargetedCGImage:options:completionHandler:))]
702        #[unsafe(method_family = init)]
703        pub unsafe fn initWithTargetedCGImage_options_completionHandler(
704            this: Allocated<Self>,
705            cg_image: &CGImage,
706            options: &NSDictionary<VNImageOption, AnyObject>,
707            completion_handler: VNRequestCompletionHandler,
708        ) -> Retained<Self>;
709
710        #[cfg(all(feature = "VNRequestHandler", feature = "objc2-core-image"))]
711        /// Create a new request with a targeted CIImage.
712        ///
713        ///
714        /// Parameter `ciImage`: The CIImage of the targeted image.
715        ///
716        /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
717        #[unsafe(method(initWithTargetedCIImage:options:))]
718        #[unsafe(method_family = init)]
719        pub unsafe fn initWithTargetedCIImage_options(
720            this: Allocated<Self>,
721            ci_image: &CIImage,
722            options: &NSDictionary<VNImageOption, AnyObject>,
723        ) -> Retained<Self>;
724
725        #[cfg(all(
726            feature = "VNRequestHandler",
727            feature = "block2",
728            feature = "objc2-core-image"
729        ))]
730        /// Create a new request with a targeted CIImage.
731        ///
732        ///
733        /// Parameter `ciImage`: The CIImage of the targeted image.
734        ///
735        /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
736        ///
737        /// Parameter `completionHandler`: The block that is invoked when the request has been performed.
738        #[unsafe(method(initWithTargetedCIImage:options:completionHandler:))]
739        #[unsafe(method_family = init)]
740        pub unsafe fn initWithTargetedCIImage_options_completionHandler(
741            this: Allocated<Self>,
742            ci_image: &CIImage,
743            options: &NSDictionary<VNImageOption, AnyObject>,
744            completion_handler: VNRequestCompletionHandler,
745        ) -> Retained<Self>;
746
747        #[cfg(feature = "VNRequestHandler")]
748        /// Create a new request with a targeted image URL.
749        ///
750        ///
751        /// Parameter `imageURL`: The URL of the targeted image.
752        ///
753        /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
754        #[unsafe(method(initWithTargetedImageURL:options:))]
755        #[unsafe(method_family = init)]
756        pub unsafe fn initWithTargetedImageURL_options(
757            this: Allocated<Self>,
758            image_url: &NSURL,
759            options: &NSDictionary<VNImageOption, AnyObject>,
760        ) -> Retained<Self>;
761
762        #[cfg(all(feature = "VNRequestHandler", feature = "block2"))]
763        /// Create a new request with a targeted image URL.
764        ///
765        ///
766        /// Parameter `imageURL`: The URL of the targeted image.
767        ///
768        /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
769        ///
770        /// Parameter `completionHandler`: The block that is invoked when the request has been performed.
771        #[unsafe(method(initWithTargetedImageURL:options:completionHandler:))]
772        #[unsafe(method_family = init)]
773        pub unsafe fn initWithTargetedImageURL_options_completionHandler(
774            this: Allocated<Self>,
775            image_url: &NSURL,
776            options: &NSDictionary<VNImageOption, AnyObject>,
777            completion_handler: VNRequestCompletionHandler,
778        ) -> Retained<Self>;
779
780        #[cfg(feature = "VNRequestHandler")]
781        /// Create a new request with a targeted image data.
782        ///
783        ///
784        /// Parameter `imageData`: The data of the targeted image.
785        ///
786        /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
787        #[unsafe(method(initWithTargetedImageData:options:))]
788        #[unsafe(method_family = init)]
789        pub unsafe fn initWithTargetedImageData_options(
790            this: Allocated<Self>,
791            image_data: &NSData,
792            options: &NSDictionary<VNImageOption, AnyObject>,
793        ) -> Retained<Self>;
794
795        #[cfg(all(feature = "VNRequestHandler", feature = "block2"))]
796        /// Create a new request with a targeted image data.
797        ///
798        ///
799        /// Parameter `imageData`: The data of the targeted image.
800        ///
801        /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
802        ///
803        /// Parameter `completionHandler`: The block that is invoked when the request has been performed.
804        #[unsafe(method(initWithTargetedImageData:options:completionHandler:))]
805        #[unsafe(method_family = init)]
806        pub unsafe fn initWithTargetedImageData_options_completionHandler(
807            this: Allocated<Self>,
808            image_data: &NSData,
809            options: &NSDictionary<VNImageOption, AnyObject>,
810            completion_handler: VNRequestCompletionHandler,
811        ) -> Retained<Self>;
812
813        #[cfg(all(feature = "VNRequestHandler", feature = "objc2-core-media"))]
814        /// Create a new request with a targeted CMSampleBuffer.
815        ///
816        ///
817        /// Parameter `sampleBuffer`: The CMSampleBuffer containing the CVImageBuffer to be used by the request.
818        ///
819        /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
820        #[unsafe(method(initWithTargetedCMSampleBuffer:options:))]
821        #[unsafe(method_family = init)]
822        pub unsafe fn initWithTargetedCMSampleBuffer_options(
823            this: Allocated<Self>,
824            sample_buffer: &CMSampleBuffer,
825            options: &NSDictionary<VNImageOption, AnyObject>,
826        ) -> Retained<Self>;
827
828        #[cfg(all(
829            feature = "VNRequestHandler",
830            feature = "block2",
831            feature = "objc2-core-media"
832        ))]
833        /// Create a new request with a targeted CMSampleBuffer.
834        ///
835        ///
836        /// Parameter `sampleBuffer`: The CMSampleBuffer containing the CVImageBuffer to be used by the request.
837        ///
838        /// Parameter `options`: A dictionary with options specifying auxiliary information for the image.
839        ///
840        /// Parameter `completionHandler`: The block that is invoked after the request has been performed.
841        #[unsafe(method(initWithTargetedCMSampleBuffer:options:completionHandler:))]
842        #[unsafe(method_family = init)]
843        pub unsafe fn initWithTargetedCMSampleBuffer_options_completionHandler(
844            this: Allocated<Self>,
845            sample_buffer: &CMSampleBuffer,
846            options: &NSDictionary<VNImageOption, AnyObject>,
847            completion_handler: VNRequestCompletionHandler,
848        ) -> Retained<Self>;
849    );
850}
851
852/// Methods declared on superclass `NSObject`.
853#[cfg(all(feature = "VNRequest", feature = "VNTargetedImageRequest"))]
854impl VNHomographicImageRegistrationRequest {
855    extern_methods!(
856        #[unsafe(method(new))]
857        #[unsafe(method_family = new)]
858        pub unsafe fn new() -> Retained<Self>;
859    );
860}
861
862/// [Apple's documentation](https://developer.apple.com/documentation/vision/vnhomographicimageregistrationrequestrevision1?language=objc)
863pub static VNHomographicImageRegistrationRequestRevision1: NSUInteger = 1;