1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-av-foundation")]
use objc2_av_foundation::*;
#[cfg(feature = "objc2-core-graphics")]
use objc2_core_graphics::*;
#[cfg(feature = "objc2-core-image")]
use objc2_core_image::*;
#[cfg(feature = "objc2-core-media")]
use objc2_core_media::*;
#[cfg(feature = "objc2-core-video")]
use objc2_core_video::*;
use objc2_foundation::*;
#[cfg(feature = "objc2-image-io")]
use objc2_image_io::*;
use crate::*;
/// Options keys passed into the VNImageRequestHandler creations or requests that take an auxiliary image. These are options that either describe specific properties of an image like the VNImageOptionCameraIntrinsics or how an image needs to be handled like the VNImageOptionCIContext.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vnimageoption?language=objc)
// NS_TYPED_ENUM
pub type VNImageOption = NSString;
extern "C" {
/// VNImageOptionProperties is the dictionary from CGImageSourceCopyPropertiesAtIndex. This contains metadata that can be used by some algorithms like horizon detection.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vnimageoptionproperties?language=objc)
pub static VNImageOptionProperties: &'static VNImageOption;
}
extern "C" {
/// VNImageOptionCameraIntrinsics Specifies the camera intrinsics as an NSData or CFData representing a matrix_float3x3. See kCMSampleBufferAttachmentKey_CameraIntrinsicMatrix for details
///
/// Camera intrinsic matrix is a CFData containing a matrix_float3x3, which is column-major. It has the following contents:
/// fx 0 ox
/// 0 fy oy
/// 0 0 1
/// fx and fy are the focal length in pixels. For square pixels, they will have the same value.
/// ox and oy are the coordinates of the principal point. The origin is the upper left of the frame.
///
/// Note: When using a CMSampleBuffer as an input and that sample buffer has camera intrinsics attached to it, Vision will use the camera intrinsic from there unless overwritten by passing in as an explicit option which will take precedence.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vnimageoptioncameraintrinsics?language=objc)
pub static VNImageOptionCameraIntrinsics: &'static VNImageOption;
}
extern "C" {
/// VNImageOptionCIContext Specifies the CIContext to be used in Core Image operations of request handler. If this is not specified, Vision will create its own CIContext. This option is helpful when the passed in CIImage is the result of a CIFilter chain that has been executed on a CIContext or uses outputs of a CIImage on a given CIContext as they don't have to transfer to other contexts.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vnimageoptioncicontext?language=objc)
pub static VNImageOptionCIContext: &'static VNImageOption;
}
extern_class!(
/// Performs requests on a single image.
///
/// The VNImageRequestHandler is created with an image that is used to be used for the requests a client might want to schedule. The VNImageRequestHandler retains, but never modifies, the image source for its entire lifetime. The client also must not modify the content of the image source once the VNImageRequestHandler is created otherwise the results are undefined.
/// The VNImageRequestHandler can choose to also cache intermediate representation of the image or other request-specific information for the purposes of runtime performance.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vnimagerequesthandler?language=objc)
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct VNImageRequestHandler;
);
extern_conformance!(
unsafe impl NSObjectProtocol for VNImageRequestHandler {}
);
impl VNImageRequestHandler {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[cfg(feature = "objc2-core-video")]
/// initWithCVPixelBuffer:options creates a VNImageRequestHandler to be used for performing requests against the image passed in as buffer.
///
///
/// Parameter `pixelBuffer`: A CVPixelBuffer containing the image to be used for performing the requests. The content of the buffer cannot be modified for the lifetime of the VNImageRequestHandler.
///
/// Parameter `options`: A dictionary with options specifying auxiliary information for the buffer/image like VNImageOptionCameraIntrinsics
///
/// # Safety
///
/// `options` generic should be of the correct type.
#[unsafe(method(initWithCVPixelBuffer:options:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCVPixelBuffer_options(
this: Allocated<Self>,
pixel_buffer: &CVPixelBuffer,
options: &NSDictionary<VNImageOption, AnyObject>,
) -> Retained<Self>;
#[cfg(all(feature = "objc2-core-video", feature = "objc2-image-io"))]
/// initWithCVPixelBuffer:options creates a VNImageRequestHandler to be used for performing requests against the image passed in as buffer.
///
///
/// Parameter `pixelBuffer`: A CVPixelBuffer containing the image to be used for performing the requests. The content of the buffer cannot be modified for the lifetime of the VNImageRequestHandler.
///
/// 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.
///
/// Parameter `options`: A dictionary with options specifying auxiliary information for the buffer/image like VNImageOptionCameraIntrinsics
///
/// # Safety
///
/// `options` generic should be of the correct type.
#[unsafe(method(initWithCVPixelBuffer:orientation:options:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCVPixelBuffer_orientation_options(
this: Allocated<Self>,
pixel_buffer: &CVPixelBuffer,
orientation: CGImagePropertyOrientation,
options: &NSDictionary<VNImageOption, AnyObject>,
) -> Retained<Self>;
#[cfg(all(
feature = "objc2-av-foundation",
feature = "objc2-core-video",
feature = "objc2-image-io"
))]
/// initWithCVPixelBuffer:depthData:orientation:options creates a VNImageRequestHandler to be used for performing requests against the image passed in as buffer with depth information.
///
/// Parameter `pixelBuffer`: A CVPixelBuffer containing the image to be used for performing the requests. The content of the buffer cannot be modified for the lifetime of the VNImageRequestHandler.
///
/// Parameter `depthData`: An AVDepthData instance associated with the pixelBuffer
///
/// Parameter `orientation`: The orientation of the image and depth buffers 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 and should match for both buffers.
///
/// Parameter `options`: A dictionary with options specifying auxiliary information for the buffer/image
///
/// # Safety
///
/// `options` generic should be of the correct type.
#[unsafe(method(initWithCVPixelBuffer:depthData:orientation:options:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCVPixelBuffer_depthData_orientation_options(
this: Allocated<Self>,
pixel_buffer: &CVPixelBuffer,
depth_data: &AVDepthData,
orientation: CGImagePropertyOrientation,
options: &NSDictionary<VNImageOption, AnyObject>,
) -> Retained<Self>;
#[cfg(feature = "objc2-core-graphics")]
/// initWithCGImage:options creates a VNImageRequestHandler to be used for performing requests against the image passed in as a CGImageRef.
///
///
/// Parameter `image`: A CGImageRef containing the image to be used for performing the requests. The content of the image cannot be modified.
///
/// Parameter `options`: A dictionary with options specifying auxiliary information for the buffer/image like VNImageOptionCameraIntrinsics
///
/// # Safety
///
/// `options` generic should be of the correct type.
#[unsafe(method(initWithCGImage:options:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCGImage_options(
this: Allocated<Self>,
image: &CGImage,
options: &NSDictionary<VNImageOption, AnyObject>,
) -> Retained<Self>;
#[cfg(all(feature = "objc2-core-graphics", feature = "objc2-image-io"))]
/// initWithCGImage:options creates a VNImageRequestHandler to be used for performing requests against the image passed in as a CGImageRef.
///
///
/// Parameter `image`: A CGImageRef containing the image to be used for performing the requests. The content of the image cannot be modified.
///
/// 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.
///
/// Parameter `options`: A dictionary with options specifying auxiliary information for the buffer/image like VNImageOptionCameraIntrinsics
///
/// # Safety
///
/// `options` generic should be of the correct type.
#[unsafe(method(initWithCGImage:orientation:options:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCGImage_orientation_options(
this: Allocated<Self>,
image: &CGImage,
orientation: CGImagePropertyOrientation,
options: &NSDictionary<VNImageOption, AnyObject>,
) -> Retained<Self>;
#[cfg(feature = "objc2-core-image")]
/// initWithCIImage:options creates a VNImageRequestHandler to be used for performing requests against the image passed in as a CIImage.
///
///
/// Parameter `image`: A CIImage containing the image to be used for performing the requests. The content of the image cannot be modified.
///
/// Parameter `options`: A dictionary with options specifying auxiliary information for the buffer/image like VNImageOptionCameraIntrinsics
///
///
/// Note: : Request results may not be accurate in simulator due to CI's inability to render certain pixel formats in the simulator. The orientation of the original image should be applied for instance by using imageByApplyingOrientation or use the initWithCIImage:options:orientation API.
///
/// # Safety
///
/// `options` generic should be of the correct type.
#[unsafe(method(initWithCIImage:options:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCIImage_options(
this: Allocated<Self>,
image: &CIImage,
options: &NSDictionary<VNImageOption, AnyObject>,
) -> Retained<Self>;
#[cfg(all(feature = "objc2-core-image", feature = "objc2-image-io"))]
/// initWithCIImage:options:orientation creates a VNImageRequestHandler to be used for performing requests against the image passed in as a CIImage.
///
///
/// Parameter `image`: A CIImage containing the image to be used for performing the requests. The content of the image cannot be modified.
///
/// 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.
///
/// Parameter `options`: A dictionary with options specifying auxiliary information for the buffer/image like VNImageOptionCameraIntrinsics
///
///
/// Note: : Request results may not be accurate in simulator due to CI's inability to render certain pixel formats in the simulator
///
/// # Safety
///
/// `options` generic should be of the correct type.
#[unsafe(method(initWithCIImage:orientation:options:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCIImage_orientation_options(
this: Allocated<Self>,
image: &CIImage,
orientation: CGImagePropertyOrientation,
options: &NSDictionary<VNImageOption, AnyObject>,
) -> Retained<Self>;
/// initWithURL:options creates a VNImageRequestHandler to be used for performing requests against an image specified by it's URL
///
///
/// Parameter `imageURL`: A URL pointing at an image to be used for performing the requests. The image has to be in a format that is supported by ImageIO. The content of the image cannot be modified.
///
/// Parameter `options`: A dictionary with options specifying auxiliary information for the buffer/image like VNImageOptionCameraIntrinsics
///
///
/// Note: : Request results may not be accurate in simulator due to CI's inability to render certain pixel formats in the simulator
///
/// # Safety
///
/// `options` generic should be of the correct type.
#[unsafe(method(initWithURL:options:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithURL_options(
this: Allocated<Self>,
image_url: &NSURL,
options: &NSDictionary<VNImageOption, AnyObject>,
) -> Retained<Self>;
#[cfg(feature = "objc2-image-io")]
/// initWithURL:options creates a VNImageRequestHandler to be used for performing requests against an image specified by it's URL
///
///
/// Parameter `imageURL`: A URL pointing at an image to be used for performing the requests. The image has to be in a format that is supported by ImageIO. The content of the image cannot be modified.
///
/// 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.
///
/// Parameter `options`: A dictionary with options specifying auxiliary information for the buffer/image like VNImageOptionCameraIntrinsics
///
///
/// Note: : Request results may not be accurate in simulator due to CI's inability to render certain pixel formats in the simulator
///
/// # Safety
///
/// `options` generic should be of the correct type.
#[unsafe(method(initWithURL:orientation:options:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithURL_orientation_options(
this: Allocated<Self>,
image_url: &NSURL,
orientation: CGImagePropertyOrientation,
options: &NSDictionary<VNImageOption, AnyObject>,
) -> Retained<Self>;
/// initWithData:options creates a VNImageRequestHandler to be used for performing requests against an image contained in an NSData object.
///
///
/// Parameter `imageData`: An NSData object containing the content of the image to be used for performing the requests. See CIImage imageWithData for supported format. The content of the image cannot be modified.
///
/// Parameter `options`: A dictionary with options specifying auxiliary information for the buffer/image like VNImageOptionCameraIntrinsics
///
///
/// Note: : Request results may not be accurate in simulator due to CI's inability to render certain pixel formats in the simulator
#[unsafe(method(initWithData:options:))]
#[unsafe(method_family = init)]
pub fn initWithData_options(
this: Allocated<Self>,
image_data: &NSData,
options: &NSDictionary<VNImageOption, AnyObject>,
) -> Retained<Self>;
#[cfg(feature = "objc2-image-io")]
/// initWithData:options creates a VNImageRequestHandler to be used for performing requests against an image contained in an NSData object.
///
///
/// Parameter `imageData`: An NSData object containing the content of the image to be used for performing the requests. See CIImage imageWithData for supported format. The content of the image cannot be modified.
///
/// 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.
///
/// Parameter `options`: A dictionary with options specifying auxiliary information for the buffer/image like VNImageOptionCameraIntrinsics
///
///
/// Note: : Request results may not be accurate in simulator due to CI's inability to render certain pixel formats in the simulator
///
/// # Safety
///
/// `options` generic should be of the correct type.
#[unsafe(method(initWithData:orientation:options:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithData_orientation_options(
this: Allocated<Self>,
image_data: &NSData,
orientation: CGImagePropertyOrientation,
options: &NSDictionary<VNImageOption, AnyObject>,
) -> Retained<Self>;
#[cfg(feature = "objc2-core-media")]
/// Creates a VNImageRequestHandler to be used for performing requests against the image buffer contained in the CMSampleBufferRef
///
///
/// Parameter `sampleBuffer`: A CMSampleBuffer containing the imageBuffer that will be used for performing the requests. Not all types of sample buffers are supported. They need to contain a CVImageBuffer, be valid and ready.
///
/// Parameter `options`: A dictionary with options specifying auxiliary information for the buffer/image like VNImageOptionCameraIntrinsics
///
/// Note: CMSampleBuffers can contain metadata like camera intrinsics that will be used by algorithms supporting it unless overwritten by the options.
///
/// # Safety
///
/// `options` generic should be of the correct type.
#[unsafe(method(initWithCMSampleBuffer:options:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCMSampleBuffer_options(
this: Allocated<Self>,
sample_buffer: &CMSampleBuffer,
options: &NSDictionary<VNImageOption, AnyObject>,
) -> Retained<Self>;
#[cfg(all(feature = "objc2-core-media", feature = "objc2-image-io"))]
/// Creates a VNImageRequestHandler to be used for performing requests against the image buffer contained in the CMSampleBufferRef
///
///
/// Parameter `sampleBuffer`: A CMSampleBuffer containing the imageBuffer that will be used for performing the requests. Not all types of sample buffers are supported. They need to contain a CVImageBuffer, be valid and ready.
///
/// 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.
///
/// Parameter `options`: A dictionary with options specifying auxiliary information for the buffer/image like VNImageOptionCameraIntrinsics
///
/// Note: CMSampleBuffers can contain metadata like camera intrinsics that will be used by algorithms supporting it unless overwritten by the options.
///
/// Note: : Because CoreImage is unable to render certain pixel formats in the iOS simulator, request results may not be accurate in those cases.
///
/// # Safety
///
/// `options` generic should be of the correct type.
#[unsafe(method(initWithCMSampleBuffer:orientation:options:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCMSampleBuffer_orientation_options(
this: Allocated<Self>,
sample_buffer: &CMSampleBuffer,
orientation: CGImagePropertyOrientation,
options: &NSDictionary<VNImageOption, AnyObject>,
) -> Retained<Self>;
#[cfg(all(
feature = "objc2-av-foundation",
feature = "objc2-core-media",
feature = "objc2-image-io"
))]
/// Creates a VNImageRequestHandler to be used for performing requests against the image buffer contained in the CMSampleBufferRef
///
///
/// Parameter `sampleBuffer`: A CMSampleBuffer containing the imageBuffer that will be used for performing the requests. Not all types of sample buffers are supported. They need to contain a CVImageBuffer, be valid and ready.
///
/// Parameter `depthData`: An AVDepthData instance associated with the pixelBuffer
///
/// Parameter `orientation`: The orientation of the image and depth buffers 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 and should match for both buffers.
///
/// Parameter `options`: A dictionary with options specifying auxiliary information for the buffer/image
///
/// Note: CMSampleBuffers can contain metadata like camera intrinsics that will be used by algorithms supporting it unless overwritten by the options.
///
/// Note: : Because CoreImage is unable to render certain pixel formats in the iOS simulator, request results may not be accurate in those cases.
///
/// # Safety
///
/// `options` generic should be of the correct type.
#[unsafe(method(initWithCMSampleBuffer:depthData:orientation:options:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCMSampleBuffer_depthData_orientation_options(
this: Allocated<Self>,
sample_buffer: &CMSampleBuffer,
depth_data: &AVDepthData,
orientation: CGImagePropertyOrientation,
options: &NSDictionary<VNImageOption, AnyObject>,
) -> Retained<Self>;
#[cfg(feature = "VNRequest")]
/// performRequests schedules one or more VNRequests to be performed. The function returns once all requests have been finished.
///
///
/// The results of the VNRequests as well any possible errors of the individual requests are reported in the VNRequests results and error properties.
///
///
/// Parameter `requests`: An NSArray of VNRequests that are to be performed.
///
/// Parameter `error`: Returns an error that happened during scheduling of the requests. Check individual requests results and errors for their respective success and failures. This parameter is optional.
///
/// Returns: Returns true if all requests were scheduled and performed. Check individual requests results and errors for their respective success and failures.
#[unsafe(method(performRequests:error:_))]
#[unsafe(method_family = none)]
pub fn performRequests_error(
&self,
requests: &NSArray<VNRequest>,
) -> Result<(), Retained<NSError>>;
);
}
/// Methods declared on superclass `NSObject`.
impl VNImageRequestHandler {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
extern_class!(
/// Performs requests on a sequence of images.
///
/// The VNSequenceRequestHandler is created without any specific image source. The -performRequests:on
/// <ImageSource
/// >:error: methods will retain the image source for no longer than the lifetime of the call.
/// The VNSequenceRequestHandler can choose to also cache state information related to the previously-processed image sources.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vnsequencerequesthandler?language=objc)
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct VNSequenceRequestHandler;
);
extern_conformance!(
unsafe impl NSObjectProtocol for VNSequenceRequestHandler {}
);
impl VNSequenceRequestHandler {
extern_methods!(
/// Creates a new object.
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[cfg(all(feature = "VNRequest", feature = "objc2-core-video"))]
/// Perform requests on an image in a CVPixelBuffer.
///
///
/// Parameter `requests`: The VNRequests to be performed on the image.
///
///
/// Parameter `pixelBuffer`: The CVPixelBuffer containing the image to be processed.
///
///
/// Parameter `error`: On input, a pointer to an error object. If an error occurs, this pointer is set to an actual error object containing the error information. You may specify NULL for this parameter if you do not want the error information.
#[unsafe(method(performRequests:onCVPixelBuffer:error:_))]
#[unsafe(method_family = none)]
pub unsafe fn performRequests_onCVPixelBuffer_error(
&self,
requests: &NSArray<VNRequest>,
pixel_buffer: &CVPixelBuffer,
) -> Result<(), Retained<NSError>>;
#[cfg(all(
feature = "VNRequest",
feature = "objc2-core-video",
feature = "objc2-image-io"
))]
/// Perform requests on an image in a CVPixelBuffer.
///
///
/// Parameter `requests`: The VNRequests to be performed on the image.
///
///
/// Parameter `pixelBuffer`: The CVPixelBuffer containing the image to be processed.
///
///
/// Parameter `orientation`: The orientation of the image as it is captured in the pixel buffer.
///
///
/// Parameter `error`: On input, a pointer to an error object. If an error occurs, this pointer is set to an actual error object containing the error information. You may specify NULL for this parameter if you do not want the error information.
#[unsafe(method(performRequests:onCVPixelBuffer:orientation:error:_))]
#[unsafe(method_family = none)]
pub unsafe fn performRequests_onCVPixelBuffer_orientation_error(
&self,
requests: &NSArray<VNRequest>,
pixel_buffer: &CVPixelBuffer,
orientation: CGImagePropertyOrientation,
) -> Result<(), Retained<NSError>>;
#[cfg(all(feature = "VNRequest", feature = "objc2-core-graphics"))]
/// Perform requests on an image in a CGImageRef.
///
///
/// Parameter `requests`: The VNRequests to be performed on the image.
///
///
/// Parameter `image`: The CGImageRef containing the image to be processed.
///
///
/// Parameter `error`: On input, a pointer to an error object. If an error occurs, this pointer is set to an actual error object containing the error information. You may specify NULL for this parameter if you do not want the error information.
#[unsafe(method(performRequests:onCGImage:error:_))]
#[unsafe(method_family = none)]
pub unsafe fn performRequests_onCGImage_error(
&self,
requests: &NSArray<VNRequest>,
image: &CGImage,
) -> Result<(), Retained<NSError>>;
#[cfg(all(
feature = "VNRequest",
feature = "objc2-core-graphics",
feature = "objc2-image-io"
))]
/// Perform requests on an image in a CGImageRef.
///
///
/// Parameter `requests`: The VNRequests to be performed on the image.
///
///
/// Parameter `image`: The CGImageRef containing the image to be processed.
///
///
/// Parameter `orientation`: The orientation of the image.
///
///
/// Parameter `error`: On input, a pointer to an error object. If an error occurs, this pointer is set to an actual error object containing the error information. You may specify NULL for this parameter if you do not want the error information.
#[unsafe(method(performRequests:onCGImage:orientation:error:_))]
#[unsafe(method_family = none)]
pub unsafe fn performRequests_onCGImage_orientation_error(
&self,
requests: &NSArray<VNRequest>,
image: &CGImage,
orientation: CGImagePropertyOrientation,
) -> Result<(), Retained<NSError>>;
#[cfg(all(feature = "VNRequest", feature = "objc2-core-image"))]
/// Perform requests on an image in a CIImage.
///
///
/// Parameter `requests`: The VNRequests to be performed on the image.
///
///
/// Parameter `image`: The CIImage containing the image to be processed.
///
///
/// Parameter `error`: On input, a pointer to an error object. If an error occurs, this pointer is set to an actual error object containing the error information. You may specify NULL for this parameter if you do not want the error information.
#[unsafe(method(performRequests:onCIImage:error:_))]
#[unsafe(method_family = none)]
pub unsafe fn performRequests_onCIImage_error(
&self,
requests: &NSArray<VNRequest>,
image: &CIImage,
) -> Result<(), Retained<NSError>>;
#[cfg(all(
feature = "VNRequest",
feature = "objc2-core-image",
feature = "objc2-image-io"
))]
/// Perform requests on an image in a CIImage.
///
///
/// Parameter `requests`: The VNRequests to be performed on the image.
///
///
/// Parameter `image`: The CIImage containing the image to be processed.
///
///
/// Parameter `orientation`: The orientation of the image.
///
///
/// Parameter `error`: On input, a pointer to an error object. If an error occurs, this pointer is set to an actual error object containing the error information. You may specify NULL for this parameter if you do not want the error information.
#[unsafe(method(performRequests:onCIImage:orientation:error:_))]
#[unsafe(method_family = none)]
pub unsafe fn performRequests_onCIImage_orientation_error(
&self,
requests: &NSArray<VNRequest>,
image: &CIImage,
orientation: CGImagePropertyOrientation,
) -> Result<(), Retained<NSError>>;
#[cfg(feature = "VNRequest")]
/// Perform requests on an image referenced by an URL.
///
///
/// Parameter `requests`: The VNRequests to be performed on the image.
///
///
/// Parameter `imageURL`: The URL of the image to be processed. If this is not a file-based URL, the method will fail.
///
///
/// Parameter `error`: On input, a pointer to an error object. If an error occurs, this pointer is set to an actual error object containing the error information. You may specify NULL for this parameter if you do not want the error information.
#[unsafe(method(performRequests:onImageURL:error:_))]
#[unsafe(method_family = none)]
pub unsafe fn performRequests_onImageURL_error(
&self,
requests: &NSArray<VNRequest>,
image_url: &NSURL,
) -> Result<(), Retained<NSError>>;
#[cfg(all(feature = "VNRequest", feature = "objc2-image-io"))]
/// Perform requests on an image referenced by an URL.
///
///
/// Parameter `requests`: The VNRequests to be performed on the image.
///
///
/// Parameter `imageURL`: The URL of the image to be processed. If this is not a file-based URL, the method will fail.
///
///
/// Parameter `orientation`: The orientation of the image.
///
///
/// Parameter `error`: On input, a pointer to an error object. If an error occurs, this pointer is set to an actual error object containing the error information. You may specify NULL for this parameter if you do not want the error information.
#[unsafe(method(performRequests:onImageURL:orientation:error:_))]
#[unsafe(method_family = none)]
pub unsafe fn performRequests_onImageURL_orientation_error(
&self,
requests: &NSArray<VNRequest>,
image_url: &NSURL,
orientation: CGImagePropertyOrientation,
) -> Result<(), Retained<NSError>>;
#[cfg(feature = "VNRequest")]
/// Perform requests on an image with its source format in memory.
///
///
/// Parameter `requests`: The VNRequests to be performed on the image.
///
///
/// Parameter `imageData`: The data representing the source format of the image to be processed.
///
///
/// Parameter `error`: On input, a pointer to an error object. If an error occurs, this pointer is set to an actual error object containing the error information. You may specify NULL for this parameter if you do not want the error information.
#[unsafe(method(performRequests:onImageData:error:_))]
#[unsafe(method_family = none)]
pub unsafe fn performRequests_onImageData_error(
&self,
requests: &NSArray<VNRequest>,
image_data: &NSData,
) -> Result<(), Retained<NSError>>;
#[cfg(all(feature = "VNRequest", feature = "objc2-image-io"))]
/// Perform requests on an image with its source format in memory.
///
///
/// Parameter `requests`: The VNRequests to be performed on the image.
///
///
/// Parameter `imageData`: The data representing the source format of the image to be processed.
///
///
/// Parameter `orientation`: The orientation of the image.
///
///
/// Parameter `error`: On input, a pointer to an error object. If an error occurs, this pointer is set to an actual error object containing the error information. You may specify NULL for this parameter if you do not want the error information.
#[unsafe(method(performRequests:onImageData:orientation:error:_))]
#[unsafe(method_family = none)]
pub unsafe fn performRequests_onImageData_orientation_error(
&self,
requests: &NSArray<VNRequest>,
image_data: &NSData,
orientation: CGImagePropertyOrientation,
) -> Result<(), Retained<NSError>>;
#[cfg(all(feature = "VNRequest", feature = "objc2-core-media"))]
/// Perform requests on the image buffer contained in the CMSampleBufferRef.
///
///
/// Parameter `requests`: The VNRequests to be performed on the image.
///
///
/// Parameter `sampleBuffer`: A CMSampleBuffer containing an image that will be used for performing the requests. Not all types of sample buffers are supported. They need to contain a CVImageBuffer, be valid and ready.
///
///
/// Parameter `error`: On input, a pointer to an error object. If an error occurs, this pointer is set to an actual error object containing the error information. You may specify NULL for this parameter if you do not want the error information.
#[unsafe(method(performRequests:onCMSampleBuffer:error:_))]
#[unsafe(method_family = none)]
pub unsafe fn performRequests_onCMSampleBuffer_error(
&self,
requests: &NSArray<VNRequest>,
sample_buffer: &CMSampleBuffer,
) -> Result<(), Retained<NSError>>;
#[cfg(all(
feature = "VNRequest",
feature = "objc2-core-media",
feature = "objc2-image-io"
))]
/// Perform requests on the image buffer contained in the CMSampleBufferRef.
///
///
/// Parameter `requests`: The VNRequests to be performed on the image.
///
///
/// Parameter `sampleBuffer`: A CMSampleBuffer containing an image that will be used for performing the requests. Not all types of sample buffers are supported. They need to contain a CVImageBuffer, be valid and ready.
///
///
/// Parameter `orientation`: The orientation of the image.
///
///
/// Parameter `error`: On input, a pointer to an error object. If an error occurs, this pointer is set to an actual error object containing the error information. You may specify NULL for this parameter if you do not want the error information.
#[unsafe(method(performRequests:onCMSampleBuffer:orientation:error:_))]
#[unsafe(method_family = none)]
pub unsafe fn performRequests_onCMSampleBuffer_orientation_error(
&self,
requests: &NSArray<VNRequest>,
sample_buffer: &CMSampleBuffer,
orientation: CGImagePropertyOrientation,
) -> Result<(), Retained<NSError>>;
);
}
/// Methods declared on superclass `NSObject`.
impl VNSequenceRequestHandler {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}