1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8#[cfg(feature = "objc2-core-graphics")]
9use objc2_core_graphics::*;
10#[cfg(feature = "objc2-core-image")]
11use objc2_core_image::*;
12#[cfg(feature = "objc2-core-media")]
13use objc2_core_media::*;
14#[cfg(feature = "objc2-core-ml")]
15use objc2_core_ml::*;
16#[cfg(feature = "objc2-core-video")]
17use objc2_core_video::*;
18use objc2_foundation::*;
19
20use crate::*;
21
22extern_class!(
23 #[unsafe(super(NSObject))]
27 #[derive(Debug, PartialEq, Eq, Hash)]
28 pub struct VNObservation;
29);
30
31unsafe impl NSCoding for VNObservation {}
32
33unsafe impl NSCopying for VNObservation {}
34
35unsafe impl CopyingHelper for VNObservation {
36 type Result = Self;
37}
38
39unsafe impl NSObjectProtocol for VNObservation {}
40
41unsafe impl NSSecureCoding for VNObservation {}
42
43#[cfg(feature = "VNRequestRevisionProviding")]
44unsafe impl VNRequestRevisionProviding for VNObservation {}
45
46impl VNObservation {
47 extern_methods!(
48 #[unsafe(method(uuid))]
50 #[unsafe(method_family = none)]
51 pub unsafe fn uuid(&self) -> Retained<NSUUID>;
52
53 #[cfg(feature = "VNTypes")]
54 #[unsafe(method(confidence))]
58 #[unsafe(method_family = none)]
59 pub unsafe fn confidence(&self) -> VNConfidence;
60
61 #[cfg(feature = "objc2-core-media")]
62 #[unsafe(method(timeRange))]
66 #[unsafe(method_family = none)]
67 pub unsafe fn timeRange(&self) -> CMTimeRange;
68 );
69}
70
71impl VNObservation {
73 extern_methods!(
74 #[unsafe(method(init))]
75 #[unsafe(method_family = init)]
76 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
77
78 #[unsafe(method(new))]
79 #[unsafe(method_family = new)]
80 pub unsafe fn new() -> Retained<Self>;
81 );
82}
83
84extern_class!(
85 #[unsafe(super(VNObservation, NSObject))]
91 #[derive(Debug, PartialEq, Eq, Hash)]
92 pub struct VNDetectedObjectObservation;
93);
94
95unsafe impl NSCoding for VNDetectedObjectObservation {}
96
97unsafe impl NSCopying for VNDetectedObjectObservation {}
98
99unsafe impl CopyingHelper for VNDetectedObjectObservation {
100 type Result = Self;
101}
102
103unsafe impl NSObjectProtocol for VNDetectedObjectObservation {}
104
105unsafe impl NSSecureCoding for VNDetectedObjectObservation {}
106
107#[cfg(feature = "VNRequestRevisionProviding")]
108unsafe impl VNRequestRevisionProviding for VNDetectedObjectObservation {}
109
110impl VNDetectedObjectObservation {
111 extern_methods!(
112 #[cfg(feature = "objc2-core-foundation")]
113 #[unsafe(method(observationWithBoundingBox:))]
115 #[unsafe(method_family = none)]
116 pub unsafe fn observationWithBoundingBox(bounding_box: CGRect) -> Retained<Self>;
117
118 #[cfg(feature = "objc2-core-foundation")]
119 #[unsafe(method(observationWithRequestRevision:boundingBox:))]
120 #[unsafe(method_family = none)]
121 pub unsafe fn observationWithRequestRevision_boundingBox(
122 request_revision: NSUInteger,
123 bounding_box: CGRect,
124 ) -> Retained<Self>;
125
126 #[cfg(feature = "objc2-core-foundation")]
127 #[unsafe(method(boundingBox))]
129 #[unsafe(method_family = none)]
130 pub unsafe fn boundingBox(&self) -> CGRect;
131
132 #[unsafe(method(globalSegmentationMask))]
134 #[unsafe(method_family = none)]
135 pub unsafe fn globalSegmentationMask(&self) -> Option<Retained<VNPixelBufferObservation>>;
136 );
137}
138
139impl VNDetectedObjectObservation {
141 extern_methods!(
142 #[unsafe(method(init))]
143 #[unsafe(method_family = init)]
144 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
145
146 #[unsafe(method(new))]
147 #[unsafe(method_family = new)]
148 pub unsafe fn new() -> Retained<Self>;
149 );
150}
151
152extern_class!(
153 #[unsafe(super(VNDetectedObjectObservation, VNObservation, NSObject))]
159 #[derive(Debug, PartialEq, Eq, Hash)]
160 pub struct VNFaceObservation;
161);
162
163unsafe impl NSCoding for VNFaceObservation {}
164
165unsafe impl NSCopying for VNFaceObservation {}
166
167unsafe impl CopyingHelper for VNFaceObservation {
168 type Result = Self;
169}
170
171unsafe impl NSObjectProtocol for VNFaceObservation {}
172
173unsafe impl NSSecureCoding for VNFaceObservation {}
174
175#[cfg(feature = "VNRequestRevisionProviding")]
176unsafe impl VNRequestRevisionProviding for VNFaceObservation {}
177
178impl VNFaceObservation {
179 extern_methods!(
180 #[cfg(feature = "objc2-core-foundation")]
181 #[deprecated]
191 #[unsafe(method(faceObservationWithRequestRevision:boundingBox:roll:yaw:))]
192 #[unsafe(method_family = none)]
193 pub unsafe fn faceObservationWithRequestRevision_boundingBox_roll_yaw(
194 request_revision: NSUInteger,
195 bounding_box: CGRect,
196 roll: Option<&NSNumber>,
197 yaw: Option<&NSNumber>,
198 ) -> Retained<Self>;
199
200 #[cfg(feature = "objc2-core-foundation")]
201 #[unsafe(method(faceObservationWithRequestRevision:boundingBox:roll:yaw:pitch:))]
202 #[unsafe(method_family = none)]
203 pub unsafe fn faceObservationWithRequestRevision_boundingBox_roll_yaw_pitch(
204 request_revision: NSUInteger,
205 bounding_box: CGRect,
206 roll: Option<&NSNumber>,
207 yaw: Option<&NSNumber>,
208 pitch: Option<&NSNumber>,
209 ) -> Retained<Self>;
210
211 #[cfg(feature = "VNFaceLandmarks")]
212 #[unsafe(method(landmarks))]
214 #[unsafe(method_family = none)]
215 pub unsafe fn landmarks(&self) -> Option<Retained<VNFaceLandmarks2D>>;
216
217 #[unsafe(method(faceCaptureQuality))]
219 #[unsafe(method_family = none)]
220 pub unsafe fn faceCaptureQuality(&self) -> Option<Retained<NSNumber>>;
221
222 #[unsafe(method(roll))]
224 #[unsafe(method_family = none)]
225 pub unsafe fn roll(&self) -> Option<Retained<NSNumber>>;
226
227 #[unsafe(method(yaw))]
229 #[unsafe(method_family = none)]
230 pub unsafe fn yaw(&self) -> Option<Retained<NSNumber>>;
231
232 #[unsafe(method(pitch))]
234 #[unsafe(method_family = none)]
235 pub unsafe fn pitch(&self) -> Option<Retained<NSNumber>>;
236 );
237}
238
239impl VNFaceObservation {
241 extern_methods!(
242 #[cfg(feature = "objc2-core-foundation")]
243 #[unsafe(method(observationWithBoundingBox:))]
245 #[unsafe(method_family = none)]
246 pub unsafe fn observationWithBoundingBox(bounding_box: CGRect) -> Retained<Self>;
247
248 #[cfg(feature = "objc2-core-foundation")]
249 #[unsafe(method(observationWithRequestRevision:boundingBox:))]
250 #[unsafe(method_family = none)]
251 pub unsafe fn observationWithRequestRevision_boundingBox(
252 request_revision: NSUInteger,
253 bounding_box: CGRect,
254 ) -> Retained<Self>;
255 );
256}
257
258impl VNFaceObservation {
260 extern_methods!(
261 #[unsafe(method(init))]
262 #[unsafe(method_family = init)]
263 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
264
265 #[unsafe(method(new))]
266 #[unsafe(method_family = new)]
267 pub unsafe fn new() -> Retained<Self>;
268 );
269}
270
271extern_class!(
272 #[unsafe(super(VNObservation, NSObject))]
278 #[derive(Debug, PartialEq, Eq, Hash)]
279 pub struct VNClassificationObservation;
280);
281
282unsafe impl NSCoding for VNClassificationObservation {}
283
284unsafe impl NSCopying for VNClassificationObservation {}
285
286unsafe impl CopyingHelper for VNClassificationObservation {
287 type Result = Self;
288}
289
290unsafe impl NSObjectProtocol for VNClassificationObservation {}
291
292unsafe impl NSSecureCoding for VNClassificationObservation {}
293
294#[cfg(feature = "VNRequestRevisionProviding")]
295unsafe impl VNRequestRevisionProviding for VNClassificationObservation {}
296
297impl VNClassificationObservation {
298 extern_methods!(
299 #[unsafe(method(identifier))]
301 #[unsafe(method_family = none)]
302 pub unsafe fn identifier(&self) -> Retained<NSString>;
303 );
304}
305
306impl VNClassificationObservation {
308 extern_methods!(
309 #[unsafe(method(init))]
310 #[unsafe(method_family = init)]
311 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
312
313 #[unsafe(method(new))]
314 #[unsafe(method_family = new)]
315 pub unsafe fn new() -> Retained<Self>;
316 );
317}
318
319impl VNClassificationObservation {
324 extern_methods!(
325 #[unsafe(method(hasPrecisionRecallCurve))]
329 #[unsafe(method_family = none)]
330 pub unsafe fn hasPrecisionRecallCurve(&self) -> bool;
331
332 #[unsafe(method(hasMinimumRecall:forPrecision:))]
343 #[unsafe(method_family = none)]
344 pub unsafe fn hasMinimumRecall_forPrecision(
345 &self,
346 minimum_recall: c_float,
347 precision: c_float,
348 ) -> bool;
349
350 #[unsafe(method(hasMinimumPrecision:forRecall:))]
361 #[unsafe(method_family = none)]
362 pub unsafe fn hasMinimumPrecision_forRecall(
363 &self,
364 minimum_precision: c_float,
365 recall: c_float,
366 ) -> bool;
367 );
368}
369
370extern_class!(
371 #[unsafe(super(VNDetectedObjectObservation, VNObservation, NSObject))]
375 #[derive(Debug, PartialEq, Eq, Hash)]
376 pub struct VNRecognizedObjectObservation;
377);
378
379unsafe impl NSCoding for VNRecognizedObjectObservation {}
380
381unsafe impl NSCopying for VNRecognizedObjectObservation {}
382
383unsafe impl CopyingHelper for VNRecognizedObjectObservation {
384 type Result = Self;
385}
386
387unsafe impl NSObjectProtocol for VNRecognizedObjectObservation {}
388
389unsafe impl NSSecureCoding for VNRecognizedObjectObservation {}
390
391#[cfg(feature = "VNRequestRevisionProviding")]
392unsafe impl VNRequestRevisionProviding for VNRecognizedObjectObservation {}
393
394impl VNRecognizedObjectObservation {
395 extern_methods!(
396 #[unsafe(method(labels))]
397 #[unsafe(method_family = none)]
398 pub unsafe fn labels(&self) -> Retained<NSArray<VNClassificationObservation>>;
399 );
400}
401
402impl VNRecognizedObjectObservation {
404 extern_methods!(
405 #[cfg(feature = "objc2-core-foundation")]
406 #[unsafe(method(observationWithBoundingBox:))]
408 #[unsafe(method_family = none)]
409 pub unsafe fn observationWithBoundingBox(bounding_box: CGRect) -> Retained<Self>;
410
411 #[cfg(feature = "objc2-core-foundation")]
412 #[unsafe(method(observationWithRequestRevision:boundingBox:))]
413 #[unsafe(method_family = none)]
414 pub unsafe fn observationWithRequestRevision_boundingBox(
415 request_revision: NSUInteger,
416 bounding_box: CGRect,
417 ) -> Retained<Self>;
418 );
419}
420
421impl VNRecognizedObjectObservation {
423 extern_methods!(
424 #[unsafe(method(init))]
425 #[unsafe(method_family = init)]
426 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
427
428 #[unsafe(method(new))]
429 #[unsafe(method_family = new)]
430 pub unsafe fn new() -> Retained<Self>;
431 );
432}
433
434extern_class!(
435 #[unsafe(super(VNObservation, NSObject))]
441 #[derive(Debug, PartialEq, Eq, Hash)]
442 pub struct VNCoreMLFeatureValueObservation;
443);
444
445unsafe impl NSCoding for VNCoreMLFeatureValueObservation {}
446
447unsafe impl NSCopying for VNCoreMLFeatureValueObservation {}
448
449unsafe impl CopyingHelper for VNCoreMLFeatureValueObservation {
450 type Result = Self;
451}
452
453unsafe impl NSObjectProtocol for VNCoreMLFeatureValueObservation {}
454
455unsafe impl NSSecureCoding for VNCoreMLFeatureValueObservation {}
456
457#[cfg(feature = "VNRequestRevisionProviding")]
458unsafe impl VNRequestRevisionProviding for VNCoreMLFeatureValueObservation {}
459
460impl VNCoreMLFeatureValueObservation {
461 extern_methods!(
462 #[cfg(feature = "objc2-core-ml")]
463 #[unsafe(method(featureValue))]
465 #[unsafe(method_family = none)]
466 pub unsafe fn featureValue(&self) -> Retained<MLFeatureValue>;
467
468 #[unsafe(method(featureName))]
470 #[unsafe(method_family = none)]
471 pub unsafe fn featureName(&self) -> Retained<NSString>;
472 );
473}
474
475impl VNCoreMLFeatureValueObservation {
477 extern_methods!(
478 #[unsafe(method(init))]
479 #[unsafe(method_family = init)]
480 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
481
482 #[unsafe(method(new))]
483 #[unsafe(method_family = new)]
484 pub unsafe fn new() -> Retained<Self>;
485 );
486}
487
488extern_class!(
489 #[unsafe(super(VNObservation, NSObject))]
495 #[derive(Debug, PartialEq, Eq, Hash)]
496 pub struct VNPixelBufferObservation;
497);
498
499unsafe impl NSCoding for VNPixelBufferObservation {}
500
501unsafe impl NSCopying for VNPixelBufferObservation {}
502
503unsafe impl CopyingHelper for VNPixelBufferObservation {
504 type Result = Self;
505}
506
507unsafe impl NSObjectProtocol for VNPixelBufferObservation {}
508
509unsafe impl NSSecureCoding for VNPixelBufferObservation {}
510
511#[cfg(feature = "VNRequestRevisionProviding")]
512unsafe impl VNRequestRevisionProviding for VNPixelBufferObservation {}
513
514impl VNPixelBufferObservation {
515 extern_methods!(
516 #[cfg(feature = "objc2-core-video")]
517 #[unsafe(method(pixelBuffer))]
519 #[unsafe(method_family = none)]
520 pub unsafe fn pixelBuffer(&self) -> Retained<CVPixelBuffer>;
521
522 #[unsafe(method(featureName))]
524 #[unsafe(method_family = none)]
525 pub unsafe fn featureName(&self) -> Option<Retained<NSString>>;
526 );
527}
528
529impl VNPixelBufferObservation {
531 extern_methods!(
532 #[unsafe(method(init))]
533 #[unsafe(method_family = init)]
534 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
535
536 #[unsafe(method(new))]
537 #[unsafe(method_family = new)]
538 pub unsafe fn new() -> Retained<Self>;
539 );
540}
541
542extern_class!(
543 #[unsafe(super(VNDetectedObjectObservation, VNObservation, NSObject))]
549 #[derive(Debug, PartialEq, Eq, Hash)]
550 pub struct VNRectangleObservation;
551);
552
553unsafe impl NSCoding for VNRectangleObservation {}
554
555unsafe impl NSCopying for VNRectangleObservation {}
556
557unsafe impl CopyingHelper for VNRectangleObservation {
558 type Result = Self;
559}
560
561unsafe impl NSObjectProtocol for VNRectangleObservation {}
562
563unsafe impl NSSecureCoding for VNRectangleObservation {}
564
565#[cfg(feature = "VNRequestRevisionProviding")]
566unsafe impl VNRequestRevisionProviding for VNRectangleObservation {}
567
568impl VNRectangleObservation {
569 extern_methods!(
570 #[cfg(feature = "objc2-core-foundation")]
571 #[deprecated]
586 #[unsafe(method(rectangleObservationWithRequestRevision:topLeft:bottomLeft:bottomRight:topRight:))]
587 #[unsafe(method_family = none)]
588 pub unsafe fn rectangleObservationWithRequestRevision_topLeft_bottomLeft_bottomRight_topRight(
589 request_revision: NSUInteger,
590 top_left: CGPoint,
591 bottom_left: CGPoint,
592 bottom_right: CGPoint,
593 top_right: CGPoint,
594 ) -> Retained<Self>;
595
596 #[cfg(feature = "objc2-core-foundation")]
597 #[unsafe(method(rectangleObservationWithRequestRevision:topLeft:topRight:bottomRight:bottomLeft:))]
610 #[unsafe(method_family = none)]
611 pub unsafe fn rectangleObservationWithRequestRevision_topLeft_topRight_bottomRight_bottomLeft(
612 request_revision: NSUInteger,
613 top_left: CGPoint,
614 top_right: CGPoint,
615 bottom_right: CGPoint,
616 bottom_left: CGPoint,
617 ) -> Retained<Self>;
618
619 #[cfg(feature = "objc2-core-foundation")]
620 #[unsafe(method(topLeft))]
621 #[unsafe(method_family = none)]
622 pub unsafe fn topLeft(&self) -> CGPoint;
623
624 #[cfg(feature = "objc2-core-foundation")]
625 #[unsafe(method(topRight))]
626 #[unsafe(method_family = none)]
627 pub unsafe fn topRight(&self) -> CGPoint;
628
629 #[cfg(feature = "objc2-core-foundation")]
630 #[unsafe(method(bottomLeft))]
631 #[unsafe(method_family = none)]
632 pub unsafe fn bottomLeft(&self) -> CGPoint;
633
634 #[cfg(feature = "objc2-core-foundation")]
635 #[unsafe(method(bottomRight))]
636 #[unsafe(method_family = none)]
637 pub unsafe fn bottomRight(&self) -> CGPoint;
638 );
639}
640
641impl VNRectangleObservation {
643 extern_methods!(
644 #[cfg(feature = "objc2-core-foundation")]
645 #[unsafe(method(observationWithBoundingBox:))]
647 #[unsafe(method_family = none)]
648 pub unsafe fn observationWithBoundingBox(bounding_box: CGRect) -> Retained<Self>;
649
650 #[cfg(feature = "objc2-core-foundation")]
651 #[unsafe(method(observationWithRequestRevision:boundingBox:))]
652 #[unsafe(method_family = none)]
653 pub unsafe fn observationWithRequestRevision_boundingBox(
654 request_revision: NSUInteger,
655 bounding_box: CGRect,
656 ) -> Retained<Self>;
657 );
658}
659
660impl VNRectangleObservation {
662 extern_methods!(
663 #[unsafe(method(init))]
664 #[unsafe(method_family = init)]
665 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
666
667 #[unsafe(method(new))]
668 #[unsafe(method_family = new)]
669 pub unsafe fn new() -> Retained<Self>;
670 );
671}
672
673extern_class!(
674 #[unsafe(super(VNObservation, NSObject))]
678 #[derive(Debug, PartialEq, Eq, Hash)]
679 pub struct VNTrajectoryObservation;
680);
681
682unsafe impl NSCoding for VNTrajectoryObservation {}
683
684unsafe impl NSCopying for VNTrajectoryObservation {}
685
686unsafe impl CopyingHelper for VNTrajectoryObservation {
687 type Result = Self;
688}
689
690unsafe impl NSObjectProtocol for VNTrajectoryObservation {}
691
692unsafe impl NSSecureCoding for VNTrajectoryObservation {}
693
694#[cfg(feature = "VNRequestRevisionProviding")]
695unsafe impl VNRequestRevisionProviding for VNTrajectoryObservation {}
696
697impl VNTrajectoryObservation {
698 extern_methods!(
699 #[cfg(feature = "VNGeometry")]
700 #[unsafe(method(detectedPoints))]
704 #[unsafe(method_family = none)]
705 pub unsafe fn detectedPoints(&self) -> Retained<NSArray<VNPoint>>;
706
707 #[cfg(feature = "VNGeometry")]
708 #[unsafe(method(projectedPoints))]
712 #[unsafe(method_family = none)]
713 pub unsafe fn projectedPoints(&self) -> Retained<NSArray<VNPoint>>;
714
715 #[cfg(feature = "objc2-core-foundation")]
716 #[unsafe(method(movingAverageRadius))]
720 #[unsafe(method_family = none)]
721 pub unsafe fn movingAverageRadius(&self) -> CGFloat;
722 );
723}
724
725impl VNTrajectoryObservation {
727 extern_methods!(
728 #[unsafe(method(init))]
729 #[unsafe(method_family = init)]
730 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
731
732 #[unsafe(method(new))]
733 #[unsafe(method_family = new)]
734 pub unsafe fn new() -> Retained<Self>;
735 );
736}
737
738extern_class!(
739 #[unsafe(super(
743 VNRectangleObservation,
744 VNDetectedObjectObservation,
745 VNObservation,
746 NSObject
747 ))]
748 #[derive(Debug, PartialEq, Eq, Hash)]
749 pub struct VNTextObservation;
750);
751
752unsafe impl NSCoding for VNTextObservation {}
753
754unsafe impl NSCopying for VNTextObservation {}
755
756unsafe impl CopyingHelper for VNTextObservation {
757 type Result = Self;
758}
759
760unsafe impl NSObjectProtocol for VNTextObservation {}
761
762unsafe impl NSSecureCoding for VNTextObservation {}
763
764#[cfg(feature = "VNRequestRevisionProviding")]
765unsafe impl VNRequestRevisionProviding for VNTextObservation {}
766
767impl VNTextObservation {
768 extern_methods!(
769 #[unsafe(method(characterBoxes))]
774 #[unsafe(method_family = none)]
775 pub unsafe fn characterBoxes(&self) -> Option<Retained<NSArray<VNRectangleObservation>>>;
776 );
777}
778
779impl VNTextObservation {
781 extern_methods!(
782 #[cfg(feature = "objc2-core-foundation")]
783 #[deprecated]
798 #[unsafe(method(rectangleObservationWithRequestRevision:topLeft:bottomLeft:bottomRight:topRight:))]
799 #[unsafe(method_family = none)]
800 pub unsafe fn rectangleObservationWithRequestRevision_topLeft_bottomLeft_bottomRight_topRight(
801 request_revision: NSUInteger,
802 top_left: CGPoint,
803 bottom_left: CGPoint,
804 bottom_right: CGPoint,
805 top_right: CGPoint,
806 ) -> Retained<Self>;
807
808 #[cfg(feature = "objc2-core-foundation")]
809 #[unsafe(method(rectangleObservationWithRequestRevision:topLeft:topRight:bottomRight:bottomLeft:))]
822 #[unsafe(method_family = none)]
823 pub unsafe fn rectangleObservationWithRequestRevision_topLeft_topRight_bottomRight_bottomLeft(
824 request_revision: NSUInteger,
825 top_left: CGPoint,
826 top_right: CGPoint,
827 bottom_right: CGPoint,
828 bottom_left: CGPoint,
829 ) -> Retained<Self>;
830 );
831}
832
833impl VNTextObservation {
835 extern_methods!(
836 #[cfg(feature = "objc2-core-foundation")]
837 #[unsafe(method(observationWithBoundingBox:))]
839 #[unsafe(method_family = none)]
840 pub unsafe fn observationWithBoundingBox(bounding_box: CGRect) -> Retained<Self>;
841
842 #[cfg(feature = "objc2-core-foundation")]
843 #[unsafe(method(observationWithRequestRevision:boundingBox:))]
844 #[unsafe(method_family = none)]
845 pub unsafe fn observationWithRequestRevision_boundingBox(
846 request_revision: NSUInteger,
847 bounding_box: CGRect,
848 ) -> Retained<Self>;
849 );
850}
851
852impl VNTextObservation {
854 extern_methods!(
855 #[unsafe(method(init))]
856 #[unsafe(method_family = init)]
857 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
858
859 #[unsafe(method(new))]
860 #[unsafe(method_family = new)]
861 pub unsafe fn new() -> Retained<Self>;
862 );
863}
864
865extern_class!(
866 #[unsafe(super(NSObject))]
870 #[derive(Debug, PartialEq, Eq, Hash)]
871 pub struct VNRecognizedText;
872);
873
874unsafe impl NSCoding for VNRecognizedText {}
875
876unsafe impl NSCopying for VNRecognizedText {}
877
878unsafe impl CopyingHelper for VNRecognizedText {
879 type Result = Self;
880}
881
882unsafe impl NSObjectProtocol for VNRecognizedText {}
883
884unsafe impl NSSecureCoding for VNRecognizedText {}
885
886#[cfg(feature = "VNRequestRevisionProviding")]
887unsafe impl VNRequestRevisionProviding for VNRecognizedText {}
888
889impl VNRecognizedText {
890 extern_methods!(
891 #[unsafe(method(string))]
895 #[unsafe(method_family = none)]
896 pub fn string(&self) -> Retained<NSString>;
897
898 #[cfg(feature = "VNTypes")]
899 #[unsafe(method(confidence))]
901 #[unsafe(method_family = none)]
902 pub fn confidence(&self) -> VNConfidence;
903 );
904}
905
906impl VNRecognizedText {
908 extern_methods!(
909 #[unsafe(method(init))]
910 #[unsafe(method_family = init)]
911 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
912
913 #[unsafe(method(new))]
914 #[unsafe(method_family = new)]
915 pub unsafe fn new() -> Retained<Self>;
916 );
917}
918
919extern_class!(
920 #[unsafe(super(
924 VNRectangleObservation,
925 VNDetectedObjectObservation,
926 VNObservation,
927 NSObject
928 ))]
929 #[derive(Debug, PartialEq, Eq, Hash)]
930 pub struct VNRecognizedTextObservation;
931);
932
933unsafe impl NSCoding for VNRecognizedTextObservation {}
934
935unsafe impl NSCopying for VNRecognizedTextObservation {}
936
937unsafe impl CopyingHelper for VNRecognizedTextObservation {
938 type Result = Self;
939}
940
941unsafe impl NSObjectProtocol for VNRecognizedTextObservation {}
942
943unsafe impl NSSecureCoding for VNRecognizedTextObservation {}
944
945#[cfg(feature = "VNRequestRevisionProviding")]
946unsafe impl VNRequestRevisionProviding for VNRecognizedTextObservation {}
947
948impl VNRecognizedTextObservation {
949 extern_methods!(
950 #[unsafe(method(topCandidates:))]
954 #[unsafe(method_family = none)]
955 pub fn topCandidates(
956 &self,
957 max_candidate_count: NSUInteger,
958 ) -> Retained<NSArray<VNRecognizedText>>;
959 );
960}
961
962impl VNRecognizedTextObservation {
964 extern_methods!(
965 #[cfg(feature = "objc2-core-foundation")]
966 #[deprecated]
981 #[unsafe(method(rectangleObservationWithRequestRevision:topLeft:bottomLeft:bottomRight:topRight:))]
982 #[unsafe(method_family = none)]
983 pub unsafe fn rectangleObservationWithRequestRevision_topLeft_bottomLeft_bottomRight_topRight(
984 request_revision: NSUInteger,
985 top_left: CGPoint,
986 bottom_left: CGPoint,
987 bottom_right: CGPoint,
988 top_right: CGPoint,
989 ) -> Retained<Self>;
990
991 #[cfg(feature = "objc2-core-foundation")]
992 #[unsafe(method(rectangleObservationWithRequestRevision:topLeft:topRight:bottomRight:bottomLeft:))]
1005 #[unsafe(method_family = none)]
1006 pub unsafe fn rectangleObservationWithRequestRevision_topLeft_topRight_bottomRight_bottomLeft(
1007 request_revision: NSUInteger,
1008 top_left: CGPoint,
1009 top_right: CGPoint,
1010 bottom_right: CGPoint,
1011 bottom_left: CGPoint,
1012 ) -> Retained<Self>;
1013 );
1014}
1015
1016impl VNRecognizedTextObservation {
1018 extern_methods!(
1019 #[cfg(feature = "objc2-core-foundation")]
1020 #[unsafe(method(observationWithBoundingBox:))]
1022 #[unsafe(method_family = none)]
1023 pub unsafe fn observationWithBoundingBox(bounding_box: CGRect) -> Retained<Self>;
1024
1025 #[cfg(feature = "objc2-core-foundation")]
1026 #[unsafe(method(observationWithRequestRevision:boundingBox:))]
1027 #[unsafe(method_family = none)]
1028 pub unsafe fn observationWithRequestRevision_boundingBox(
1029 request_revision: NSUInteger,
1030 bounding_box: CGRect,
1031 ) -> Retained<Self>;
1032 );
1033}
1034
1035impl VNRecognizedTextObservation {
1037 extern_methods!(
1038 #[unsafe(method(init))]
1039 #[unsafe(method_family = init)]
1040 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1041
1042 #[unsafe(method(new))]
1043 #[unsafe(method_family = new)]
1044 pub unsafe fn new() -> Retained<Self>;
1045 );
1046}
1047
1048extern_class!(
1049 #[unsafe(super(
1053 VNRectangleObservation,
1054 VNDetectedObjectObservation,
1055 VNObservation,
1056 NSObject
1057 ))]
1058 #[derive(Debug, PartialEq, Eq, Hash)]
1059 pub struct VNBarcodeObservation;
1060);
1061
1062unsafe impl NSCoding for VNBarcodeObservation {}
1063
1064unsafe impl NSCopying for VNBarcodeObservation {}
1065
1066unsafe impl CopyingHelper for VNBarcodeObservation {
1067 type Result = Self;
1068}
1069
1070unsafe impl NSObjectProtocol for VNBarcodeObservation {}
1071
1072unsafe impl NSSecureCoding for VNBarcodeObservation {}
1073
1074#[cfg(feature = "VNRequestRevisionProviding")]
1075unsafe impl VNRequestRevisionProviding for VNBarcodeObservation {}
1076
1077impl VNBarcodeObservation {
1078 extern_methods!(
1079 #[cfg(feature = "VNTypes")]
1080 #[unsafe(method(symbology))]
1082 #[unsafe(method_family = none)]
1083 pub unsafe fn symbology(&self) -> Retained<VNBarcodeSymbology>;
1084
1085 #[cfg(feature = "objc2-core-image")]
1086 #[unsafe(method(barcodeDescriptor))]
1088 #[unsafe(method_family = none)]
1089 pub unsafe fn barcodeDescriptor(&self) -> Option<Retained<CIBarcodeDescriptor>>;
1090
1091 #[unsafe(method(payloadStringValue))]
1093 #[unsafe(method_family = none)]
1094 pub unsafe fn payloadStringValue(&self) -> Option<Retained<NSString>>;
1095
1096 #[unsafe(method(payloadData))]
1098 #[unsafe(method_family = none)]
1099 pub unsafe fn payloadData(&self) -> Option<Retained<NSData>>;
1100
1101 #[unsafe(method(isGS1DataCarrier))]
1103 #[unsafe(method_family = none)]
1104 pub unsafe fn isGS1DataCarrier(&self) -> bool;
1105
1106 #[unsafe(method(isColorInverted))]
1108 #[unsafe(method_family = none)]
1109 pub unsafe fn isColorInverted(&self) -> bool;
1110
1111 #[cfg(feature = "VNTypes")]
1112 #[unsafe(method(supplementalCompositeType))]
1115 #[unsafe(method_family = none)]
1116 pub unsafe fn supplementalCompositeType(&self) -> VNBarcodeCompositeType;
1117
1118 #[unsafe(method(supplementalPayloadString))]
1121 #[unsafe(method_family = none)]
1122 pub unsafe fn supplementalPayloadString(&self) -> Option<Retained<NSString>>;
1123
1124 #[unsafe(method(supplementalPayloadData))]
1127 #[unsafe(method_family = none)]
1128 pub unsafe fn supplementalPayloadData(&self) -> Option<Retained<NSData>>;
1129 );
1130}
1131
1132impl VNBarcodeObservation {
1134 extern_methods!(
1135 #[cfg(feature = "objc2-core-foundation")]
1136 #[deprecated]
1151 #[unsafe(method(rectangleObservationWithRequestRevision:topLeft:bottomLeft:bottomRight:topRight:))]
1152 #[unsafe(method_family = none)]
1153 pub unsafe fn rectangleObservationWithRequestRevision_topLeft_bottomLeft_bottomRight_topRight(
1154 request_revision: NSUInteger,
1155 top_left: CGPoint,
1156 bottom_left: CGPoint,
1157 bottom_right: CGPoint,
1158 top_right: CGPoint,
1159 ) -> Retained<Self>;
1160
1161 #[cfg(feature = "objc2-core-foundation")]
1162 #[unsafe(method(rectangleObservationWithRequestRevision:topLeft:topRight:bottomRight:bottomLeft:))]
1175 #[unsafe(method_family = none)]
1176 pub unsafe fn rectangleObservationWithRequestRevision_topLeft_topRight_bottomRight_bottomLeft(
1177 request_revision: NSUInteger,
1178 top_left: CGPoint,
1179 top_right: CGPoint,
1180 bottom_right: CGPoint,
1181 bottom_left: CGPoint,
1182 ) -> Retained<Self>;
1183 );
1184}
1185
1186impl VNBarcodeObservation {
1188 extern_methods!(
1189 #[cfg(feature = "objc2-core-foundation")]
1190 #[unsafe(method(observationWithBoundingBox:))]
1192 #[unsafe(method_family = none)]
1193 pub unsafe fn observationWithBoundingBox(bounding_box: CGRect) -> Retained<Self>;
1194
1195 #[cfg(feature = "objc2-core-foundation")]
1196 #[unsafe(method(observationWithRequestRevision:boundingBox:))]
1197 #[unsafe(method_family = none)]
1198 pub unsafe fn observationWithRequestRevision_boundingBox(
1199 request_revision: NSUInteger,
1200 bounding_box: CGRect,
1201 ) -> Retained<Self>;
1202 );
1203}
1204
1205impl VNBarcodeObservation {
1207 extern_methods!(
1208 #[unsafe(method(init))]
1209 #[unsafe(method_family = init)]
1210 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1211
1212 #[unsafe(method(new))]
1213 #[unsafe(method_family = new)]
1214 pub unsafe fn new() -> Retained<Self>;
1215 );
1216}
1217
1218extern_class!(
1219 #[unsafe(super(VNObservation, NSObject))]
1225 #[derive(Debug, PartialEq, Eq, Hash)]
1226 pub struct VNHorizonObservation;
1227);
1228
1229unsafe impl NSCoding for VNHorizonObservation {}
1230
1231unsafe impl NSCopying for VNHorizonObservation {}
1232
1233unsafe impl CopyingHelper for VNHorizonObservation {
1234 type Result = Self;
1235}
1236
1237unsafe impl NSObjectProtocol for VNHorizonObservation {}
1238
1239unsafe impl NSSecureCoding for VNHorizonObservation {}
1240
1241#[cfg(feature = "VNRequestRevisionProviding")]
1242unsafe impl VNRequestRevisionProviding for VNHorizonObservation {}
1243
1244impl VNHorizonObservation {
1245 extern_methods!(
1246 #[cfg(feature = "objc2-core-foundation")]
1247 #[unsafe(method(transform))]
1251 #[unsafe(method_family = none)]
1252 pub unsafe fn transform(&self) -> CGAffineTransform;
1253
1254 #[cfg(feature = "objc2-core-foundation")]
1255 #[unsafe(method(angle))]
1257 #[unsafe(method_family = none)]
1258 pub unsafe fn angle(&self) -> CGFloat;
1259
1260 #[cfg(feature = "objc2-core-foundation")]
1261 #[unsafe(method(transformForImageWidth:height:))]
1263 #[unsafe(method_family = none)]
1264 pub unsafe fn transformForImageWidth_height(
1265 &self,
1266 width: usize,
1267 height: usize,
1268 ) -> CGAffineTransform;
1269 );
1270}
1271
1272impl VNHorizonObservation {
1274 extern_methods!(
1275 #[unsafe(method(init))]
1276 #[unsafe(method_family = init)]
1277 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1278
1279 #[unsafe(method(new))]
1280 #[unsafe(method_family = new)]
1281 pub unsafe fn new() -> Retained<Self>;
1282 );
1283}
1284
1285extern_class!(
1286 #[unsafe(super(VNObservation, NSObject))]
1290 #[derive(Debug, PartialEq, Eq, Hash)]
1291 pub struct VNImageAlignmentObservation;
1292);
1293
1294unsafe impl NSCoding for VNImageAlignmentObservation {}
1295
1296unsafe impl NSCopying for VNImageAlignmentObservation {}
1297
1298unsafe impl CopyingHelper for VNImageAlignmentObservation {
1299 type Result = Self;
1300}
1301
1302unsafe impl NSObjectProtocol for VNImageAlignmentObservation {}
1303
1304unsafe impl NSSecureCoding for VNImageAlignmentObservation {}
1305
1306#[cfg(feature = "VNRequestRevisionProviding")]
1307unsafe impl VNRequestRevisionProviding for VNImageAlignmentObservation {}
1308
1309impl VNImageAlignmentObservation {
1310 extern_methods!();
1311}
1312
1313impl VNImageAlignmentObservation {
1315 extern_methods!(
1316 #[unsafe(method(init))]
1317 #[unsafe(method_family = init)]
1318 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1319
1320 #[unsafe(method(new))]
1321 #[unsafe(method_family = new)]
1322 pub unsafe fn new() -> Retained<Self>;
1323 );
1324}
1325
1326extern_class!(
1327 #[unsafe(super(VNImageAlignmentObservation, VNObservation, NSObject))]
1331 #[derive(Debug, PartialEq, Eq, Hash)]
1332 pub struct VNImageTranslationAlignmentObservation;
1333);
1334
1335unsafe impl NSCoding for VNImageTranslationAlignmentObservation {}
1336
1337unsafe impl NSCopying for VNImageTranslationAlignmentObservation {}
1338
1339unsafe impl CopyingHelper for VNImageTranslationAlignmentObservation {
1340 type Result = Self;
1341}
1342
1343unsafe impl NSObjectProtocol for VNImageTranslationAlignmentObservation {}
1344
1345unsafe impl NSSecureCoding for VNImageTranslationAlignmentObservation {}
1346
1347#[cfg(feature = "VNRequestRevisionProviding")]
1348unsafe impl VNRequestRevisionProviding for VNImageTranslationAlignmentObservation {}
1349
1350impl VNImageTranslationAlignmentObservation {
1351 extern_methods!(
1352 #[cfg(feature = "objc2-core-foundation")]
1353 #[unsafe(method(alignmentTransform))]
1354 #[unsafe(method_family = none)]
1355 pub unsafe fn alignmentTransform(&self) -> CGAffineTransform;
1356 );
1357}
1358
1359impl VNImageTranslationAlignmentObservation {
1361 extern_methods!(
1362 #[unsafe(method(init))]
1363 #[unsafe(method_family = init)]
1364 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1365
1366 #[unsafe(method(new))]
1367 #[unsafe(method_family = new)]
1368 pub unsafe fn new() -> Retained<Self>;
1369 );
1370}
1371
1372extern_class!(
1373 #[unsafe(super(VNImageAlignmentObservation, VNObservation, NSObject))]
1377 #[derive(Debug, PartialEq, Eq, Hash)]
1378 pub struct VNImageHomographicAlignmentObservation;
1379);
1380
1381unsafe impl NSCoding for VNImageHomographicAlignmentObservation {}
1382
1383unsafe impl NSCopying for VNImageHomographicAlignmentObservation {}
1384
1385unsafe impl CopyingHelper for VNImageHomographicAlignmentObservation {
1386 type Result = Self;
1387}
1388
1389unsafe impl NSObjectProtocol for VNImageHomographicAlignmentObservation {}
1390
1391unsafe impl NSSecureCoding for VNImageHomographicAlignmentObservation {}
1392
1393#[cfg(feature = "VNRequestRevisionProviding")]
1394unsafe impl VNRequestRevisionProviding for VNImageHomographicAlignmentObservation {}
1395
1396impl VNImageHomographicAlignmentObservation {
1397 extern_methods!();
1398}
1399
1400impl VNImageHomographicAlignmentObservation {
1402 extern_methods!(
1403 #[unsafe(method(init))]
1404 #[unsafe(method_family = init)]
1405 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1406
1407 #[unsafe(method(new))]
1408 #[unsafe(method_family = new)]
1409 pub unsafe fn new() -> Retained<Self>;
1410 );
1411}
1412
1413extern_class!(
1414 #[unsafe(super(VNPixelBufferObservation, VNObservation, NSObject))]
1420 #[derive(Debug, PartialEq, Eq, Hash)]
1421 pub struct VNSaliencyImageObservation;
1422);
1423
1424unsafe impl NSCoding for VNSaliencyImageObservation {}
1425
1426unsafe impl NSCopying for VNSaliencyImageObservation {}
1427
1428unsafe impl CopyingHelper for VNSaliencyImageObservation {
1429 type Result = Self;
1430}
1431
1432unsafe impl NSObjectProtocol for VNSaliencyImageObservation {}
1433
1434unsafe impl NSSecureCoding for VNSaliencyImageObservation {}
1435
1436#[cfg(feature = "VNRequestRevisionProviding")]
1437unsafe impl VNRequestRevisionProviding for VNSaliencyImageObservation {}
1438
1439impl VNSaliencyImageObservation {
1440 extern_methods!(
1441 #[unsafe(method(salientObjects))]
1443 #[unsafe(method_family = none)]
1444 pub unsafe fn salientObjects(&self) -> Option<Retained<NSArray<VNRectangleObservation>>>;
1445 );
1446}
1447
1448impl VNSaliencyImageObservation {
1450 extern_methods!(
1451 #[unsafe(method(init))]
1452 #[unsafe(method_family = init)]
1453 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1454
1455 #[unsafe(method(new))]
1456 #[unsafe(method_family = new)]
1457 pub unsafe fn new() -> Retained<Self>;
1458 );
1459}
1460
1461extern_class!(
1462 #[unsafe(super(VNObservation, NSObject))]
1464 #[derive(Debug, PartialEq, Eq, Hash)]
1465 pub struct VNFeaturePrintObservation;
1466);
1467
1468unsafe impl NSCoding for VNFeaturePrintObservation {}
1469
1470unsafe impl NSCopying for VNFeaturePrintObservation {}
1471
1472unsafe impl CopyingHelper for VNFeaturePrintObservation {
1473 type Result = Self;
1474}
1475
1476unsafe impl NSObjectProtocol for VNFeaturePrintObservation {}
1477
1478unsafe impl NSSecureCoding for VNFeaturePrintObservation {}
1479
1480#[cfg(feature = "VNRequestRevisionProviding")]
1481unsafe impl VNRequestRevisionProviding for VNFeaturePrintObservation {}
1482
1483impl VNFeaturePrintObservation {
1484 extern_methods!(
1485 #[cfg(feature = "VNTypes")]
1486 #[unsafe(method(elementType))]
1488 #[unsafe(method_family = none)]
1489 pub unsafe fn elementType(&self) -> VNElementType;
1490
1491 #[unsafe(method(elementCount))]
1493 #[unsafe(method_family = none)]
1494 pub unsafe fn elementCount(&self) -> NSUInteger;
1495
1496 #[unsafe(method(data))]
1498 #[unsafe(method_family = none)]
1499 pub unsafe fn data(&self) -> Retained<NSData>;
1500
1501 #[unsafe(method(computeDistance:toFeaturePrintObservation:error:_))]
1505 #[unsafe(method_family = none)]
1506 pub unsafe fn computeDistance_toFeaturePrintObservation_error(
1507 &self,
1508 out_distance: NonNull<c_float>,
1509 feature_print: &VNFeaturePrintObservation,
1510 ) -> Result<(), Retained<NSError>>;
1511 );
1512}
1513
1514impl VNFeaturePrintObservation {
1516 extern_methods!(
1517 #[unsafe(method(init))]
1518 #[unsafe(method_family = init)]
1519 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1520
1521 #[unsafe(method(new))]
1522 #[unsafe(method_family = new)]
1523 pub unsafe fn new() -> Retained<Self>;
1524 );
1525}
1526
1527extern_class!(
1528 #[unsafe(super(VNObservation, NSObject))]
1530 #[derive(Debug, PartialEq, Eq, Hash)]
1531 pub struct VNContoursObservation;
1532);
1533
1534unsafe impl NSCoding for VNContoursObservation {}
1535
1536unsafe impl NSCopying for VNContoursObservation {}
1537
1538unsafe impl CopyingHelper for VNContoursObservation {
1539 type Result = Self;
1540}
1541
1542unsafe impl NSObjectProtocol for VNContoursObservation {}
1543
1544unsafe impl NSSecureCoding for VNContoursObservation {}
1545
1546#[cfg(feature = "VNRequestRevisionProviding")]
1547unsafe impl VNRequestRevisionProviding for VNContoursObservation {}
1548
1549impl VNContoursObservation {
1550 extern_methods!(
1551 #[unsafe(method(contourCount))]
1553 #[unsafe(method_family = none)]
1554 pub unsafe fn contourCount(&self) -> NSInteger;
1555
1556 #[cfg(feature = "VNGeometry")]
1557 #[unsafe(method(contourAtIndex:error:_))]
1565 #[unsafe(method_family = none)]
1566 pub unsafe fn contourAtIndex_error(
1567 &self,
1568 contour_index: NSInteger,
1569 ) -> Result<Retained<VNContour>, Retained<NSError>>;
1570
1571 #[unsafe(method(topLevelContourCount))]
1573 #[unsafe(method_family = none)]
1574 pub unsafe fn topLevelContourCount(&self) -> NSInteger;
1575
1576 #[cfg(feature = "VNGeometry")]
1577 #[unsafe(method(topLevelContours))]
1583 #[unsafe(method_family = none)]
1584 pub unsafe fn topLevelContours(&self) -> Retained<NSArray<VNContour>>;
1585
1586 #[cfg(feature = "VNGeometry")]
1587 #[unsafe(method(contourAtIndexPath:error:_))]
1597 #[unsafe(method_family = none)]
1598 pub unsafe fn contourAtIndexPath_error(
1599 &self,
1600 index_path: &NSIndexPath,
1601 ) -> Result<Retained<VNContour>, Retained<NSError>>;
1602
1603 #[cfg(feature = "objc2-core-graphics")]
1604 #[unsafe(method(normalizedPath))]
1608 #[unsafe(method_family = none)]
1609 pub unsafe fn normalizedPath(&self) -> Retained<CGPath>;
1610 );
1611}
1612
1613impl VNContoursObservation {
1615 extern_methods!(
1616 #[unsafe(method(init))]
1617 #[unsafe(method_family = init)]
1618 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1619
1620 #[unsafe(method(new))]
1621 #[unsafe(method_family = new)]
1622 pub unsafe fn new() -> Retained<Self>;
1623 );
1624}
1625
1626extern "C" {
1627 #[cfg(feature = "VNTypes")]
1629 pub static VNRecognizedPointGroupKeyAll: &'static VNRecognizedPointGroupKey;
1630}
1631
1632extern_class!(
1633 #[unsafe(super(VNObservation, NSObject))]
1637 #[derive(Debug, PartialEq, Eq, Hash)]
1638 pub struct VNRecognizedPointsObservation;
1639);
1640
1641unsafe impl NSCoding for VNRecognizedPointsObservation {}
1642
1643unsafe impl NSCopying for VNRecognizedPointsObservation {}
1644
1645unsafe impl CopyingHelper for VNRecognizedPointsObservation {
1646 type Result = Self;
1647}
1648
1649unsafe impl NSObjectProtocol for VNRecognizedPointsObservation {}
1650
1651unsafe impl NSSecureCoding for VNRecognizedPointsObservation {}
1652
1653#[cfg(feature = "VNRequestRevisionProviding")]
1654unsafe impl VNRequestRevisionProviding for VNRecognizedPointsObservation {}
1655
1656impl VNRecognizedPointsObservation {
1657 extern_methods!(
1658 #[unsafe(method(new))]
1659 #[unsafe(method_family = new)]
1660 pub unsafe fn new() -> Retained<Self>;
1661
1662 #[unsafe(method(init))]
1663 #[unsafe(method_family = init)]
1664 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1665
1666 #[cfg(feature = "VNTypes")]
1667 #[unsafe(method(availableKeys))]
1669 #[unsafe(method_family = none)]
1670 pub unsafe fn availableKeys(&self) -> Retained<NSArray<VNRecognizedPointKey>>;
1671
1672 #[cfg(feature = "VNTypes")]
1673 #[unsafe(method(availableGroupKeys))]
1675 #[unsafe(method_family = none)]
1676 pub unsafe fn availableGroupKeys(&self) -> Retained<NSArray<VNRecognizedPointGroupKey>>;
1677
1678 #[cfg(all(
1679 feature = "VNDetectedPoint",
1680 feature = "VNGeometry",
1681 feature = "VNTypes"
1682 ))]
1683 #[unsafe(method(recognizedPointForKey:error:_))]
1694 #[unsafe(method_family = none)]
1695 pub unsafe fn recognizedPointForKey_error(
1696 &self,
1697 point_key: &VNRecognizedPointKey,
1698 ) -> Result<Retained<VNRecognizedPoint>, Retained<NSError>>;
1699
1700 #[cfg(all(
1701 feature = "VNDetectedPoint",
1702 feature = "VNGeometry",
1703 feature = "VNTypes"
1704 ))]
1705 #[unsafe(method(recognizedPointsForGroupKey:error:_))]
1717 #[unsafe(method_family = none)]
1718 pub unsafe fn recognizedPointsForGroupKey_error(
1719 &self,
1720 group_key: &VNRecognizedPointGroupKey,
1721 ) -> Result<
1722 Retained<NSDictionary<VNRecognizedPointKey, VNRecognizedPoint>>,
1723 Retained<NSError>,
1724 >;
1725
1726 #[cfg(feature = "objc2-core-ml")]
1727 #[unsafe(method(keypointsMultiArrayAndReturnError:_))]
1739 #[unsafe(method_family = none)]
1740 pub unsafe fn keypointsMultiArrayAndReturnError(
1741 &self,
1742 ) -> Result<Retained<MLMultiArray>, Retained<NSError>>;
1743 );
1744}
1745
1746extern_class!(
1747 #[unsafe(super(VNDetectedObjectObservation, VNObservation, NSObject))]
1751 #[derive(Debug, PartialEq, Eq, Hash)]
1752 pub struct VNHumanObservation;
1753);
1754
1755unsafe impl NSCoding for VNHumanObservation {}
1756
1757unsafe impl NSCopying for VNHumanObservation {}
1758
1759unsafe impl CopyingHelper for VNHumanObservation {
1760 type Result = Self;
1761}
1762
1763unsafe impl NSObjectProtocol for VNHumanObservation {}
1764
1765unsafe impl NSSecureCoding for VNHumanObservation {}
1766
1767#[cfg(feature = "VNRequestRevisionProviding")]
1768unsafe impl VNRequestRevisionProviding for VNHumanObservation {}
1769
1770impl VNHumanObservation {
1771 extern_methods!(
1772 #[unsafe(method(upperBodyOnly))]
1774 #[unsafe(method_family = none)]
1775 pub unsafe fn upperBodyOnly(&self) -> bool;
1776 );
1777}
1778
1779impl VNHumanObservation {
1781 extern_methods!(
1782 #[cfg(feature = "objc2-core-foundation")]
1783 #[unsafe(method(observationWithBoundingBox:))]
1785 #[unsafe(method_family = none)]
1786 pub unsafe fn observationWithBoundingBox(bounding_box: CGRect) -> Retained<Self>;
1787
1788 #[cfg(feature = "objc2-core-foundation")]
1789 #[unsafe(method(observationWithRequestRevision:boundingBox:))]
1790 #[unsafe(method_family = none)]
1791 pub unsafe fn observationWithRequestRevision_boundingBox(
1792 request_revision: NSUInteger,
1793 bounding_box: CGRect,
1794 ) -> Retained<Self>;
1795 );
1796}
1797
1798impl VNHumanObservation {
1800 extern_methods!(
1801 #[unsafe(method(init))]
1802 #[unsafe(method_family = init)]
1803 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1804
1805 #[unsafe(method(new))]
1806 #[unsafe(method_family = new)]
1807 pub unsafe fn new() -> Retained<Self>;
1808 );
1809}
1810
1811extern_class!(
1812 #[unsafe(super(VNObservation, NSObject))]
1816 #[derive(Debug, PartialEq, Eq, Hash)]
1817 pub struct VNInstanceMaskObservation;
1818);
1819
1820unsafe impl NSCoding for VNInstanceMaskObservation {}
1821
1822unsafe impl NSCopying for VNInstanceMaskObservation {}
1823
1824unsafe impl CopyingHelper for VNInstanceMaskObservation {
1825 type Result = Self;
1826}
1827
1828unsafe impl NSObjectProtocol for VNInstanceMaskObservation {}
1829
1830unsafe impl NSSecureCoding for VNInstanceMaskObservation {}
1831
1832#[cfg(feature = "VNRequestRevisionProviding")]
1833unsafe impl VNRequestRevisionProviding for VNInstanceMaskObservation {}
1834
1835impl VNInstanceMaskObservation {
1836 extern_methods!(
1837 #[cfg(feature = "objc2-core-video")]
1838 #[unsafe(method(instanceMask))]
1841 #[unsafe(method_family = none)]
1842 pub unsafe fn instanceMask(&self) -> Retained<CVPixelBuffer>;
1843
1844 #[unsafe(method(allInstances))]
1846 #[unsafe(method_family = none)]
1847 pub unsafe fn allInstances(&self) -> Retained<NSIndexSet>;
1848 );
1849}
1850
1851impl VNInstanceMaskObservation {
1853 extern_methods!(
1854 #[unsafe(method(init))]
1855 #[unsafe(method_family = init)]
1856 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1857
1858 #[unsafe(method(new))]
1859 #[unsafe(method_family = new)]
1860 pub unsafe fn new() -> Retained<Self>;
1861 );
1862}
1863
1864extern_class!(
1865 #[unsafe(super(VNRecognizedPointsObservation, VNObservation, NSObject))]
1867 #[derive(Debug, PartialEq, Eq, Hash)]
1868 pub struct VNAnimalBodyPoseObservation;
1869);
1870
1871unsafe impl NSCoding for VNAnimalBodyPoseObservation {}
1872
1873unsafe impl NSCopying for VNAnimalBodyPoseObservation {}
1874
1875unsafe impl CopyingHelper for VNAnimalBodyPoseObservation {
1876 type Result = Self;
1877}
1878
1879unsafe impl NSObjectProtocol for VNAnimalBodyPoseObservation {}
1880
1881unsafe impl NSSecureCoding for VNAnimalBodyPoseObservation {}
1882
1883#[cfg(feature = "VNRequestRevisionProviding")]
1884unsafe impl VNRequestRevisionProviding for VNAnimalBodyPoseObservation {}
1885
1886impl VNAnimalBodyPoseObservation {
1887 extern_methods!(
1888 #[cfg(feature = "VNTypes")]
1889 #[unsafe(method(availableJointNames))]
1891 #[unsafe(method_family = none)]
1892 pub unsafe fn availableJointNames(
1893 &self,
1894 ) -> Retained<NSArray<VNAnimalBodyPoseObservationJointName>>;
1895
1896 #[cfg(feature = "VNTypes")]
1897 #[unsafe(method(availableJointGroupNames))]
1899 #[unsafe(method_family = none)]
1900 pub unsafe fn availableJointGroupNames(
1901 &self,
1902 ) -> Retained<NSArray<VNAnimalBodyPoseObservationJointsGroupName>>;
1903
1904 #[cfg(all(
1905 feature = "VNDetectedPoint",
1906 feature = "VNGeometry",
1907 feature = "VNTypes"
1908 ))]
1909 #[unsafe(method(recognizedPointForJointName:error:_))]
1918 #[unsafe(method_family = none)]
1919 pub unsafe fn recognizedPointForJointName_error(
1920 &self,
1921 joint_name: &VNAnimalBodyPoseObservationJointName,
1922 ) -> Result<Retained<VNRecognizedPoint>, Retained<NSError>>;
1923
1924 #[cfg(all(
1925 feature = "VNDetectedPoint",
1926 feature = "VNGeometry",
1927 feature = "VNTypes"
1928 ))]
1929 #[unsafe(method(recognizedPointsForJointsGroupName:error:_))]
1941 #[unsafe(method_family = none)]
1942 pub unsafe fn recognizedPointsForJointsGroupName_error(
1943 &self,
1944 joints_group_name: &VNAnimalBodyPoseObservationJointsGroupName,
1945 ) -> Result<
1946 Retained<NSDictionary<VNAnimalBodyPoseObservationJointName, VNRecognizedPoint>>,
1947 Retained<NSError>,
1948 >;
1949 );
1950}
1951
1952impl VNAnimalBodyPoseObservation {
1954 extern_methods!(
1955 #[unsafe(method(new))]
1956 #[unsafe(method_family = new)]
1957 pub unsafe fn new() -> Retained<Self>;
1958
1959 #[unsafe(method(init))]
1960 #[unsafe(method_family = init)]
1961 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1962 );
1963}
1964
1965extern "C" {
1966 #[cfg(feature = "VNTypes")]
1968 pub static VNRecognizedPoint3DGroupKeyAll: &'static VNRecognizedPointGroupKey;
1969}
1970
1971extern_class!(
1972 #[unsafe(super(VNObservation, NSObject))]
1978 #[derive(Debug, PartialEq, Eq, Hash)]
1979 pub struct VNRecognizedPoints3DObservation;
1980);
1981
1982unsafe impl NSCoding for VNRecognizedPoints3DObservation {}
1983
1984unsafe impl NSCopying for VNRecognizedPoints3DObservation {}
1985
1986unsafe impl CopyingHelper for VNRecognizedPoints3DObservation {
1987 type Result = Self;
1988}
1989
1990unsafe impl NSObjectProtocol for VNRecognizedPoints3DObservation {}
1991
1992unsafe impl NSSecureCoding for VNRecognizedPoints3DObservation {}
1993
1994#[cfg(feature = "VNRequestRevisionProviding")]
1995unsafe impl VNRequestRevisionProviding for VNRecognizedPoints3DObservation {}
1996
1997impl VNRecognizedPoints3DObservation {
1998 extern_methods!(
1999 #[unsafe(method(new))]
2000 #[unsafe(method_family = new)]
2001 pub unsafe fn new() -> Retained<Self>;
2002
2003 #[unsafe(method(init))]
2004 #[unsafe(method_family = init)]
2005 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
2006
2007 #[cfg(feature = "VNTypes")]
2008 #[unsafe(method(availableKeys))]
2010 #[unsafe(method_family = none)]
2011 pub unsafe fn availableKeys(&self) -> Retained<NSArray<VNRecognizedPointKey>>;
2012
2013 #[cfg(feature = "VNTypes")]
2014 #[unsafe(method(availableGroupKeys))]
2016 #[unsafe(method_family = none)]
2017 pub unsafe fn availableGroupKeys(&self) -> Retained<NSArray<VNRecognizedPointGroupKey>>;
2018
2019 #[cfg(all(
2020 feature = "VNGeometry",
2021 feature = "VNRecognizedPoint3D",
2022 feature = "VNTypes"
2023 ))]
2024 #[unsafe(method(recognizedPointForKey:error:_))]
2032 #[unsafe(method_family = none)]
2033 pub unsafe fn recognizedPointForKey_error(
2034 &self,
2035 point_key: &VNRecognizedPointKey,
2036 ) -> Result<Retained<VNRecognizedPoint3D>, Retained<NSError>>;
2037
2038 #[cfg(all(
2039 feature = "VNGeometry",
2040 feature = "VNRecognizedPoint3D",
2041 feature = "VNTypes"
2042 ))]
2043 #[unsafe(method(recognizedPointsForGroupKey:error:_))]
2053 #[unsafe(method_family = none)]
2054 pub unsafe fn recognizedPointsForGroupKey_error(
2055 &self,
2056 group_key: &VNRecognizedPointGroupKey,
2057 ) -> Result<
2058 Retained<NSDictionary<VNRecognizedPointKey, VNRecognizedPoint3D>>,
2059 Retained<NSError>,
2060 >;
2061 );
2062}
2063
2064#[repr(transparent)]
2073#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
2074pub struct VNHumanBodyPose3DObservationHeightEstimation(pub NSInteger);
2075impl VNHumanBodyPose3DObservationHeightEstimation {
2076 #[doc(alias = "VNHumanBodyPose3DObservationHeightEstimationReference")]
2077 pub const Reference: Self = Self(0);
2078 #[doc(alias = "VNHumanBodyPose3DObservationHeightEstimationMeasured")]
2079 pub const Measured: Self = Self(1);
2080}
2081
2082unsafe impl Encode for VNHumanBodyPose3DObservationHeightEstimation {
2083 const ENCODING: Encoding = NSInteger::ENCODING;
2084}
2085
2086unsafe impl RefEncode for VNHumanBodyPose3DObservationHeightEstimation {
2087 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
2088}
2089
2090extern_class!(
2091 #[unsafe(super(VNRecognizedPoints3DObservation, VNObservation, NSObject))]
2093 #[derive(Debug, PartialEq, Eq, Hash)]
2094 pub struct VNHumanBodyPose3DObservation;
2095);
2096
2097unsafe impl NSCoding for VNHumanBodyPose3DObservation {}
2098
2099unsafe impl NSCopying for VNHumanBodyPose3DObservation {}
2100
2101unsafe impl CopyingHelper for VNHumanBodyPose3DObservation {
2102 type Result = Self;
2103}
2104
2105unsafe impl NSObjectProtocol for VNHumanBodyPose3DObservation {}
2106
2107unsafe impl NSSecureCoding for VNHumanBodyPose3DObservation {}
2108
2109#[cfg(feature = "VNRequestRevisionProviding")]
2110unsafe impl VNRequestRevisionProviding for VNHumanBodyPose3DObservation {}
2111
2112impl VNHumanBodyPose3DObservation {
2113 extern_methods!(
2114 #[unsafe(method(heightEstimation))]
2117 #[unsafe(method_family = none)]
2118 pub unsafe fn heightEstimation(&self) -> VNHumanBodyPose3DObservationHeightEstimation;
2119
2120 #[cfg(feature = "VNTypes")]
2121 #[unsafe(method(availableJointsGroupNames))]
2123 #[unsafe(method_family = none)]
2124 pub unsafe fn availableJointsGroupNames(
2125 &self,
2126 ) -> Retained<NSArray<VNHumanBodyPose3DObservationJointsGroupName>>;
2127
2128 #[cfg(feature = "VNTypes")]
2129 #[unsafe(method(availableJointNames))]
2131 #[unsafe(method_family = none)]
2132 pub unsafe fn availableJointNames(
2133 &self,
2134 ) -> Retained<NSArray<VNHumanBodyPose3DObservationJointName>>;
2135
2136 #[unsafe(method(bodyHeight))]
2140 #[unsafe(method_family = none)]
2141 pub unsafe fn bodyHeight(&self) -> c_float;
2142
2143 #[cfg(all(
2144 feature = "VNGeometry",
2145 feature = "VNHumanBodyRecognizedPoint3D",
2146 feature = "VNRecognizedPoint3D",
2147 feature = "VNTypes"
2148 ))]
2149 #[unsafe(method(recognizedPointsForJointsGroupName:error:_))]
2159 #[unsafe(method_family = none)]
2160 pub unsafe fn recognizedPointsForJointsGroupName_error(
2161 &self,
2162 joints_group_name: &VNHumanBodyPose3DObservationJointsGroupName,
2163 ) -> Result<
2164 Retained<
2165 NSDictionary<VNHumanBodyPose3DObservationJointName, VNHumanBodyRecognizedPoint3D>,
2166 >,
2167 Retained<NSError>,
2168 >;
2169
2170 #[cfg(all(
2171 feature = "VNGeometry",
2172 feature = "VNHumanBodyRecognizedPoint3D",
2173 feature = "VNRecognizedPoint3D",
2174 feature = "VNTypes"
2175 ))]
2176 #[unsafe(method(recognizedPointForJointName:error:_))]
2187 #[unsafe(method_family = none)]
2188 pub unsafe fn recognizedPointForJointName_error(
2189 &self,
2190 joint_name: &VNHumanBodyPose3DObservationJointName,
2191 ) -> Result<Retained<VNHumanBodyRecognizedPoint3D>, Retained<NSError>>;
2192
2193 #[cfg(all(feature = "VNGeometry", feature = "VNTypes"))]
2194 #[unsafe(method(pointInImageForJointName:error:_))]
2200 #[unsafe(method_family = none)]
2201 pub unsafe fn pointInImageForJointName_error(
2202 &self,
2203 joint_name: &VNHumanBodyPose3DObservationJointName,
2204 ) -> Result<Retained<VNPoint>, Retained<NSError>>;
2205
2206 #[cfg(feature = "VNTypes")]
2207 #[unsafe(method(parentJointNameForJointName:))]
2213 #[unsafe(method_family = none)]
2214 pub unsafe fn parentJointNameForJointName(
2215 &self,
2216 joint_name: &VNHumanBodyPose3DObservationJointName,
2217 ) -> Option<Retained<VNHumanBodyPose3DObservationJointName>>;
2218 );
2219}
2220
2221impl VNHumanBodyPose3DObservation {
2223 extern_methods!(
2224 #[unsafe(method(new))]
2225 #[unsafe(method_family = new)]
2226 pub unsafe fn new() -> Retained<Self>;
2227
2228 #[unsafe(method(init))]
2229 #[unsafe(method_family = init)]
2230 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
2231 );
2232}
2233
2234extern_class!(
2235 #[unsafe(super(VNObservation, NSObject))]
2239 #[derive(Debug, PartialEq, Eq, Hash)]
2240 pub struct VNImageAestheticsScoresObservation;
2241);
2242
2243unsafe impl NSCoding for VNImageAestheticsScoresObservation {}
2244
2245unsafe impl NSCopying for VNImageAestheticsScoresObservation {}
2246
2247unsafe impl CopyingHelper for VNImageAestheticsScoresObservation {
2248 type Result = Self;
2249}
2250
2251unsafe impl NSObjectProtocol for VNImageAestheticsScoresObservation {}
2252
2253unsafe impl NSSecureCoding for VNImageAestheticsScoresObservation {}
2254
2255#[cfg(feature = "VNRequestRevisionProviding")]
2256unsafe impl VNRequestRevisionProviding for VNImageAestheticsScoresObservation {}
2257
2258impl VNImageAestheticsScoresObservation {
2259 extern_methods!(
2260 #[unsafe(method(init))]
2261 #[unsafe(method_family = init)]
2262 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
2263
2264 #[unsafe(method(isUtility))]
2266 #[unsafe(method_family = none)]
2267 pub unsafe fn isUtility(&self) -> bool;
2268
2269 #[unsafe(method(overallScore))]
2271 #[unsafe(method_family = none)]
2272 pub unsafe fn overallScore(&self) -> c_float;
2273 );
2274}
2275
2276impl VNImageAestheticsScoresObservation {
2278 extern_methods!(
2279 #[unsafe(method(new))]
2280 #[unsafe(method_family = new)]
2281 pub unsafe fn new() -> Retained<Self>;
2282 );
2283}