objc2_vision/generated/
VNObservation.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use 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    /// VNObservation describes the results of performing a VNRequest. The result has a confidence score. The different types of requests will create different subclasses of VNObservation to return their results in properties of those subclasses.
24    ///
25    /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vnobservation?language=objc)
26    #[unsafe(super(NSObject))]
27    #[derive(Debug, PartialEq, Eq, Hash)]
28    pub struct VNObservation;
29);
30
31extern_conformance!(
32    unsafe impl NSCoding for VNObservation {}
33);
34
35extern_conformance!(
36    unsafe impl NSCopying for VNObservation {}
37);
38
39unsafe impl CopyingHelper for VNObservation {
40    type Result = Self;
41}
42
43extern_conformance!(
44    unsafe impl NSObjectProtocol for VNObservation {}
45);
46
47extern_conformance!(
48    unsafe impl NSSecureCoding for VNObservation {}
49);
50
51#[cfg(feature = "VNRequestRevisionProviding")]
52extern_conformance!(
53    unsafe impl VNRequestRevisionProviding for VNObservation {}
54);
55
56impl VNObservation {
57    extern_methods!(
58        /// The unique identifier assigned to an observation.
59        #[unsafe(method(uuid))]
60        #[unsafe(method_family = none)]
61        pub unsafe fn uuid(&self) -> Retained<NSUUID>;
62
63        #[cfg(feature = "VNTypes")]
64        /// The level of confidence normalized to [0, 1] where 1 is most confident. The only exception is results coming from VNCoreMLRequest, where confidence values are forwarded as is from relevant CoreML models
65        ///
66        /// Confidence can always be returned as 1.0 if confidence is not supported or has no meaning
67        #[unsafe(method(confidence))]
68        #[unsafe(method_family = none)]
69        pub unsafe fn confidence(&self) -> VNConfidence;
70
71        #[cfg(feature = "objc2-core-media")]
72        /// The duration of the observation reporting when first detected and how long it is valid.
73        ///
74        /// The duration of the observation when used with a sequence of buffers. If a request does not support a timeRange or the timeRange is not known, the start time and duration will be set to 0.
75        #[unsafe(method(timeRange))]
76        #[unsafe(method_family = none)]
77        pub unsafe fn timeRange(&self) -> CMTimeRange;
78    );
79}
80
81/// Methods declared on superclass `NSObject`.
82impl VNObservation {
83    extern_methods!(
84        #[unsafe(method(init))]
85        #[unsafe(method_family = init)]
86        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
87
88        #[unsafe(method(new))]
89        #[unsafe(method_family = new)]
90        pub unsafe fn new() -> Retained<Self>;
91    );
92}
93
94extern_class!(
95    /// VNDetectedObjectObservation is VNObservation in an image that has a location and/or dimension. Further attributes depend on the specific detected object.
96    ///
97    /// All result objects (faces, scene objects, shapes etc) must extend from this class.
98    ///
99    /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vndetectedobjectobservation?language=objc)
100    #[unsafe(super(VNObservation, NSObject))]
101    #[derive(Debug, PartialEq, Eq, Hash)]
102    pub struct VNDetectedObjectObservation;
103);
104
105extern_conformance!(
106    unsafe impl NSCoding for VNDetectedObjectObservation {}
107);
108
109extern_conformance!(
110    unsafe impl NSCopying for VNDetectedObjectObservation {}
111);
112
113unsafe impl CopyingHelper for VNDetectedObjectObservation {
114    type Result = Self;
115}
116
117extern_conformance!(
118    unsafe impl NSObjectProtocol for VNDetectedObjectObservation {}
119);
120
121extern_conformance!(
122    unsafe impl NSSecureCoding for VNDetectedObjectObservation {}
123);
124
125#[cfg(feature = "VNRequestRevisionProviding")]
126extern_conformance!(
127    unsafe impl VNRequestRevisionProviding for VNDetectedObjectObservation {}
128);
129
130impl VNDetectedObjectObservation {
131    extern_methods!(
132        #[cfg(feature = "objc2-core-foundation")]
133        /// create a new VNDetectedObjectObservation with a normalized bounding box and a confidence of 1.0.
134        #[unsafe(method(observationWithBoundingBox:))]
135        #[unsafe(method_family = none)]
136        pub unsafe fn observationWithBoundingBox(bounding_box: CGRect) -> Retained<Self>;
137
138        #[cfg(feature = "objc2-core-foundation")]
139        #[unsafe(method(observationWithRequestRevision:boundingBox:))]
140        #[unsafe(method_family = none)]
141        pub unsafe fn observationWithRequestRevision_boundingBox(
142            request_revision: NSUInteger,
143            bounding_box: CGRect,
144        ) -> Retained<Self>;
145
146        #[cfg(feature = "objc2-core-foundation")]
147        /// The bounding box of the detected object. The coordinates are normalized to the dimensions of the processed image, with the origin at the image's lower-left corner.
148        #[unsafe(method(boundingBox))]
149        #[unsafe(method_family = none)]
150        pub unsafe fn boundingBox(&self) -> CGRect;
151
152        /// The resulting CVPixelBuffer from requests that generate a segmentation mask for the entire image.
153        #[unsafe(method(globalSegmentationMask))]
154        #[unsafe(method_family = none)]
155        pub unsafe fn globalSegmentationMask(&self) -> Option<Retained<VNPixelBufferObservation>>;
156    );
157}
158
159/// Methods declared on superclass `NSObject`.
160impl VNDetectedObjectObservation {
161    extern_methods!(
162        #[unsafe(method(init))]
163        #[unsafe(method_family = init)]
164        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
165
166        #[unsafe(method(new))]
167        #[unsafe(method_family = new)]
168        pub unsafe fn new() -> Retained<Self>;
169    );
170}
171
172extern_class!(
173    /// VNFaceObservation is the result of a face detection request or derivatives like a face landmark request.
174    ///
175    /// The properties filled in this obervation depend on the request being performed. For instance, if just a VNDetectFaceRectanglesRequest was performed the landmarks will not be populated. VNFaceObservation are also used as inputs to other request as defined by the VNFaceObservationAccepting protocol. An example would be the VNDetectFaceLandmarksRequest. This can be helpful for instance if the face rectangles in an image are not derived from a VNDetectFaceRectanglesRequest but instead come from other sources like EXIF or other face detectors. In that case the client of the API creates a VNFaceObservation with the boundingBox (in normalized coordinates) that were based on those detected faces.
176    ///
177    /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vnfaceobservation?language=objc)
178    #[unsafe(super(VNDetectedObjectObservation, VNObservation, NSObject))]
179    #[derive(Debug, PartialEq, Eq, Hash)]
180    pub struct VNFaceObservation;
181);
182
183extern_conformance!(
184    unsafe impl NSCoding for VNFaceObservation {}
185);
186
187extern_conformance!(
188    unsafe impl NSCopying for VNFaceObservation {}
189);
190
191unsafe impl CopyingHelper for VNFaceObservation {
192    type Result = Self;
193}
194
195extern_conformance!(
196    unsafe impl NSObjectProtocol for VNFaceObservation {}
197);
198
199extern_conformance!(
200    unsafe impl NSSecureCoding for VNFaceObservation {}
201);
202
203#[cfg(feature = "VNRequestRevisionProviding")]
204extern_conformance!(
205    unsafe impl VNRequestRevisionProviding for VNFaceObservation {}
206);
207
208impl VNFaceObservation {
209    extern_methods!(
210        #[cfg(feature = "objc2-core-foundation")]
211        /// Create a new VNFaceObservation with a normalized bounding box, roll and yaw.
212        ///
213        /// Parameter `requestRevision`: The revision of the VNDetectFaceRectanglesRequest that provided the bounding box.  If this observation is being created with data that did not originate from a Vision request, this parameter should be VNRequestRevisionUnspecified.
214        ///
215        /// Parameter `roll`: The roll angle of the face, reported in radians.  A positive angle corresponds to counterclockwise direction, range [-Pi, Pi). If no roll information is available, this parameter should be nil.
216        ///
217        /// Parameter `yaw`: The yaw angle of the face, reported in radians.  A positive angle corresponds to counterclockwise direction, range [-Pi/2, Pi/2). If no yaw information is available, this parameter should be nil.
218        ///
219        /// Parameter `pitch`: The pitch angle of the face, reported in radians.  A positive angle corresponds to nodding head down direction, range [-Pi/2, Pi/2]. If no pitch information is available, this parameter should be nil.
220        #[deprecated]
221        #[unsafe(method(faceObservationWithRequestRevision:boundingBox:roll:yaw:))]
222        #[unsafe(method_family = none)]
223        pub unsafe fn faceObservationWithRequestRevision_boundingBox_roll_yaw(
224            request_revision: NSUInteger,
225            bounding_box: CGRect,
226            roll: Option<&NSNumber>,
227            yaw: Option<&NSNumber>,
228        ) -> Retained<Self>;
229
230        #[cfg(feature = "objc2-core-foundation")]
231        #[unsafe(method(faceObservationWithRequestRevision:boundingBox:roll:yaw:pitch:))]
232        #[unsafe(method_family = none)]
233        pub unsafe fn faceObservationWithRequestRevision_boundingBox_roll_yaw_pitch(
234            request_revision: NSUInteger,
235            bounding_box: CGRect,
236            roll: Option<&NSNumber>,
237            yaw: Option<&NSNumber>,
238            pitch: Option<&NSNumber>,
239        ) -> Retained<Self>;
240
241        #[cfg(feature = "VNFaceLandmarks")]
242        /// The face landmarks populated by the VNDetectFaceLandmarksRequest. This is set to nil if only a VNDetectFaceRectanglesRequest was performed.
243        #[unsafe(method(landmarks))]
244        #[unsafe(method_family = none)]
245        pub unsafe fn landmarks(&self) -> Option<Retained<VNFaceLandmarks2D>>;
246
247        /// The capture quality of the face as a normalized value between 0.0 and 1.0 that can be used to compare the quality of the face in terms of it capture attributes (lighting, blur, position). This score can be used to compare the capture quality of a face against other captures of the same face in a given set.
248        #[unsafe(method(faceCaptureQuality))]
249        #[unsafe(method_family = none)]
250        pub unsafe fn faceCaptureQuality(&self) -> Option<Retained<NSNumber>>;
251
252        /// Face roll angle populated by VNDetectFaceRectanglesRequest. The roll is reported in radians, positive angle corresponds to counterclockwise direction, range [-Pi, Pi). nil value indicates that the roll angle hasn't been computed
253        #[unsafe(method(roll))]
254        #[unsafe(method_family = none)]
255        pub unsafe fn roll(&self) -> Option<Retained<NSNumber>>;
256
257        /// Face yaw angle populated by VNDetectFaceRectanglesRequest. The yaw is reported in radians, positive angle corresponds to counterclockwise direction, range [-Pi/2, Pi/2]. nil value indicates that the yaw angle hasn't been computed
258        #[unsafe(method(yaw))]
259        #[unsafe(method_family = none)]
260        pub unsafe fn yaw(&self) -> Option<Retained<NSNumber>>;
261
262        /// Face pitch angle populated by VNDetectFaceRectanglesRequest. The pitch is reported in radians, positive angle corresponds to nodding head down direction, range [-Pi/2, Pi/2]. nil value indicates that the pitch angle hasn't been computed
263        #[unsafe(method(pitch))]
264        #[unsafe(method_family = none)]
265        pub unsafe fn pitch(&self) -> Option<Retained<NSNumber>>;
266    );
267}
268
269/// Methods declared on superclass `VNDetectedObjectObservation`.
270impl VNFaceObservation {
271    extern_methods!(
272        #[cfg(feature = "objc2-core-foundation")]
273        /// create a new VNDetectedObjectObservation with a normalized bounding box and a confidence of 1.0.
274        #[unsafe(method(observationWithBoundingBox:))]
275        #[unsafe(method_family = none)]
276        pub unsafe fn observationWithBoundingBox(bounding_box: CGRect) -> Retained<Self>;
277
278        #[cfg(feature = "objc2-core-foundation")]
279        #[unsafe(method(observationWithRequestRevision:boundingBox:))]
280        #[unsafe(method_family = none)]
281        pub unsafe fn observationWithRequestRevision_boundingBox(
282            request_revision: NSUInteger,
283            bounding_box: CGRect,
284        ) -> Retained<Self>;
285    );
286}
287
288/// Methods declared on superclass `NSObject`.
289impl VNFaceObservation {
290    extern_methods!(
291        #[unsafe(method(init))]
292        #[unsafe(method_family = init)]
293        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
294
295        #[unsafe(method(new))]
296        #[unsafe(method_family = new)]
297        pub unsafe fn new() -> Retained<Self>;
298    );
299}
300
301extern_class!(
302    /// VNClassificationObservation returns the classifcation in form of a string.
303    ///
304    /// VNClassificationObservation is the observation returned by VNCoreMLRequests that using a model that is a classifier. A classifier produces an arrary (this can be a single entry) of classifications which are labels (identifiers) and confidence scores.
305    ///
306    /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vnclassificationobservation?language=objc)
307    #[unsafe(super(VNObservation, NSObject))]
308    #[derive(Debug, PartialEq, Eq, Hash)]
309    pub struct VNClassificationObservation;
310);
311
312extern_conformance!(
313    unsafe impl NSCoding for VNClassificationObservation {}
314);
315
316extern_conformance!(
317    unsafe impl NSCopying for VNClassificationObservation {}
318);
319
320unsafe impl CopyingHelper for VNClassificationObservation {
321    type Result = Self;
322}
323
324extern_conformance!(
325    unsafe impl NSObjectProtocol for VNClassificationObservation {}
326);
327
328extern_conformance!(
329    unsafe impl NSSecureCoding for VNClassificationObservation {}
330);
331
332#[cfg(feature = "VNRequestRevisionProviding")]
333extern_conformance!(
334    unsafe impl VNRequestRevisionProviding for VNClassificationObservation {}
335);
336
337impl VNClassificationObservation {
338    extern_methods!(
339        /// The is the label or identifier of a classification request. An example classification could be a string like 'cat' or 'hotdog'. The string is defined in the model that was used for the classification. Usually these are technical labels that are not localized and not meant to be used directly to be presented to an end user in the UI.
340        #[unsafe(method(identifier))]
341        #[unsafe(method_family = none)]
342        pub unsafe fn identifier(&self) -> Retained<NSString>;
343    );
344}
345
346/// Methods declared on superclass `NSObject`.
347impl VNClassificationObservation {
348    extern_methods!(
349        #[unsafe(method(init))]
350        #[unsafe(method_family = init)]
351        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
352
353        #[unsafe(method(new))]
354        #[unsafe(method_family = new)]
355        pub unsafe fn new() -> Retained<Self>;
356    );
357}
358
359/// PrecisionRecallAdditions.
360///
361/// VNClassificationObservation mave have precision/recall curves which can be used to decide on an "optimal" operation point.
362/// Precision is a value in the range of [0..1] which represents the fraction of relevant instances among the retrieved instances.
363/// Recall is a value in the range of [0..1] which represents the fraction of relevant instances that have been retrieved over the total amount of relevant instances.
364impl VNClassificationObservation {
365    extern_methods!(
366        /// Determine whether or not precision/recall curves are available with the observation.
367        ///
368        /// If this property is YES, then all other precision/recall related methods in this addition can be called.
369        #[unsafe(method(hasPrecisionRecallCurve))]
370        #[unsafe(method_family = none)]
371        pub unsafe fn hasPrecisionRecallCurve(&self) -> bool;
372
373        /// Determine whether or not the observation's operation point for a specific precision has a minimum recall value.
374        ///
375        ///
376        /// Parameter `minimumRecall`: The minimum recall desired for an operation point.
377        ///
378        ///
379        /// Parameter `precision`: The precision value used to select the operation point.
380        ///
381        ///
382        /// Returns: YES if the recall value for the operation point specified by a precision value has the minimum value; otherwise, NO.
383        #[unsafe(method(hasMinimumRecall:forPrecision:))]
384        #[unsafe(method_family = none)]
385        pub unsafe fn hasMinimumRecall_forPrecision(
386            &self,
387            minimum_recall: c_float,
388            precision: c_float,
389        ) -> bool;
390
391        /// Determine whether or not the observation's operation point for a specific recall has a minimum precision value.
392        ///
393        ///
394        /// Parameter `minimumPrecision`: The minimum precision desired for an operation point.
395        ///
396        ///
397        /// Parameter `recall`: The recall value used to select the operation point.
398        ///
399        ///
400        /// Returns: YES if the precision value for the operation point specified by a recall value has the minimum value; otherwise, NO.
401        #[unsafe(method(hasMinimumPrecision:forRecall:))]
402        #[unsafe(method_family = none)]
403        pub unsafe fn hasMinimumPrecision_forRecall(
404            &self,
405            minimum_precision: c_float,
406            recall: c_float,
407        ) -> bool;
408    );
409}
410
411extern_class!(
412    /// VNRecognizedObjectObservation is a VNDetectedObjectObservation with an array of classifications that classify the recognized object. The confidence of the classifications sum up to 1.0. It is common practice to multiply the classification confidence with the confidence of this observation.
413    ///
414    /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vnrecognizedobjectobservation?language=objc)
415    #[unsafe(super(VNDetectedObjectObservation, VNObservation, NSObject))]
416    #[derive(Debug, PartialEq, Eq, Hash)]
417    pub struct VNRecognizedObjectObservation;
418);
419
420extern_conformance!(
421    unsafe impl NSCoding for VNRecognizedObjectObservation {}
422);
423
424extern_conformance!(
425    unsafe impl NSCopying for VNRecognizedObjectObservation {}
426);
427
428unsafe impl CopyingHelper for VNRecognizedObjectObservation {
429    type Result = Self;
430}
431
432extern_conformance!(
433    unsafe impl NSObjectProtocol for VNRecognizedObjectObservation {}
434);
435
436extern_conformance!(
437    unsafe impl NSSecureCoding for VNRecognizedObjectObservation {}
438);
439
440#[cfg(feature = "VNRequestRevisionProviding")]
441extern_conformance!(
442    unsafe impl VNRequestRevisionProviding for VNRecognizedObjectObservation {}
443);
444
445impl VNRecognizedObjectObservation {
446    extern_methods!(
447        #[unsafe(method(labels))]
448        #[unsafe(method_family = none)]
449        pub unsafe fn labels(&self) -> Retained<NSArray<VNClassificationObservation>>;
450    );
451}
452
453/// Methods declared on superclass `VNDetectedObjectObservation`.
454impl VNRecognizedObjectObservation {
455    extern_methods!(
456        #[cfg(feature = "objc2-core-foundation")]
457        /// create a new VNDetectedObjectObservation with a normalized bounding box and a confidence of 1.0.
458        #[unsafe(method(observationWithBoundingBox:))]
459        #[unsafe(method_family = none)]
460        pub unsafe fn observationWithBoundingBox(bounding_box: CGRect) -> Retained<Self>;
461
462        #[cfg(feature = "objc2-core-foundation")]
463        #[unsafe(method(observationWithRequestRevision:boundingBox:))]
464        #[unsafe(method_family = none)]
465        pub unsafe fn observationWithRequestRevision_boundingBox(
466            request_revision: NSUInteger,
467            bounding_box: CGRect,
468        ) -> Retained<Self>;
469    );
470}
471
472/// Methods declared on superclass `NSObject`.
473impl VNRecognizedObjectObservation {
474    extern_methods!(
475        #[unsafe(method(init))]
476        #[unsafe(method_family = init)]
477        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
478
479        #[unsafe(method(new))]
480        #[unsafe(method_family = new)]
481        pub unsafe fn new() -> Retained<Self>;
482    );
483}
484
485extern_class!(
486    /// VNCoreMLFeatureValueObservation returns the prediction of a model as an MLFeatureValue.
487    ///
488    /// This is the returned observations for models that are not classifiers and that do not return an image as a prediction. The confidence for these observations is always 1.0.
489    ///
490    /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vncoremlfeaturevalueobservation?language=objc)
491    #[unsafe(super(VNObservation, NSObject))]
492    #[derive(Debug, PartialEq, Eq, Hash)]
493    pub struct VNCoreMLFeatureValueObservation;
494);
495
496extern_conformance!(
497    unsafe impl NSCoding for VNCoreMLFeatureValueObservation {}
498);
499
500extern_conformance!(
501    unsafe impl NSCopying for VNCoreMLFeatureValueObservation {}
502);
503
504unsafe impl CopyingHelper for VNCoreMLFeatureValueObservation {
505    type Result = Self;
506}
507
508extern_conformance!(
509    unsafe impl NSObjectProtocol for VNCoreMLFeatureValueObservation {}
510);
511
512extern_conformance!(
513    unsafe impl NSSecureCoding for VNCoreMLFeatureValueObservation {}
514);
515
516#[cfg(feature = "VNRequestRevisionProviding")]
517extern_conformance!(
518    unsafe impl VNRequestRevisionProviding for VNCoreMLFeatureValueObservation {}
519);
520
521impl VNCoreMLFeatureValueObservation {
522    extern_methods!(
523        #[cfg(feature = "objc2-core-ml")]
524        /// The result VNCoreMLRequest where the model produces an MLFeatureValue that is neither a classification or image. Refer to the Core ML documentation and the model itself for the handling of the content of the featureValue.
525        #[unsafe(method(featureValue))]
526        #[unsafe(method_family = none)]
527        pub unsafe fn featureValue(&self) -> Retained<MLFeatureValue>;
528
529        /// The name used in the model description of the CoreML model that produced this observation allowing to correlate the observation back to the output of the model.
530        #[unsafe(method(featureName))]
531        #[unsafe(method_family = none)]
532        pub unsafe fn featureName(&self) -> Retained<NSString>;
533    );
534}
535
536/// Methods declared on superclass `NSObject`.
537impl VNCoreMLFeatureValueObservation {
538    extern_methods!(
539        #[unsafe(method(init))]
540        #[unsafe(method_family = init)]
541        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
542
543        #[unsafe(method(new))]
544        #[unsafe(method_family = new)]
545        pub unsafe fn new() -> Retained<Self>;
546    );
547}
548
549extern_class!(
550    /// VNPixelBufferObservation returns the prediction of a model as a CVPixelBufferRef.
551    ///
552    /// This is the returned observations for models that are not classifiers and return an image as a prediction. The confidence for these observations is always 1.0.
553    ///
554    /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vnpixelbufferobservation?language=objc)
555    #[unsafe(super(VNObservation, NSObject))]
556    #[derive(Debug, PartialEq, Eq, Hash)]
557    pub struct VNPixelBufferObservation;
558);
559
560extern_conformance!(
561    unsafe impl NSCoding for VNPixelBufferObservation {}
562);
563
564extern_conformance!(
565    unsafe impl NSCopying for VNPixelBufferObservation {}
566);
567
568unsafe impl CopyingHelper for VNPixelBufferObservation {
569    type Result = Self;
570}
571
572extern_conformance!(
573    unsafe impl NSObjectProtocol for VNPixelBufferObservation {}
574);
575
576extern_conformance!(
577    unsafe impl NSSecureCoding for VNPixelBufferObservation {}
578);
579
580#[cfg(feature = "VNRequestRevisionProviding")]
581extern_conformance!(
582    unsafe impl VNRequestRevisionProviding for VNPixelBufferObservation {}
583);
584
585impl VNPixelBufferObservation {
586    extern_methods!(
587        #[cfg(feature = "objc2-core-video")]
588        /// The resulting image from a request like VNCoreMLRequest where the model produces an image as an output.
589        #[unsafe(method(pixelBuffer))]
590        #[unsafe(method_family = none)]
591        pub unsafe fn pixelBuffer(&self) -> Retained<CVPixelBuffer>;
592
593        /// The name used in the model description of the CoreML model that produced this observation allowing to correlate the observation back to the output of the model. This can be nil if the observation is not the result of a VNCoreMLRequest operation.
594        #[unsafe(method(featureName))]
595        #[unsafe(method_family = none)]
596        pub unsafe fn featureName(&self) -> Option<Retained<NSString>>;
597    );
598}
599
600/// Methods declared on superclass `NSObject`.
601impl VNPixelBufferObservation {
602    extern_methods!(
603        #[unsafe(method(init))]
604        #[unsafe(method_family = init)]
605        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
606
607        #[unsafe(method(new))]
608        #[unsafe(method_family = new)]
609        pub unsafe fn new() -> Retained<Self>;
610    );
611}
612
613extern_class!(
614    /// VNRectangleObservation is the result of a rectangle detector
615    ///
616    /// The VNRectangleObservation has a bounding box that encompasses the rectangle found in the image. The rectangle itself is defined by the four corner point properties. The rectangle can be rotated in or even out of plane. A common use case is to use the CIPerspectiveTransform filter to correct a detected rectangle to its 'flat upright' representation. All coordinates are normalized and the coordinates can be outside the image.
617    ///
618    /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vnrectangleobservation?language=objc)
619    #[unsafe(super(VNDetectedObjectObservation, VNObservation, NSObject))]
620    #[derive(Debug, PartialEq, Eq, Hash)]
621    pub struct VNRectangleObservation;
622);
623
624extern_conformance!(
625    unsafe impl NSCoding for VNRectangleObservation {}
626);
627
628extern_conformance!(
629    unsafe impl NSCopying for VNRectangleObservation {}
630);
631
632unsafe impl CopyingHelper for VNRectangleObservation {
633    type Result = Self;
634}
635
636extern_conformance!(
637    unsafe impl NSObjectProtocol for VNRectangleObservation {}
638);
639
640extern_conformance!(
641    unsafe impl NSSecureCoding for VNRectangleObservation {}
642);
643
644#[cfg(feature = "VNRequestRevisionProviding")]
645extern_conformance!(
646    unsafe impl VNRequestRevisionProviding for VNRectangleObservation {}
647);
648
649impl VNRectangleObservation {
650    extern_methods!(
651        #[cfg(feature = "objc2-core-foundation")]
652        /// Create a synthesized `VNRectangleObservation`.
653        ///
654        /// Note: The clockwise parameter ordered `+[VNRectangleObservation rectangleObservationWithRequestRevision:topLeft:topRight:bottomRight:bottomLeft:]` is the preferred initializer.
655        ///
656        ///
657        /// Parameter `requestRevision`: The revision of the VNDetectRectanglesRequest that the observation is to be treated as originating from.
658        ///
659        /// Parameter `topLeft`: The top-left corner of the rectangle in normalized coordinate space.
660        ///
661        /// Parameter `bottomLeft`: The bottom-left corner of the rectangle in normalized coordinate space.
662        ///
663        /// Parameter `bottomRight`: The bottom-right corner of the rectangle in normalized coordinate space.
664        ///
665        /// Parameter `topRight`: The top-right corner of the rectangle in normalized coordinate space.
666        #[deprecated]
667        #[unsafe(method(rectangleObservationWithRequestRevision:topLeft:bottomLeft:bottomRight:topRight:))]
668        #[unsafe(method_family = none)]
669        pub unsafe fn rectangleObservationWithRequestRevision_topLeft_bottomLeft_bottomRight_topRight(
670            request_revision: NSUInteger,
671            top_left: CGPoint,
672            bottom_left: CGPoint,
673            bottom_right: CGPoint,
674            top_right: CGPoint,
675        ) -> Retained<Self>;
676
677        #[cfg(feature = "objc2-core-foundation")]
678        /// Create a synthesized `VNRectangleObservation`.
679        ///
680        ///
681        /// Parameter `requestRevision`: The revision of the VNDetectRectanglesRequest that the observation is to be treated as originating from.
682        ///
683        /// Parameter `topLeft`: The top-left corner of the rectangle in normalized coordinate space.
684        ///
685        /// Parameter `topRight`: The top-right corner of the rectangle in normalized coordinate space.
686        ///
687        /// Parameter `bottomRight`: The bottom-right corner of the rectangle in normalized coordinate space.
688        ///
689        /// Parameter `bottomLeft`: The bottom-left corner of the rectangle in normalized coordinate space.
690        #[unsafe(method(rectangleObservationWithRequestRevision:topLeft:topRight:bottomRight:bottomLeft:))]
691        #[unsafe(method_family = none)]
692        pub unsafe fn rectangleObservationWithRequestRevision_topLeft_topRight_bottomRight_bottomLeft(
693            request_revision: NSUInteger,
694            top_left: CGPoint,
695            top_right: CGPoint,
696            bottom_right: CGPoint,
697            bottom_left: CGPoint,
698        ) -> Retained<Self>;
699
700        #[cfg(feature = "objc2-core-foundation")]
701        #[unsafe(method(topLeft))]
702        #[unsafe(method_family = none)]
703        pub unsafe fn topLeft(&self) -> CGPoint;
704
705        #[cfg(feature = "objc2-core-foundation")]
706        #[unsafe(method(topRight))]
707        #[unsafe(method_family = none)]
708        pub unsafe fn topRight(&self) -> CGPoint;
709
710        #[cfg(feature = "objc2-core-foundation")]
711        #[unsafe(method(bottomLeft))]
712        #[unsafe(method_family = none)]
713        pub unsafe fn bottomLeft(&self) -> CGPoint;
714
715        #[cfg(feature = "objc2-core-foundation")]
716        #[unsafe(method(bottomRight))]
717        #[unsafe(method_family = none)]
718        pub unsafe fn bottomRight(&self) -> CGPoint;
719    );
720}
721
722/// Methods declared on superclass `VNDetectedObjectObservation`.
723impl VNRectangleObservation {
724    extern_methods!(
725        #[cfg(feature = "objc2-core-foundation")]
726        /// create a new VNDetectedObjectObservation with a normalized bounding box and a confidence of 1.0.
727        #[unsafe(method(observationWithBoundingBox:))]
728        #[unsafe(method_family = none)]
729        pub unsafe fn observationWithBoundingBox(bounding_box: CGRect) -> Retained<Self>;
730
731        #[cfg(feature = "objc2-core-foundation")]
732        #[unsafe(method(observationWithRequestRevision:boundingBox:))]
733        #[unsafe(method_family = none)]
734        pub unsafe fn observationWithRequestRevision_boundingBox(
735            request_revision: NSUInteger,
736            bounding_box: CGRect,
737        ) -> Retained<Self>;
738    );
739}
740
741/// Methods declared on superclass `NSObject`.
742impl VNRectangleObservation {
743    extern_methods!(
744        #[unsafe(method(init))]
745        #[unsafe(method_family = init)]
746        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
747
748        #[unsafe(method(new))]
749        #[unsafe(method_family = new)]
750        pub unsafe fn new() -> Retained<Self>;
751    );
752}
753
754extern_class!(
755    /// The VNTrajectoryObservation describes a detected trajectory with the points on the trajectory and the equation describing the trajectory. The observation also reprorts the duration describing when the trajectory was first detected (which will be in the past).
756    ///
757    /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vntrajectoryobservation?language=objc)
758    #[unsafe(super(VNObservation, NSObject))]
759    #[derive(Debug, PartialEq, Eq, Hash)]
760    pub struct VNTrajectoryObservation;
761);
762
763extern_conformance!(
764    unsafe impl NSCoding for VNTrajectoryObservation {}
765);
766
767extern_conformance!(
768    unsafe impl NSCopying for VNTrajectoryObservation {}
769);
770
771unsafe impl CopyingHelper for VNTrajectoryObservation {
772    type Result = Self;
773}
774
775extern_conformance!(
776    unsafe impl NSObjectProtocol for VNTrajectoryObservation {}
777);
778
779extern_conformance!(
780    unsafe impl NSSecureCoding for VNTrajectoryObservation {}
781);
782
783#[cfg(feature = "VNRequestRevisionProviding")]
784extern_conformance!(
785    unsafe impl VNRequestRevisionProviding for VNTrajectoryObservation {}
786);
787
788impl VNTrajectoryObservation {
789    extern_methods!(
790        #[cfg(feature = "VNGeometry")]
791        /// The centroids of the contour being detected along the trajectory.
792        ///
793        /// These are the unprocessed centroid points of the detected contour that is tracked on the trajectory. The points may be slightly off the ideal trajectory as these are the measured points that fall within the allowed tolerance. The maximum number or past points is limited by the maximum trajectory length set in the request.
794        #[unsafe(method(detectedPoints))]
795        #[unsafe(method_family = none)]
796        pub unsafe fn detectedPoints(&self) -> Retained<NSArray<VNPoint>>;
797
798        #[cfg(feature = "VNGeometry")]
799        /// The centroids of  the calculated trajectory from the detected points.
800        ///
801        /// These are the calculated centroid points along the ideal trajectory described by the parabolic equation. The equation and the projected points of the detected trajectory get refined over time. The maximum number of cached points is limited by the maximum points needed to describe the trajectory together with the parabolic equation.
802        #[unsafe(method(projectedPoints))]
803        #[unsafe(method_family = none)]
804        pub unsafe fn projectedPoints(&self) -> Retained<NSArray<VNPoint>>;
805
806        #[cfg(feature = "objc2-core-foundation")]
807        /// The moving average radius of the object being tracked.
808        ///
809        /// This is the radius of the object at each detected point (used to determine the trajectory) averaged.
810        #[unsafe(method(movingAverageRadius))]
811        #[unsafe(method_family = none)]
812        pub unsafe fn movingAverageRadius(&self) -> CGFloat;
813    );
814}
815
816/// Methods declared on superclass `NSObject`.
817impl VNTrajectoryObservation {
818    extern_methods!(
819        #[unsafe(method(init))]
820        #[unsafe(method_family = init)]
821        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
822
823        #[unsafe(method(new))]
824        #[unsafe(method_family = new)]
825        pub unsafe fn new() -> Retained<Self>;
826    );
827}
828
829extern_class!(
830    /// VNTextObservation Describes a text area detected by the VNRequestNameDetectTextRectangles request.
831    ///
832    /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vntextobservation?language=objc)
833    #[unsafe(super(
834        VNRectangleObservation,
835        VNDetectedObjectObservation,
836        VNObservation,
837        NSObject
838    ))]
839    #[derive(Debug, PartialEq, Eq, Hash)]
840    pub struct VNTextObservation;
841);
842
843extern_conformance!(
844    unsafe impl NSCoding for VNTextObservation {}
845);
846
847extern_conformance!(
848    unsafe impl NSCopying for VNTextObservation {}
849);
850
851unsafe impl CopyingHelper for VNTextObservation {
852    type Result = Self;
853}
854
855extern_conformance!(
856    unsafe impl NSObjectProtocol for VNTextObservation {}
857);
858
859extern_conformance!(
860    unsafe impl NSSecureCoding for VNTextObservation {}
861);
862
863#[cfg(feature = "VNRequestRevisionProviding")]
864extern_conformance!(
865    unsafe impl VNRequestRevisionProviding for VNTextObservation {}
866);
867
868impl VNTextObservation {
869    extern_methods!(
870        /// Array of individual character bounding boxes found within the observation's boundingBox.
871        ///
872        /// If the associated request indicated that it is interested in character boxes by setting the VNDetectTextRectanglesRequest reportCharacterBoxes property to
873        /// `true`, this property will be non-nil (but may still be empty, depending on the detection results).
874        #[unsafe(method(characterBoxes))]
875        #[unsafe(method_family = none)]
876        pub unsafe fn characterBoxes(&self) -> Option<Retained<NSArray<VNRectangleObservation>>>;
877    );
878}
879
880/// Methods declared on superclass `VNRectangleObservation`.
881impl VNTextObservation {
882    extern_methods!(
883        #[cfg(feature = "objc2-core-foundation")]
884        /// Create a synthesized `VNRectangleObservation`.
885        ///
886        /// Note: The clockwise parameter ordered `+[VNRectangleObservation rectangleObservationWithRequestRevision:topLeft:topRight:bottomRight:bottomLeft:]` is the preferred initializer.
887        ///
888        ///
889        /// Parameter `requestRevision`: The revision of the VNDetectRectanglesRequest that the observation is to be treated as originating from.
890        ///
891        /// Parameter `topLeft`: The top-left corner of the rectangle in normalized coordinate space.
892        ///
893        /// Parameter `bottomLeft`: The bottom-left corner of the rectangle in normalized coordinate space.
894        ///
895        /// Parameter `bottomRight`: The bottom-right corner of the rectangle in normalized coordinate space.
896        ///
897        /// Parameter `topRight`: The top-right corner of the rectangle in normalized coordinate space.
898        #[deprecated]
899        #[unsafe(method(rectangleObservationWithRequestRevision:topLeft:bottomLeft:bottomRight:topRight:))]
900        #[unsafe(method_family = none)]
901        pub unsafe fn rectangleObservationWithRequestRevision_topLeft_bottomLeft_bottomRight_topRight(
902            request_revision: NSUInteger,
903            top_left: CGPoint,
904            bottom_left: CGPoint,
905            bottom_right: CGPoint,
906            top_right: CGPoint,
907        ) -> Retained<Self>;
908
909        #[cfg(feature = "objc2-core-foundation")]
910        /// Create a synthesized `VNRectangleObservation`.
911        ///
912        ///
913        /// Parameter `requestRevision`: The revision of the VNDetectRectanglesRequest that the observation is to be treated as originating from.
914        ///
915        /// Parameter `topLeft`: The top-left corner of the rectangle in normalized coordinate space.
916        ///
917        /// Parameter `topRight`: The top-right corner of the rectangle in normalized coordinate space.
918        ///
919        /// Parameter `bottomRight`: The bottom-right corner of the rectangle in normalized coordinate space.
920        ///
921        /// Parameter `bottomLeft`: The bottom-left corner of the rectangle in normalized coordinate space.
922        #[unsafe(method(rectangleObservationWithRequestRevision:topLeft:topRight:bottomRight:bottomLeft:))]
923        #[unsafe(method_family = none)]
924        pub unsafe fn rectangleObservationWithRequestRevision_topLeft_topRight_bottomRight_bottomLeft(
925            request_revision: NSUInteger,
926            top_left: CGPoint,
927            top_right: CGPoint,
928            bottom_right: CGPoint,
929            bottom_left: CGPoint,
930        ) -> Retained<Self>;
931    );
932}
933
934/// Methods declared on superclass `VNDetectedObjectObservation`.
935impl VNTextObservation {
936    extern_methods!(
937        #[cfg(feature = "objc2-core-foundation")]
938        /// create a new VNDetectedObjectObservation with a normalized bounding box and a confidence of 1.0.
939        #[unsafe(method(observationWithBoundingBox:))]
940        #[unsafe(method_family = none)]
941        pub unsafe fn observationWithBoundingBox(bounding_box: CGRect) -> Retained<Self>;
942
943        #[cfg(feature = "objc2-core-foundation")]
944        #[unsafe(method(observationWithRequestRevision:boundingBox:))]
945        #[unsafe(method_family = none)]
946        pub unsafe fn observationWithRequestRevision_boundingBox(
947            request_revision: NSUInteger,
948            bounding_box: CGRect,
949        ) -> Retained<Self>;
950    );
951}
952
953/// Methods declared on superclass `NSObject`.
954impl VNTextObservation {
955    extern_methods!(
956        #[unsafe(method(init))]
957        #[unsafe(method_family = init)]
958        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
959
960        #[unsafe(method(new))]
961        #[unsafe(method_family = new)]
962        pub unsafe fn new() -> Retained<Self>;
963    );
964}
965
966extern_class!(
967    /// VNRecognizedText A block of recognized text. There can be multiple VNRecognizedText objects returned in a VNRecognizedTextObservation - one for each candidate.
968    ///
969    /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vnrecognizedtext?language=objc)
970    #[unsafe(super(NSObject))]
971    #[derive(Debug, PartialEq, Eq, Hash)]
972    pub struct VNRecognizedText;
973);
974
975extern_conformance!(
976    unsafe impl NSCoding for VNRecognizedText {}
977);
978
979extern_conformance!(
980    unsafe impl NSCopying for VNRecognizedText {}
981);
982
983unsafe impl CopyingHelper for VNRecognizedText {
984    type Result = Self;
985}
986
987extern_conformance!(
988    unsafe impl NSObjectProtocol for VNRecognizedText {}
989);
990
991extern_conformance!(
992    unsafe impl NSSecureCoding for VNRecognizedText {}
993);
994
995#[cfg(feature = "VNRequestRevisionProviding")]
996extern_conformance!(
997    unsafe impl VNRequestRevisionProviding for VNRecognizedText {}
998);
999
1000impl VNRecognizedText {
1001    extern_methods!(
1002        /// Field that contains recognized text.
1003        ///
1004        /// This is the top candidate of the recognized text.
1005        #[unsafe(method(string))]
1006        #[unsafe(method_family = none)]
1007        pub fn string(&self) -> Retained<NSString>;
1008
1009        #[cfg(feature = "VNTypes")]
1010        /// The level of confidence normalized to [0.0, 1.0] where 1.0 is most confident
1011        #[unsafe(method(confidence))]
1012        #[unsafe(method_family = none)]
1013        pub fn confidence(&self) -> VNConfidence;
1014    );
1015}
1016
1017/// Methods declared on superclass `NSObject`.
1018impl VNRecognizedText {
1019    extern_methods!(
1020        #[unsafe(method(init))]
1021        #[unsafe(method_family = init)]
1022        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1023
1024        #[unsafe(method(new))]
1025        #[unsafe(method_family = new)]
1026        pub unsafe fn new() -> Retained<Self>;
1027    );
1028}
1029
1030extern_class!(
1031    /// VNRecognizedTextObservation Describes a text area detected and recognized by the VNRecognizeTextRequest request.
1032    ///
1033    /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vnrecognizedtextobservation?language=objc)
1034    #[unsafe(super(
1035        VNRectangleObservation,
1036        VNDetectedObjectObservation,
1037        VNObservation,
1038        NSObject
1039    ))]
1040    #[derive(Debug, PartialEq, Eq, Hash)]
1041    pub struct VNRecognizedTextObservation;
1042);
1043
1044extern_conformance!(
1045    unsafe impl NSCoding for VNRecognizedTextObservation {}
1046);
1047
1048extern_conformance!(
1049    unsafe impl NSCopying for VNRecognizedTextObservation {}
1050);
1051
1052unsafe impl CopyingHelper for VNRecognizedTextObservation {
1053    type Result = Self;
1054}
1055
1056extern_conformance!(
1057    unsafe impl NSObjectProtocol for VNRecognizedTextObservation {}
1058);
1059
1060extern_conformance!(
1061    unsafe impl NSSecureCoding for VNRecognizedTextObservation {}
1062);
1063
1064#[cfg(feature = "VNRequestRevisionProviding")]
1065extern_conformance!(
1066    unsafe impl VNRequestRevisionProviding for VNRecognizedTextObservation {}
1067);
1068
1069impl VNRecognizedTextObservation {
1070    extern_methods!(
1071        /// Returns the top N candidates sorted by decreasing confidence score
1072        ///
1073        /// This will return no more than N but can be less than N candidates. The maximum number of candidates returned cannot exceed 10 candidates.
1074        #[unsafe(method(topCandidates:))]
1075        #[unsafe(method_family = none)]
1076        pub fn topCandidates(
1077            &self,
1078            max_candidate_count: NSUInteger,
1079        ) -> Retained<NSArray<VNRecognizedText>>;
1080    );
1081}
1082
1083/// Methods declared on superclass `VNRectangleObservation`.
1084impl VNRecognizedTextObservation {
1085    extern_methods!(
1086        #[cfg(feature = "objc2-core-foundation")]
1087        /// Create a synthesized `VNRectangleObservation`.
1088        ///
1089        /// Note: The clockwise parameter ordered `+[VNRectangleObservation rectangleObservationWithRequestRevision:topLeft:topRight:bottomRight:bottomLeft:]` is the preferred initializer.
1090        ///
1091        ///
1092        /// Parameter `requestRevision`: The revision of the VNDetectRectanglesRequest that the observation is to be treated as originating from.
1093        ///
1094        /// Parameter `topLeft`: The top-left corner of the rectangle in normalized coordinate space.
1095        ///
1096        /// Parameter `bottomLeft`: The bottom-left corner of the rectangle in normalized coordinate space.
1097        ///
1098        /// Parameter `bottomRight`: The bottom-right corner of the rectangle in normalized coordinate space.
1099        ///
1100        /// Parameter `topRight`: The top-right corner of the rectangle in normalized coordinate space.
1101        #[deprecated]
1102        #[unsafe(method(rectangleObservationWithRequestRevision:topLeft:bottomLeft:bottomRight:topRight:))]
1103        #[unsafe(method_family = none)]
1104        pub unsafe fn rectangleObservationWithRequestRevision_topLeft_bottomLeft_bottomRight_topRight(
1105            request_revision: NSUInteger,
1106            top_left: CGPoint,
1107            bottom_left: CGPoint,
1108            bottom_right: CGPoint,
1109            top_right: CGPoint,
1110        ) -> Retained<Self>;
1111
1112        #[cfg(feature = "objc2-core-foundation")]
1113        /// Create a synthesized `VNRectangleObservation`.
1114        ///
1115        ///
1116        /// Parameter `requestRevision`: The revision of the VNDetectRectanglesRequest that the observation is to be treated as originating from.
1117        ///
1118        /// Parameter `topLeft`: The top-left corner of the rectangle in normalized coordinate space.
1119        ///
1120        /// Parameter `topRight`: The top-right corner of the rectangle in normalized coordinate space.
1121        ///
1122        /// Parameter `bottomRight`: The bottom-right corner of the rectangle in normalized coordinate space.
1123        ///
1124        /// Parameter `bottomLeft`: The bottom-left corner of the rectangle in normalized coordinate space.
1125        #[unsafe(method(rectangleObservationWithRequestRevision:topLeft:topRight:bottomRight:bottomLeft:))]
1126        #[unsafe(method_family = none)]
1127        pub unsafe fn rectangleObservationWithRequestRevision_topLeft_topRight_bottomRight_bottomLeft(
1128            request_revision: NSUInteger,
1129            top_left: CGPoint,
1130            top_right: CGPoint,
1131            bottom_right: CGPoint,
1132            bottom_left: CGPoint,
1133        ) -> Retained<Self>;
1134    );
1135}
1136
1137/// Methods declared on superclass `VNDetectedObjectObservation`.
1138impl VNRecognizedTextObservation {
1139    extern_methods!(
1140        #[cfg(feature = "objc2-core-foundation")]
1141        /// create a new VNDetectedObjectObservation with a normalized bounding box and a confidence of 1.0.
1142        #[unsafe(method(observationWithBoundingBox:))]
1143        #[unsafe(method_family = none)]
1144        pub unsafe fn observationWithBoundingBox(bounding_box: CGRect) -> Retained<Self>;
1145
1146        #[cfg(feature = "objc2-core-foundation")]
1147        #[unsafe(method(observationWithRequestRevision:boundingBox:))]
1148        #[unsafe(method_family = none)]
1149        pub unsafe fn observationWithRequestRevision_boundingBox(
1150            request_revision: NSUInteger,
1151            bounding_box: CGRect,
1152        ) -> Retained<Self>;
1153    );
1154}
1155
1156/// Methods declared on superclass `NSObject`.
1157impl VNRecognizedTextObservation {
1158    extern_methods!(
1159        #[unsafe(method(init))]
1160        #[unsafe(method_family = init)]
1161        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1162
1163        #[unsafe(method(new))]
1164        #[unsafe(method_family = new)]
1165        pub unsafe fn new() -> Retained<Self>;
1166    );
1167}
1168
1169extern_class!(
1170    /// VNBarcodeObservation Describes an area containing a barcode detected by the VNRequestNameDetectBarcodes request.
1171    ///
1172    /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vnbarcodeobservation?language=objc)
1173    #[unsafe(super(
1174        VNRectangleObservation,
1175        VNDetectedObjectObservation,
1176        VNObservation,
1177        NSObject
1178    ))]
1179    #[derive(Debug, PartialEq, Eq, Hash)]
1180    pub struct VNBarcodeObservation;
1181);
1182
1183extern_conformance!(
1184    unsafe impl NSCoding for VNBarcodeObservation {}
1185);
1186
1187extern_conformance!(
1188    unsafe impl NSCopying for VNBarcodeObservation {}
1189);
1190
1191unsafe impl CopyingHelper for VNBarcodeObservation {
1192    type Result = Self;
1193}
1194
1195extern_conformance!(
1196    unsafe impl NSObjectProtocol for VNBarcodeObservation {}
1197);
1198
1199extern_conformance!(
1200    unsafe impl NSSecureCoding for VNBarcodeObservation {}
1201);
1202
1203#[cfg(feature = "VNRequestRevisionProviding")]
1204extern_conformance!(
1205    unsafe impl VNRequestRevisionProviding for VNBarcodeObservation {}
1206);
1207
1208impl VNBarcodeObservation {
1209    extern_methods!(
1210        #[cfg(feature = "VNTypes")]
1211        /// The symbology of the detected barcode.
1212        #[unsafe(method(symbology))]
1213        #[unsafe(method_family = none)]
1214        pub unsafe fn symbology(&self) -> Retained<VNBarcodeSymbology>;
1215
1216        #[cfg(feature = "objc2-core-image")]
1217        /// An object that provides symbology-specific data for the barcode.
1218        #[unsafe(method(barcodeDescriptor))]
1219        #[unsafe(method_family = none)]
1220        pub unsafe fn barcodeDescriptor(&self) -> Option<Retained<CIBarcodeDescriptor>>;
1221
1222        /// The string representation of the barcode's payload.  Depending on the symbology of the barcode and/or the payload data itself, a string representation of the payload may not be available.
1223        #[unsafe(method(payloadStringValue))]
1224        #[unsafe(method_family = none)]
1225        pub unsafe fn payloadStringValue(&self) -> Option<Retained<NSString>>;
1226
1227        /// The raw data representation of the barcode's payload if available.
1228        #[unsafe(method(payloadData))]
1229        #[unsafe(method_family = none)]
1230        pub unsafe fn payloadData(&self) -> Option<Retained<NSData>>;
1231
1232        /// Boolean indicating if the barcode carries any GS1 application specific data
1233        #[unsafe(method(isGS1DataCarrier))]
1234        #[unsafe(method_family = none)]
1235        pub unsafe fn isGS1DataCarrier(&self) -> bool;
1236
1237        /// A boolean indicating if the barcode is color inverted
1238        #[unsafe(method(isColorInverted))]
1239        #[unsafe(method_family = none)]
1240        pub unsafe fn isColorInverted(&self) -> bool;
1241
1242        #[cfg(feature = "VNTypes")]
1243        /// Represents the supplemental composite type. Currently, this can only refer to the composite flag of the 2D symbology as part of a GS1 composite symbology.
1244        /// This attribute only exists when the primary descriptor is the 1D symbology of a GS1 composite symbology, and of which a valid 2D counterpart has been coalesced into.
1245        #[unsafe(method(supplementalCompositeType))]
1246        #[unsafe(method_family = none)]
1247        pub unsafe fn supplementalCompositeType(&self) -> VNBarcodeCompositeType;
1248
1249        /// Decode the supplemental code in the descriptor as a string value. Note: this property might be expensive the first time it is accessed
1250        /// When non-NULL, and if the descriptor has supplemental raw payload data, the pointee will be set to the decoded supplemental payload string value.
1251        #[unsafe(method(supplementalPayloadString))]
1252        #[unsafe(method_family = none)]
1253        pub unsafe fn supplementalPayloadString(&self) -> Option<Retained<NSString>>;
1254
1255        /// Decode the supplemental code in the descriptor as a string value. Note: this property might be expensive the first time it is accessed
1256        /// When non-NULL, and if the descriptor has supplemental raw payload data, the pointee will be set to the decoded supplemental payload raw data value.
1257        #[unsafe(method(supplementalPayloadData))]
1258        #[unsafe(method_family = none)]
1259        pub unsafe fn supplementalPayloadData(&self) -> Option<Retained<NSData>>;
1260    );
1261}
1262
1263/// Methods declared on superclass `VNRectangleObservation`.
1264impl VNBarcodeObservation {
1265    extern_methods!(
1266        #[cfg(feature = "objc2-core-foundation")]
1267        /// Create a synthesized `VNRectangleObservation`.
1268        ///
1269        /// Note: The clockwise parameter ordered `+[VNRectangleObservation rectangleObservationWithRequestRevision:topLeft:topRight:bottomRight:bottomLeft:]` is the preferred initializer.
1270        ///
1271        ///
1272        /// Parameter `requestRevision`: The revision of the VNDetectRectanglesRequest that the observation is to be treated as originating from.
1273        ///
1274        /// Parameter `topLeft`: The top-left corner of the rectangle in normalized coordinate space.
1275        ///
1276        /// Parameter `bottomLeft`: The bottom-left corner of the rectangle in normalized coordinate space.
1277        ///
1278        /// Parameter `bottomRight`: The bottom-right corner of the rectangle in normalized coordinate space.
1279        ///
1280        /// Parameter `topRight`: The top-right corner of the rectangle in normalized coordinate space.
1281        #[deprecated]
1282        #[unsafe(method(rectangleObservationWithRequestRevision:topLeft:bottomLeft:bottomRight:topRight:))]
1283        #[unsafe(method_family = none)]
1284        pub unsafe fn rectangleObservationWithRequestRevision_topLeft_bottomLeft_bottomRight_topRight(
1285            request_revision: NSUInteger,
1286            top_left: CGPoint,
1287            bottom_left: CGPoint,
1288            bottom_right: CGPoint,
1289            top_right: CGPoint,
1290        ) -> Retained<Self>;
1291
1292        #[cfg(feature = "objc2-core-foundation")]
1293        /// Create a synthesized `VNRectangleObservation`.
1294        ///
1295        ///
1296        /// Parameter `requestRevision`: The revision of the VNDetectRectanglesRequest that the observation is to be treated as originating from.
1297        ///
1298        /// Parameter `topLeft`: The top-left corner of the rectangle in normalized coordinate space.
1299        ///
1300        /// Parameter `topRight`: The top-right corner of the rectangle in normalized coordinate space.
1301        ///
1302        /// Parameter `bottomRight`: The bottom-right corner of the rectangle in normalized coordinate space.
1303        ///
1304        /// Parameter `bottomLeft`: The bottom-left corner of the rectangle in normalized coordinate space.
1305        #[unsafe(method(rectangleObservationWithRequestRevision:topLeft:topRight:bottomRight:bottomLeft:))]
1306        #[unsafe(method_family = none)]
1307        pub unsafe fn rectangleObservationWithRequestRevision_topLeft_topRight_bottomRight_bottomLeft(
1308            request_revision: NSUInteger,
1309            top_left: CGPoint,
1310            top_right: CGPoint,
1311            bottom_right: CGPoint,
1312            bottom_left: CGPoint,
1313        ) -> Retained<Self>;
1314    );
1315}
1316
1317/// Methods declared on superclass `VNDetectedObjectObservation`.
1318impl VNBarcodeObservation {
1319    extern_methods!(
1320        #[cfg(feature = "objc2-core-foundation")]
1321        /// create a new VNDetectedObjectObservation with a normalized bounding box and a confidence of 1.0.
1322        #[unsafe(method(observationWithBoundingBox:))]
1323        #[unsafe(method_family = none)]
1324        pub unsafe fn observationWithBoundingBox(bounding_box: CGRect) -> Retained<Self>;
1325
1326        #[cfg(feature = "objc2-core-foundation")]
1327        #[unsafe(method(observationWithRequestRevision:boundingBox:))]
1328        #[unsafe(method_family = none)]
1329        pub unsafe fn observationWithRequestRevision_boundingBox(
1330            request_revision: NSUInteger,
1331            bounding_box: CGRect,
1332        ) -> Retained<Self>;
1333    );
1334}
1335
1336/// Methods declared on superclass `NSObject`.
1337impl VNBarcodeObservation {
1338    extern_methods!(
1339        #[unsafe(method(init))]
1340        #[unsafe(method_family = init)]
1341        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1342
1343        #[unsafe(method(new))]
1344        #[unsafe(method_family = new)]
1345        pub unsafe fn new() -> Retained<Self>;
1346    );
1347}
1348
1349extern_class!(
1350    /// VNHorizonObservation is the result of a VNDetectHorizonRequest
1351    ///
1352    /// Use the transform or angle to upright the image and make the detected horizon level.
1353    ///
1354    /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vnhorizonobservation?language=objc)
1355    #[unsafe(super(VNObservation, NSObject))]
1356    #[derive(Debug, PartialEq, Eq, Hash)]
1357    pub struct VNHorizonObservation;
1358);
1359
1360extern_conformance!(
1361    unsafe impl NSCoding for VNHorizonObservation {}
1362);
1363
1364extern_conformance!(
1365    unsafe impl NSCopying for VNHorizonObservation {}
1366);
1367
1368unsafe impl CopyingHelper for VNHorizonObservation {
1369    type Result = Self;
1370}
1371
1372extern_conformance!(
1373    unsafe impl NSObjectProtocol for VNHorizonObservation {}
1374);
1375
1376extern_conformance!(
1377    unsafe impl NSSecureCoding for VNHorizonObservation {}
1378);
1379
1380#[cfg(feature = "VNRequestRevisionProviding")]
1381extern_conformance!(
1382    unsafe impl VNRequestRevisionProviding for VNHorizonObservation {}
1383);
1384
1385impl VNHorizonObservation {
1386    extern_methods!(
1387        #[cfg(feature = "objc2-core-foundation")]
1388        /// Transform applied to the detected horizon in image coordinates.
1389        ///
1390        /// This is the transform in image coordinates and not a normalized transform.
1391        #[unsafe(method(transform))]
1392        #[unsafe(method_family = none)]
1393        pub unsafe fn transform(&self) -> CGAffineTransform;
1394
1395        #[cfg(feature = "objc2-core-foundation")]
1396        /// Angle of the observed horizon.
1397        #[unsafe(method(angle))]
1398        #[unsafe(method_family = none)]
1399        pub unsafe fn angle(&self) -> CGFloat;
1400
1401        #[cfg(feature = "objc2-core-foundation")]
1402        /// Creates a transform for the specified width and height.
1403        #[unsafe(method(transformForImageWidth:height:))]
1404        #[unsafe(method_family = none)]
1405        pub unsafe fn transformForImageWidth_height(
1406            &self,
1407            width: usize,
1408            height: usize,
1409        ) -> CGAffineTransform;
1410    );
1411}
1412
1413/// Methods declared on superclass `NSObject`.
1414impl VNHorizonObservation {
1415    extern_methods!(
1416        #[unsafe(method(init))]
1417        #[unsafe(method_family = init)]
1418        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1419
1420        #[unsafe(method(new))]
1421        #[unsafe(method_family = new)]
1422        pub unsafe fn new() -> Retained<Self>;
1423    );
1424}
1425
1426extern_class!(
1427    /// VNImageAlignmentObservation is generated from an image registration. This is an abstract base class. The type of registration request used defines which subclass describes the result.
1428    ///
1429    /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vnimagealignmentobservation?language=objc)
1430    #[unsafe(super(VNObservation, NSObject))]
1431    #[derive(Debug, PartialEq, Eq, Hash)]
1432    pub struct VNImageAlignmentObservation;
1433);
1434
1435extern_conformance!(
1436    unsafe impl NSCoding for VNImageAlignmentObservation {}
1437);
1438
1439extern_conformance!(
1440    unsafe impl NSCopying for VNImageAlignmentObservation {}
1441);
1442
1443unsafe impl CopyingHelper for VNImageAlignmentObservation {
1444    type Result = Self;
1445}
1446
1447extern_conformance!(
1448    unsafe impl NSObjectProtocol for VNImageAlignmentObservation {}
1449);
1450
1451extern_conformance!(
1452    unsafe impl NSSecureCoding for VNImageAlignmentObservation {}
1453);
1454
1455#[cfg(feature = "VNRequestRevisionProviding")]
1456extern_conformance!(
1457    unsafe impl VNRequestRevisionProviding for VNImageAlignmentObservation {}
1458);
1459
1460impl VNImageAlignmentObservation {
1461    extern_methods!();
1462}
1463
1464/// Methods declared on superclass `NSObject`.
1465impl VNImageAlignmentObservation {
1466    extern_methods!(
1467        #[unsafe(method(init))]
1468        #[unsafe(method_family = init)]
1469        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1470
1471        #[unsafe(method(new))]
1472        #[unsafe(method_family = new)]
1473        pub unsafe fn new() -> Retained<Self>;
1474    );
1475}
1476
1477extern_class!(
1478    /// An observation describing the results of performing a translational image alignment.
1479    ///
1480    /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vnimagetranslationalignmentobservation?language=objc)
1481    #[unsafe(super(VNImageAlignmentObservation, VNObservation, NSObject))]
1482    #[derive(Debug, PartialEq, Eq, Hash)]
1483    pub struct VNImageTranslationAlignmentObservation;
1484);
1485
1486extern_conformance!(
1487    unsafe impl NSCoding for VNImageTranslationAlignmentObservation {}
1488);
1489
1490extern_conformance!(
1491    unsafe impl NSCopying for VNImageTranslationAlignmentObservation {}
1492);
1493
1494unsafe impl CopyingHelper for VNImageTranslationAlignmentObservation {
1495    type Result = Self;
1496}
1497
1498extern_conformance!(
1499    unsafe impl NSObjectProtocol for VNImageTranslationAlignmentObservation {}
1500);
1501
1502extern_conformance!(
1503    unsafe impl NSSecureCoding for VNImageTranslationAlignmentObservation {}
1504);
1505
1506#[cfg(feature = "VNRequestRevisionProviding")]
1507extern_conformance!(
1508    unsafe impl VNRequestRevisionProviding for VNImageTranslationAlignmentObservation {}
1509);
1510
1511impl VNImageTranslationAlignmentObservation {
1512    extern_methods!(
1513        #[cfg(feature = "objc2-core-foundation")]
1514        #[unsafe(method(alignmentTransform))]
1515        #[unsafe(method_family = none)]
1516        pub unsafe fn alignmentTransform(&self) -> CGAffineTransform;
1517    );
1518}
1519
1520/// Methods declared on superclass `NSObject`.
1521impl VNImageTranslationAlignmentObservation {
1522    extern_methods!(
1523        #[unsafe(method(init))]
1524        #[unsafe(method_family = init)]
1525        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1526
1527        #[unsafe(method(new))]
1528        #[unsafe(method_family = new)]
1529        pub unsafe fn new() -> Retained<Self>;
1530    );
1531}
1532
1533extern_class!(
1534    /// An observation describing the results of performing a homographic image alignment.
1535    ///
1536    /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vnimagehomographicalignmentobservation?language=objc)
1537    #[unsafe(super(VNImageAlignmentObservation, VNObservation, NSObject))]
1538    #[derive(Debug, PartialEq, Eq, Hash)]
1539    pub struct VNImageHomographicAlignmentObservation;
1540);
1541
1542extern_conformance!(
1543    unsafe impl NSCoding for VNImageHomographicAlignmentObservation {}
1544);
1545
1546extern_conformance!(
1547    unsafe impl NSCopying for VNImageHomographicAlignmentObservation {}
1548);
1549
1550unsafe impl CopyingHelper for VNImageHomographicAlignmentObservation {
1551    type Result = Self;
1552}
1553
1554extern_conformance!(
1555    unsafe impl NSObjectProtocol for VNImageHomographicAlignmentObservation {}
1556);
1557
1558extern_conformance!(
1559    unsafe impl NSSecureCoding for VNImageHomographicAlignmentObservation {}
1560);
1561
1562#[cfg(feature = "VNRequestRevisionProviding")]
1563extern_conformance!(
1564    unsafe impl VNRequestRevisionProviding for VNImageHomographicAlignmentObservation {}
1565);
1566
1567impl VNImageHomographicAlignmentObservation {
1568    extern_methods!();
1569}
1570
1571/// Methods declared on superclass `NSObject`.
1572impl VNImageHomographicAlignmentObservation {
1573    extern_methods!(
1574        #[unsafe(method(init))]
1575        #[unsafe(method_family = init)]
1576        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1577
1578        #[unsafe(method(new))]
1579        #[unsafe(method_family = new)]
1580        pub unsafe fn new() -> Retained<Self>;
1581    );
1582}
1583
1584extern_class!(
1585    /// VNSaliencyImageObservation provides a grayscale "heat" map of important areas of an image.
1586    ///
1587    /// In the revision1, the "heat" map is a OneComponent32Float pixel format CVPixelBuffer.
1588    ///
1589    /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vnsaliencyimageobservation?language=objc)
1590    #[unsafe(super(VNPixelBufferObservation, VNObservation, NSObject))]
1591    #[derive(Debug, PartialEq, Eq, Hash)]
1592    pub struct VNSaliencyImageObservation;
1593);
1594
1595extern_conformance!(
1596    unsafe impl NSCoding for VNSaliencyImageObservation {}
1597);
1598
1599extern_conformance!(
1600    unsafe impl NSCopying for VNSaliencyImageObservation {}
1601);
1602
1603unsafe impl CopyingHelper for VNSaliencyImageObservation {
1604    type Result = Self;
1605}
1606
1607extern_conformance!(
1608    unsafe impl NSObjectProtocol for VNSaliencyImageObservation {}
1609);
1610
1611extern_conformance!(
1612    unsafe impl NSSecureCoding for VNSaliencyImageObservation {}
1613);
1614
1615#[cfg(feature = "VNRequestRevisionProviding")]
1616extern_conformance!(
1617    unsafe impl VNRequestRevisionProviding for VNSaliencyImageObservation {}
1618);
1619
1620impl VNSaliencyImageObservation {
1621    extern_methods!(
1622        /// An array of bounds of salient objects within the image. Each box represents a distinct mode of the heat map.
1623        #[unsafe(method(salientObjects))]
1624        #[unsafe(method_family = none)]
1625        pub unsafe fn salientObjects(&self) -> Option<Retained<NSArray<VNRectangleObservation>>>;
1626    );
1627}
1628
1629/// Methods declared on superclass `NSObject`.
1630impl VNSaliencyImageObservation {
1631    extern_methods!(
1632        #[unsafe(method(init))]
1633        #[unsafe(method_family = init)]
1634        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1635
1636        #[unsafe(method(new))]
1637        #[unsafe(method_family = new)]
1638        pub unsafe fn new() -> Retained<Self>;
1639    );
1640}
1641
1642extern_class!(
1643    /// [Apple's documentation](https://developer.apple.com/documentation/vision/vnfeatureprintobservation?language=objc)
1644    #[unsafe(super(VNObservation, NSObject))]
1645    #[derive(Debug, PartialEq, Eq, Hash)]
1646    pub struct VNFeaturePrintObservation;
1647);
1648
1649extern_conformance!(
1650    unsafe impl NSCoding for VNFeaturePrintObservation {}
1651);
1652
1653extern_conformance!(
1654    unsafe impl NSCopying for VNFeaturePrintObservation {}
1655);
1656
1657unsafe impl CopyingHelper for VNFeaturePrintObservation {
1658    type Result = Self;
1659}
1660
1661extern_conformance!(
1662    unsafe impl NSObjectProtocol for VNFeaturePrintObservation {}
1663);
1664
1665extern_conformance!(
1666    unsafe impl NSSecureCoding for VNFeaturePrintObservation {}
1667);
1668
1669#[cfg(feature = "VNRequestRevisionProviding")]
1670extern_conformance!(
1671    unsafe impl VNRequestRevisionProviding for VNFeaturePrintObservation {}
1672);
1673
1674impl VNFeaturePrintObservation {
1675    extern_methods!(
1676        #[cfg(feature = "VNTypes")]
1677        /// The type of each element in the data.
1678        #[unsafe(method(elementType))]
1679        #[unsafe(method_family = none)]
1680        pub unsafe fn elementType(&self) -> VNElementType;
1681
1682        /// The total number of elements in the data.
1683        #[unsafe(method(elementCount))]
1684        #[unsafe(method_family = none)]
1685        pub unsafe fn elementCount(&self) -> NSUInteger;
1686
1687        /// The feature print data.
1688        #[unsafe(method(data))]
1689        #[unsafe(method_family = none)]
1690        pub unsafe fn data(&self) -> Retained<NSData>;
1691
1692        /// Computes the distance between two observations.
1693        ///
1694        /// The larger the distance the more dissimlar the feature prints are. In case of an error this method returns false with an error describing the error condition, for instance comparing two non-comparable feature prints.
1695        ///
1696        /// # Safety
1697        ///
1698        /// `out_distance` must be a valid pointer.
1699        #[unsafe(method(computeDistance:toFeaturePrintObservation:error:_))]
1700        #[unsafe(method_family = none)]
1701        pub unsafe fn computeDistance_toFeaturePrintObservation_error(
1702            &self,
1703            out_distance: NonNull<c_float>,
1704            feature_print: &VNFeaturePrintObservation,
1705        ) -> Result<(), Retained<NSError>>;
1706    );
1707}
1708
1709/// Methods declared on superclass `NSObject`.
1710impl VNFeaturePrintObservation {
1711    extern_methods!(
1712        #[unsafe(method(init))]
1713        #[unsafe(method_family = init)]
1714        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1715
1716        #[unsafe(method(new))]
1717        #[unsafe(method_family = new)]
1718        pub unsafe fn new() -> Retained<Self>;
1719    );
1720}
1721
1722extern_class!(
1723    /// [Apple's documentation](https://developer.apple.com/documentation/vision/vncontoursobservation?language=objc)
1724    #[unsafe(super(VNObservation, NSObject))]
1725    #[derive(Debug, PartialEq, Eq, Hash)]
1726    pub struct VNContoursObservation;
1727);
1728
1729extern_conformance!(
1730    unsafe impl NSCoding for VNContoursObservation {}
1731);
1732
1733extern_conformance!(
1734    unsafe impl NSCopying for VNContoursObservation {}
1735);
1736
1737unsafe impl CopyingHelper for VNContoursObservation {
1738    type Result = Self;
1739}
1740
1741extern_conformance!(
1742    unsafe impl NSObjectProtocol for VNContoursObservation {}
1743);
1744
1745extern_conformance!(
1746    unsafe impl NSSecureCoding for VNContoursObservation {}
1747);
1748
1749#[cfg(feature = "VNRequestRevisionProviding")]
1750extern_conformance!(
1751    unsafe impl VNRequestRevisionProviding for VNContoursObservation {}
1752);
1753
1754impl VNContoursObservation {
1755    extern_methods!(
1756        /// The total number of contours detected.
1757        #[unsafe(method(contourCount))]
1758        #[unsafe(method_family = none)]
1759        pub unsafe fn contourCount(&self) -> NSInteger;
1760
1761        #[cfg(feature = "VNGeometry")]
1762        /// Returns the VNContour object at the specified index, irrespective of hierarchy.
1763        ///
1764        /// Parameter `contourIndex`: The index of the contour to request. Valid values are in the range [0..contourCount-1].
1765        ///
1766        /// Parameter `error`: The error returned if the index path is out of range.
1767        ///
1768        /// Returns: The detected VNContour at the specified index without regard to hierarchy.
1769        #[unsafe(method(contourAtIndex:error:_))]
1770        #[unsafe(method_family = none)]
1771        pub unsafe fn contourAtIndex_error(
1772            &self,
1773            contour_index: NSInteger,
1774        ) -> Result<Retained<VNContour>, Retained<NSError>>;
1775
1776        /// The total number of top-level contours detected.
1777        #[unsafe(method(topLevelContourCount))]
1778        #[unsafe(method_family = none)]
1779        pub unsafe fn topLevelContourCount(&self) -> NSInteger;
1780
1781        #[cfg(feature = "VNGeometry")]
1782        /// An array of the top level contours (i.e. contours that are not enclosed inside another contour),.
1783        ///
1784        /// This array constitutes the top of the contour hierarchy. Each contour object can be further iterated to determine its children.
1785        ///
1786        /// See: VNContour for more information.
1787        #[unsafe(method(topLevelContours))]
1788        #[unsafe(method_family = none)]
1789        pub unsafe fn topLevelContours(&self) -> Retained<NSArray<VNContour>>;
1790
1791        #[cfg(feature = "VNGeometry")]
1792        /// Returns the VNContour object at the specified index path.
1793        ///
1794        /// Use the indexPath property from a VNContour instance to pass to this method.
1795        ///
1796        /// Parameter `indexPath`: The index path is the heirarchical path to the contour.
1797        ///
1798        /// Parameter `error`: The error returned if the index path is out of range.
1799        ///
1800        /// Returns: The VNContour object at the specified index path.
1801        #[unsafe(method(contourAtIndexPath:error:_))]
1802        #[unsafe(method_family = none)]
1803        pub unsafe fn contourAtIndexPath_error(
1804            &self,
1805            index_path: &NSIndexPath,
1806        ) -> Result<Retained<VNContour>, Retained<NSError>>;
1807
1808        #[cfg(feature = "objc2-core-graphics")]
1809        /// Obtain all of the contours represented as a CGPath in normalized coordinates.
1810        ///
1811        /// The path is owned by the observation and therefore will be alive as long as the the observation is alive.
1812        #[unsafe(method(normalizedPath))]
1813        #[unsafe(method_family = none)]
1814        pub unsafe fn normalizedPath(&self) -> Retained<CGPath>;
1815    );
1816}
1817
1818/// Methods declared on superclass `NSObject`.
1819impl VNContoursObservation {
1820    extern_methods!(
1821        #[unsafe(method(init))]
1822        #[unsafe(method_family = init)]
1823        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1824
1825        #[unsafe(method(new))]
1826        #[unsafe(method_family = new)]
1827        pub unsafe fn new() -> Retained<Self>;
1828    );
1829}
1830
1831extern "C" {
1832    /// [Apple's documentation](https://developer.apple.com/documentation/vision/vnrecognizedpointgroupkeyall?language=objc)
1833    #[cfg(feature = "VNTypes")]
1834    pub static VNRecognizedPointGroupKeyAll: &'static VNRecognizedPointGroupKey;
1835}
1836
1837extern_class!(
1838    /// VNRecognizedPointsObservation is a request result detailing points in an image.
1839    ///
1840    /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vnrecognizedpointsobservation?language=objc)
1841    #[unsafe(super(VNObservation, NSObject))]
1842    #[derive(Debug, PartialEq, Eq, Hash)]
1843    pub struct VNRecognizedPointsObservation;
1844);
1845
1846extern_conformance!(
1847    unsafe impl NSCoding for VNRecognizedPointsObservation {}
1848);
1849
1850extern_conformance!(
1851    unsafe impl NSCopying for VNRecognizedPointsObservation {}
1852);
1853
1854unsafe impl CopyingHelper for VNRecognizedPointsObservation {
1855    type Result = Self;
1856}
1857
1858extern_conformance!(
1859    unsafe impl NSObjectProtocol for VNRecognizedPointsObservation {}
1860);
1861
1862extern_conformance!(
1863    unsafe impl NSSecureCoding for VNRecognizedPointsObservation {}
1864);
1865
1866#[cfg(feature = "VNRequestRevisionProviding")]
1867extern_conformance!(
1868    unsafe impl VNRequestRevisionProviding for VNRecognizedPointsObservation {}
1869);
1870
1871impl VNRecognizedPointsObservation {
1872    extern_methods!(
1873        #[unsafe(method(new))]
1874        #[unsafe(method_family = new)]
1875        pub unsafe fn new() -> Retained<Self>;
1876
1877        #[unsafe(method(init))]
1878        #[unsafe(method_family = init)]
1879        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1880
1881        #[cfg(feature = "VNTypes")]
1882        /// Returns all of the point group keys available in the observation.
1883        #[unsafe(method(availableKeys))]
1884        #[unsafe(method_family = none)]
1885        pub unsafe fn availableKeys(&self) -> Retained<NSArray<VNRecognizedPointKey>>;
1886
1887        #[cfg(feature = "VNTypes")]
1888        /// The availableGroupKeys property returns all of the point group labels usable with the observation.
1889        #[unsafe(method(availableGroupKeys))]
1890        #[unsafe(method_family = none)]
1891        pub unsafe fn availableGroupKeys(&self) -> Retained<NSArray<VNRecognizedPointGroupKey>>;
1892
1893        #[cfg(all(
1894            feature = "VNDetectedPoint",
1895            feature = "VNGeometry",
1896            feature = "VNTypes"
1897        ))]
1898        /// Obtains a specific normalized recognized point.
1899        ///
1900        ///
1901        /// Parameter `pointKey`: The key specifying the desired recognized point.
1902        ///
1903        ///
1904        /// Parameter `error`: The address of a variable that will be populated with the error that describes the failure.  If the caller does not require this information, NULL can be passed.
1905        ///
1906        ///
1907        /// Returns: the recognized point, or nil if the specific point is not defined.
1908        #[unsafe(method(recognizedPointForKey:error:_))]
1909        #[unsafe(method_family = none)]
1910        pub unsafe fn recognizedPointForKey_error(
1911            &self,
1912            point_key: &VNRecognizedPointKey,
1913        ) -> Result<Retained<VNRecognizedPoint>, Retained<NSError>>;
1914
1915        #[cfg(all(
1916            feature = "VNDetectedPoint",
1917            feature = "VNGeometry",
1918            feature = "VNTypes"
1919        ))]
1920        /// Obtains the collection of points associated with an identified grouping.
1921        ///
1922        ///
1923        /// The obtained collection is a dictionary that provides the mapping of a recognized point's key to the recognized point.
1924        ///
1925        ///
1926        /// Parameter `groupKey`: The key representing a specific grouping of points.
1927        ///
1928        /// Parameter `error`: The address of a variable that will be populated with the error that describes the failure.  If the caller does not require this information, NULL can be passed.
1929        ///
1930        /// Returns: the dictionary of recognized points in the group, or nil if an error was encountered.
1931        #[unsafe(method(recognizedPointsForGroupKey:error:_))]
1932        #[unsafe(method_family = none)]
1933        pub unsafe fn recognizedPointsForGroupKey_error(
1934            &self,
1935            group_key: &VNRecognizedPointGroupKey,
1936        ) -> Result<
1937            Retained<NSDictionary<VNRecognizedPointKey, VNRecognizedPoint>>,
1938            Retained<NSError>,
1939        >;
1940
1941        #[cfg(feature = "objc2-core-ml")]
1942        /// Returns the recognized points packaged into an MLMultiArray.
1943        ///
1944        ///
1945        /// The MLMultiArray will contain the raw data output of (x coordinate, y coordinate, confidence) for specific points in the format expected by CreateML action recognition models.
1946        /// The datatype of the elements in the array is double and the dimensions are [1, 3, # of possible points].  If an expected point key is not available in the obeservation, that entry in the MLMultiArray will be populated with 0s.
1947        ///
1948        ///
1949        /// Parameter `error`: The address of a variable that will be populated with the error that describes the failure.  If the caller does not require this information, NULL can be passed.
1950        ///
1951        ///
1952        /// Returns: the MLMultiArray representation of the points, or nil if an error was encountered.
1953        #[unsafe(method(keypointsMultiArrayAndReturnError:_))]
1954        #[unsafe(method_family = none)]
1955        pub unsafe fn keypointsMultiArrayAndReturnError(
1956            &self,
1957        ) -> Result<Retained<MLMultiArray>, Retained<NSError>>;
1958    );
1959}
1960
1961extern_class!(
1962    /// VNHumanObservation is the result of a Human rectangles detection request
1963    ///
1964    /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vnhumanobservation?language=objc)
1965    #[unsafe(super(VNDetectedObjectObservation, VNObservation, NSObject))]
1966    #[derive(Debug, PartialEq, Eq, Hash)]
1967    pub struct VNHumanObservation;
1968);
1969
1970extern_conformance!(
1971    unsafe impl NSCoding for VNHumanObservation {}
1972);
1973
1974extern_conformance!(
1975    unsafe impl NSCopying for VNHumanObservation {}
1976);
1977
1978unsafe impl CopyingHelper for VNHumanObservation {
1979    type Result = Self;
1980}
1981
1982extern_conformance!(
1983    unsafe impl NSObjectProtocol for VNHumanObservation {}
1984);
1985
1986extern_conformance!(
1987    unsafe impl NSSecureCoding for VNHumanObservation {}
1988);
1989
1990#[cfg(feature = "VNRequestRevisionProviding")]
1991extern_conformance!(
1992    unsafe impl VNRequestRevisionProviding for VNHumanObservation {}
1993);
1994
1995impl VNHumanObservation {
1996    extern_methods!(
1997        /// Boolean property to specify whether the human upper body or full body detection is recorded in the observation. This setting is propagated from [VNDetectHumanRectanglesRequest -upperBodyOnly]
1998        #[unsafe(method(upperBodyOnly))]
1999        #[unsafe(method_family = none)]
2000        pub unsafe fn upperBodyOnly(&self) -> bool;
2001    );
2002}
2003
2004/// Methods declared on superclass `VNDetectedObjectObservation`.
2005impl VNHumanObservation {
2006    extern_methods!(
2007        #[cfg(feature = "objc2-core-foundation")]
2008        /// create a new VNDetectedObjectObservation with a normalized bounding box and a confidence of 1.0.
2009        #[unsafe(method(observationWithBoundingBox:))]
2010        #[unsafe(method_family = none)]
2011        pub unsafe fn observationWithBoundingBox(bounding_box: CGRect) -> Retained<Self>;
2012
2013        #[cfg(feature = "objc2-core-foundation")]
2014        #[unsafe(method(observationWithRequestRevision:boundingBox:))]
2015        #[unsafe(method_family = none)]
2016        pub unsafe fn observationWithRequestRevision_boundingBox(
2017            request_revision: NSUInteger,
2018            bounding_box: CGRect,
2019        ) -> Retained<Self>;
2020    );
2021}
2022
2023/// Methods declared on superclass `NSObject`.
2024impl VNHumanObservation {
2025    extern_methods!(
2026        #[unsafe(method(init))]
2027        #[unsafe(method_family = init)]
2028        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
2029
2030        #[unsafe(method(new))]
2031        #[unsafe(method_family = new)]
2032        pub unsafe fn new() -> Retained<Self>;
2033    );
2034}
2035
2036extern_class!(
2037    /// An observation resulting from an instance mask generation request. It contains an instance mask that labels instances in the mask that labels per pixel an instance.
2038    ///
2039    /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vninstancemaskobservation?language=objc)
2040    #[unsafe(super(VNObservation, NSObject))]
2041    #[derive(Debug, PartialEq, Eq, Hash)]
2042    pub struct VNInstanceMaskObservation;
2043);
2044
2045extern_conformance!(
2046    unsafe impl NSCoding for VNInstanceMaskObservation {}
2047);
2048
2049extern_conformance!(
2050    unsafe impl NSCopying for VNInstanceMaskObservation {}
2051);
2052
2053unsafe impl CopyingHelper for VNInstanceMaskObservation {
2054    type Result = Self;
2055}
2056
2057extern_conformance!(
2058    unsafe impl NSObjectProtocol for VNInstanceMaskObservation {}
2059);
2060
2061extern_conformance!(
2062    unsafe impl NSSecureCoding for VNInstanceMaskObservation {}
2063);
2064
2065#[cfg(feature = "VNRequestRevisionProviding")]
2066extern_conformance!(
2067    unsafe impl VNRequestRevisionProviding for VNInstanceMaskObservation {}
2068);
2069
2070impl VNInstanceMaskObservation {
2071    extern_methods!(
2072        #[cfg(feature = "objc2-core-video")]
2073        /// The resulting mask represents all instances in a mask image where 0 represents the background and all other values represent the indices of the instances identified.
2074        /// Note that a pixel can only correspond to one instance and not multiple instances.
2075        #[unsafe(method(instanceMask))]
2076        #[unsafe(method_family = none)]
2077        pub unsafe fn instanceMask(&self) -> Retained<CVPixelBuffer>;
2078
2079        /// *The IndexSet that encompases all instances except the background
2080        #[unsafe(method(allInstances))]
2081        #[unsafe(method_family = none)]
2082        pub unsafe fn allInstances(&self) -> Retained<NSIndexSet>;
2083
2084        #[cfg(feature = "objc2-core-video")]
2085        /// The low res mask from the selected instances in the resolution of the performed analysis which is not upscaled to the image resolution.
2086        ///
2087        /// Parameter `instances`: An NSIndexSet of selected instances where 0 is the background. An empty set selects all instances but the background
2088        ///
2089        /// Parameter `error`: The address of a variable that will be populated with the error that describes the failure.  If the caller does not require this information, NULL can be passed.
2090        /// The pixel format of kCVPixelFormatType_OneComponent32Float
2091        #[unsafe(method(generateMaskForInstances:error:_))]
2092        // required for soundness, method has `returns_retained` attribute.
2093        #[unsafe(method_family = copy)]
2094        pub unsafe fn generateMaskForInstances_error(
2095            &self,
2096            instances: &NSIndexSet,
2097        ) -> Result<Retained<CVPixelBuffer>, Retained<NSError>>;
2098
2099        #[cfg(all(feature = "VNRequestHandler", feature = "objc2-core-video"))]
2100        /// High res image with everything but the selected instances removed to transparent black.
2101        ///
2102        /// Parameter `instances`: An NSIndexSet of selected instances where 0 is the background.
2103        ///
2104        /// Parameter `croppedToInstancesExtent`: Crops the image to the smallest rectangle containg all instances with remaining alpha elements.
2105        /// Setting this value to NO does not perform any cropping.
2106        ///
2107        /// Parameter `error`: The address of a variable that will be populated with the error that describes the failure.  If the caller does not require this information, NULL can be passed.
2108        #[unsafe(method(generateMaskedImageOfInstances:fromRequestHandler:croppedToInstancesExtent:error:_))]
2109        // required for soundness, method has `returns_retained` attribute.
2110        #[unsafe(method_family = copy)]
2111        pub unsafe fn generateMaskedImageOfInstances_fromRequestHandler_croppedToInstancesExtent_error(
2112            &self,
2113            instances: &NSIndexSet,
2114            request_handler: &VNImageRequestHandler,
2115            crop_result: bool,
2116        ) -> Result<Retained<CVPixelBuffer>, Retained<NSError>>;
2117
2118        #[cfg(all(feature = "VNRequestHandler", feature = "objc2-core-video"))]
2119        /// High res mask with the selected instances preserved while everything else is removed to transparent black.
2120        ///
2121        /// Parameter `forInstances`: An NSIndexSet of selected instances where 0 is the background.
2122        ///
2123        /// Parameter `error`: The address of a variable that will be populated with the error that describes the failure.  If the caller does not require this information, NULL can be passed.
2124        #[unsafe(method(generateScaledMaskForImageForInstances:fromRequestHandler:error:_))]
2125        // required for soundness, method has `returns_retained` attribute.
2126        #[unsafe(method_family = copy)]
2127        pub unsafe fn generateScaledMaskForImageForInstances_fromRequestHandler_error(
2128            &self,
2129            instances: &NSIndexSet,
2130            request_handler: &VNImageRequestHandler,
2131        ) -> Result<Retained<CVPixelBuffer>, Retained<NSError>>;
2132    );
2133}
2134
2135/// Methods declared on superclass `NSObject`.
2136impl VNInstanceMaskObservation {
2137    extern_methods!(
2138        #[unsafe(method(init))]
2139        #[unsafe(method_family = init)]
2140        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
2141
2142        #[unsafe(method(new))]
2143        #[unsafe(method_family = new)]
2144        pub unsafe fn new() -> Retained<Self>;
2145    );
2146}
2147
2148extern_class!(
2149    /// [Apple's documentation](https://developer.apple.com/documentation/vision/vnanimalbodyposeobservation?language=objc)
2150    #[unsafe(super(VNRecognizedPointsObservation, VNObservation, NSObject))]
2151    #[derive(Debug, PartialEq, Eq, Hash)]
2152    pub struct VNAnimalBodyPoseObservation;
2153);
2154
2155extern_conformance!(
2156    unsafe impl NSCoding for VNAnimalBodyPoseObservation {}
2157);
2158
2159extern_conformance!(
2160    unsafe impl NSCopying for VNAnimalBodyPoseObservation {}
2161);
2162
2163unsafe impl CopyingHelper for VNAnimalBodyPoseObservation {
2164    type Result = Self;
2165}
2166
2167extern_conformance!(
2168    unsafe impl NSObjectProtocol for VNAnimalBodyPoseObservation {}
2169);
2170
2171extern_conformance!(
2172    unsafe impl NSSecureCoding for VNAnimalBodyPoseObservation {}
2173);
2174
2175#[cfg(feature = "VNRequestRevisionProviding")]
2176extern_conformance!(
2177    unsafe impl VNRequestRevisionProviding for VNAnimalBodyPoseObservation {}
2178);
2179
2180impl VNAnimalBodyPoseObservation {
2181    extern_methods!(
2182        #[cfg(feature = "VNTypes")]
2183        /// All animal joint names available in the observation.
2184        #[unsafe(method(availableJointNames))]
2185        #[unsafe(method_family = none)]
2186        pub unsafe fn availableJointNames(
2187            &self,
2188        ) -> Retained<NSArray<VNAnimalBodyPoseObservationJointName>>;
2189
2190        #[cfg(feature = "VNTypes")]
2191        /// All animal joints group names available in the observation.
2192        #[unsafe(method(availableJointGroupNames))]
2193        #[unsafe(method_family = none)]
2194        pub unsafe fn availableJointGroupNames(
2195            &self,
2196        ) -> Retained<NSArray<VNAnimalBodyPoseObservationJointsGroupName>>;
2197
2198        #[cfg(all(
2199            feature = "VNDetectedPoint",
2200            feature = "VNGeometry",
2201            feature = "VNTypes"
2202        ))]
2203        /// Obtain a specific normalized point for a named animal body joint.
2204        ///
2205        ///
2206        /// Parameter `jointName`: The name of the animal body joint.
2207        ///
2208        /// Parameter `error`: The address of a variable that will be populated with the error that describes the failure.  If the caller does not require this information, NULL can be passed.
2209        ///
2210        /// Returns: the recognized point, or nil if the point could not be obtained.
2211        #[unsafe(method(recognizedPointForJointName:error:_))]
2212        #[unsafe(method_family = none)]
2213        pub unsafe fn recognizedPointForJointName_error(
2214            &self,
2215            joint_name: &VNAnimalBodyPoseObservationJointName,
2216        ) -> Result<Retained<VNRecognizedPoint>, Retained<NSError>>;
2217
2218        #[cfg(all(
2219            feature = "VNDetectedPoint",
2220            feature = "VNGeometry",
2221            feature = "VNTypes"
2222        ))]
2223        /// Obtains the collection of points associated with a named animal body joints group.
2224        ///
2225        ///
2226        /// The obtained collection is a dictionary that provides the mapping of animal join names to the recognized point.
2227        ///
2228        ///
2229        /// Parameter `jointsGroupName`: The name of the animal body joints group.
2230        ///
2231        /// Parameter `error`: The address of a variable that will be populated with the error that describes the failure.  If the caller does not require this information, NULL can be passed.
2232        ///
2233        /// Returns: a dictionary of recognized points in the group, or nil if an error was encountered.
2234        #[unsafe(method(recognizedPointsForJointsGroupName:error:_))]
2235        #[unsafe(method_family = none)]
2236        pub unsafe fn recognizedPointsForJointsGroupName_error(
2237            &self,
2238            joints_group_name: &VNAnimalBodyPoseObservationJointsGroupName,
2239        ) -> Result<
2240            Retained<NSDictionary<VNAnimalBodyPoseObservationJointName, VNRecognizedPoint>>,
2241            Retained<NSError>,
2242        >;
2243    );
2244}
2245
2246/// Methods declared on superclass `VNRecognizedPointsObservation`.
2247impl VNAnimalBodyPoseObservation {
2248    extern_methods!(
2249        #[unsafe(method(new))]
2250        #[unsafe(method_family = new)]
2251        pub unsafe fn new() -> Retained<Self>;
2252
2253        #[unsafe(method(init))]
2254        #[unsafe(method_family = init)]
2255        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
2256    );
2257}
2258
2259extern "C" {
2260    /// [Apple's documentation](https://developer.apple.com/documentation/vision/vnrecognizedpoint3dgroupkeyall?language=objc)
2261    #[cfg(feature = "VNTypes")]
2262    pub static VNRecognizedPoint3DGroupKeyAll: &'static VNRecognizedPointGroupKey;
2263}
2264
2265extern_class!(
2266    /// Observation
2267    ///
2268    /// VNRecognizedPointsObservation is a request result detailing points in an image.
2269    ///
2270    /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vnrecognizedpoints3dobservation?language=objc)
2271    #[unsafe(super(VNObservation, NSObject))]
2272    #[derive(Debug, PartialEq, Eq, Hash)]
2273    pub struct VNRecognizedPoints3DObservation;
2274);
2275
2276extern_conformance!(
2277    unsafe impl NSCoding for VNRecognizedPoints3DObservation {}
2278);
2279
2280extern_conformance!(
2281    unsafe impl NSCopying for VNRecognizedPoints3DObservation {}
2282);
2283
2284unsafe impl CopyingHelper for VNRecognizedPoints3DObservation {
2285    type Result = Self;
2286}
2287
2288extern_conformance!(
2289    unsafe impl NSObjectProtocol for VNRecognizedPoints3DObservation {}
2290);
2291
2292extern_conformance!(
2293    unsafe impl NSSecureCoding for VNRecognizedPoints3DObservation {}
2294);
2295
2296#[cfg(feature = "VNRequestRevisionProviding")]
2297extern_conformance!(
2298    unsafe impl VNRequestRevisionProviding for VNRecognizedPoints3DObservation {}
2299);
2300
2301impl VNRecognizedPoints3DObservation {
2302    extern_methods!(
2303        #[unsafe(method(new))]
2304        #[unsafe(method_family = new)]
2305        pub unsafe fn new() -> Retained<Self>;
2306
2307        #[unsafe(method(init))]
2308        #[unsafe(method_family = init)]
2309        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
2310
2311        #[cfg(feature = "VNTypes")]
2312        /// Returns all of the point group keys available in the observation.
2313        #[unsafe(method(availableKeys))]
2314        #[unsafe(method_family = none)]
2315        pub unsafe fn availableKeys(&self) -> Retained<NSArray<VNRecognizedPointKey>>;
2316
2317        #[cfg(feature = "VNTypes")]
2318        /// The availableGroupKeys property returns all of the point group labels usable with the observation.
2319        #[unsafe(method(availableGroupKeys))]
2320        #[unsafe(method_family = none)]
2321        pub unsafe fn availableGroupKeys(&self) -> Retained<NSArray<VNRecognizedPointGroupKey>>;
2322
2323        #[cfg(all(
2324            feature = "VNGeometry",
2325            feature = "VNRecognizedPoint3D",
2326            feature = "VNTypes"
2327        ))]
2328        /// Obtains a specific normalized recognized point.
2329        ///
2330        /// Parameter `pointKey`: The key specifying the desired recognized point.
2331        ///
2332        /// Parameter `error`: The address of a variable that will be populated with the error that describes the failure.  If the caller does not require this information, NULL can be passed.
2333        ///
2334        /// Returns: the recognized point, or nil if the specific point is not defined.
2335        #[unsafe(method(recognizedPointForKey:error:_))]
2336        #[unsafe(method_family = none)]
2337        pub unsafe fn recognizedPointForKey_error(
2338            &self,
2339            point_key: &VNRecognizedPointKey,
2340        ) -> Result<Retained<VNRecognizedPoint3D>, Retained<NSError>>;
2341
2342        #[cfg(all(
2343            feature = "VNGeometry",
2344            feature = "VNRecognizedPoint3D",
2345            feature = "VNTypes"
2346        ))]
2347        /// Obtains the collection of points associated with an identified grouping.
2348        ///
2349        /// The obtained collection is a dictionary that provides the mapping of a recognized point's key to the recognized point.
2350        ///
2351        /// Parameter `groupKey`: The key representing a specific grouping of points.
2352        ///
2353        /// Parameter `error`: The address of a variable that will be populated with the error that describes the failure.  If the caller does not require this information, NULL can be passed.
2354        ///
2355        /// Returns: the dictionary of recognized points in the group, or nil if an error was encountered.
2356        #[unsafe(method(recognizedPointsForGroupKey:error:_))]
2357        #[unsafe(method_family = none)]
2358        pub unsafe fn recognizedPointsForGroupKey_error(
2359            &self,
2360            group_key: &VNRecognizedPointGroupKey,
2361        ) -> Result<
2362            Retained<NSDictionary<VNRecognizedPointKey, VNRecognizedPoint3D>>,
2363            Retained<NSError>,
2364        >;
2365    );
2366}
2367
2368/// Height estimation technique used in observation based on available metadata
2369/// VNHumanBodyPose3DObservationHeightEstimationReference is the default if no LiDAR depth is present
2370///
2371/// reference -   Since no depth was present, a reference height of 1.8 meters is used
2372/// measured -   LiDAR depth was used to measure a more accurate `bodyHeight` in meters
2373///
2374/// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vnhumanbodypose3dobservationheightestimation?language=objc)
2375// NS_ENUM
2376#[repr(transparent)]
2377#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
2378pub struct VNHumanBodyPose3DObservationHeightEstimation(pub NSInteger);
2379impl VNHumanBodyPose3DObservationHeightEstimation {
2380    #[doc(alias = "VNHumanBodyPose3DObservationHeightEstimationReference")]
2381    pub const Reference: Self = Self(0);
2382    #[doc(alias = "VNHumanBodyPose3DObservationHeightEstimationMeasured")]
2383    pub const Measured: Self = Self(1);
2384}
2385
2386unsafe impl Encode for VNHumanBodyPose3DObservationHeightEstimation {
2387    const ENCODING: Encoding = NSInteger::ENCODING;
2388}
2389
2390unsafe impl RefEncode for VNHumanBodyPose3DObservationHeightEstimation {
2391    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
2392}
2393
2394extern_class!(
2395    /// [Apple's documentation](https://developer.apple.com/documentation/vision/vnhumanbodypose3dobservation?language=objc)
2396    #[unsafe(super(VNRecognizedPoints3DObservation, VNObservation, NSObject))]
2397    #[derive(Debug, PartialEq, Eq, Hash)]
2398    pub struct VNHumanBodyPose3DObservation;
2399);
2400
2401extern_conformance!(
2402    unsafe impl NSCoding for VNHumanBodyPose3DObservation {}
2403);
2404
2405extern_conformance!(
2406    unsafe impl NSCopying for VNHumanBodyPose3DObservation {}
2407);
2408
2409unsafe impl CopyingHelper for VNHumanBodyPose3DObservation {
2410    type Result = Self;
2411}
2412
2413extern_conformance!(
2414    unsafe impl NSObjectProtocol for VNHumanBodyPose3DObservation {}
2415);
2416
2417extern_conformance!(
2418    unsafe impl NSSecureCoding for VNHumanBodyPose3DObservation {}
2419);
2420
2421#[cfg(feature = "VNRequestRevisionProviding")]
2422extern_conformance!(
2423    unsafe impl VNRequestRevisionProviding for VNHumanBodyPose3DObservation {}
2424);
2425
2426impl VNHumanBodyPose3DObservation {
2427    extern_methods!(
2428        /// Technique used to estimate body height.   `VNHumanBodyPose3DObservationHeightEstimationMeasured`   indicates`bodyHeight` returns measured height in meters more accurate to true world height.
2429        /// `VNHumanBodyPose3DObservationHeightEstimationReference` indicates `bodyHeight` returns reference height of 1.8 m
2430        #[unsafe(method(heightEstimation))]
2431        #[unsafe(method_family = none)]
2432        pub unsafe fn heightEstimation(&self) -> VNHumanBodyPose3DObservationHeightEstimation;
2433
2434        #[cfg(feature = "VNTypes")]
2435        /// All of the joints group names available in the observation.
2436        #[unsafe(method(availableJointsGroupNames))]
2437        #[unsafe(method_family = none)]
2438        pub unsafe fn availableJointsGroupNames(
2439            &self,
2440        ) -> Retained<NSArray<VNHumanBodyPose3DObservationJointsGroupName>>;
2441
2442        #[cfg(feature = "VNTypes")]
2443        /// All of the joint names available in the observation.
2444        #[unsafe(method(availableJointNames))]
2445        #[unsafe(method_family = none)]
2446        pub unsafe fn availableJointNames(
2447            &self,
2448        ) -> Retained<NSArray<VNHumanBodyPose3DObservationJointName>>;
2449
2450        /// Estimated human height, in meters.
2451        ///
2452        /// Note: A measured height will be returned in meters if  `heightEstimation` is  `VNHumanBodyPose3DObservationHeightEstimationMeasured`, otherwise reference height of 1.8 meters is returned for `VNHumanBodyPose3DObservationHeightEstimationReference`
2453        #[unsafe(method(bodyHeight))]
2454        #[unsafe(method_family = none)]
2455        pub unsafe fn bodyHeight(&self) -> c_float;
2456
2457        #[cfg(all(
2458            feature = "VNGeometry",
2459            feature = "VNHumanBodyRecognizedPoint3D",
2460            feature = "VNRecognizedPoint3D",
2461            feature = "VNTypes"
2462        ))]
2463        /// Obtains the collection of joints associated with a named human body joints group.
2464        ///
2465        /// The obtained collection is a dictionary that provides the mapping of human joint names to the recognized point.
2466        ///
2467        /// Parameter `jointsGroupName`: The name of the human body joints group.
2468        ///
2469        /// Parameter `error`: The address of a variable that will be populated with the error that describes the failure.  If the caller does not require this information, NULL can be passed.
2470        ///
2471        /// Returns: a dictionary of recognized points in the group, or nil if an error was encountered.
2472        #[unsafe(method(recognizedPointsForJointsGroupName:error:_))]
2473        #[unsafe(method_family = none)]
2474        pub unsafe fn recognizedPointsForJointsGroupName_error(
2475            &self,
2476            joints_group_name: &VNHumanBodyPose3DObservationJointsGroupName,
2477        ) -> Result<
2478            Retained<
2479                NSDictionary<VNHumanBodyPose3DObservationJointName, VNHumanBodyRecognizedPoint3D>,
2480            >,
2481            Retained<NSError>,
2482        >;
2483
2484        #[cfg(all(
2485            feature = "VNGeometry",
2486            feature = "VNHumanBodyRecognizedPoint3D",
2487            feature = "VNRecognizedPoint3D",
2488            feature = "VNTypes"
2489        ))]
2490        /// Obtain a specific point for a named human body joint.
2491        /// Each returned `VNHumanBodyRecognizedPoint3D` instance contains position relative to the model (`position`) and the parent joint (`localPosition`)
2492        /// Model position is relative to root joint (hip) for a named human body joint in meters .
2493        /// Local position is relative to parent joint for a named human body joint in meters.
2494        ///
2495        /// Parameter `jointName`: The name of the human body joint.
2496        ///
2497        /// Parameter `error`: The address of a variable that will be populated with the error that describes the failure.  If the caller does not require this information, NULL can be passed.
2498        ///
2499        /// Returns: The recognized point, or nil if the point could not be obtained.
2500        #[unsafe(method(recognizedPointForJointName:error:_))]
2501        #[unsafe(method_family = none)]
2502        pub unsafe fn recognizedPointForJointName_error(
2503            &self,
2504            joint_name: &VNHumanBodyPose3DObservationJointName,
2505        ) -> Result<Retained<VNHumanBodyRecognizedPoint3D>, Retained<NSError>>;
2506
2507        #[cfg(all(feature = "VNGeometry", feature = "VNTypes"))]
2508        /// Obtain 2D point relative to the input image for named human body joint
2509        ///
2510        /// Parameter `jointName`: The name of the human body joint
2511        ///
2512        /// Returns: A projection of the determined 3D position onto the original 2D image in normalized, lower left origin coordinates
2513        #[unsafe(method(pointInImageForJointName:error:_))]
2514        #[unsafe(method_family = none)]
2515        pub unsafe fn pointInImageForJointName_error(
2516            &self,
2517            joint_name: &VNHumanBodyPose3DObservationJointName,
2518        ) -> Result<Retained<VNPoint>, Retained<NSError>>;
2519
2520        #[cfg(feature = "VNTypes")]
2521        /// Obtain the parent joint of a specified joint
2522        ///
2523        /// Parameter `jointName`: The name of the human body joint
2524        ///
2525        /// Returns: The name of the parent joint
2526        #[unsafe(method(parentJointNameForJointName:))]
2527        #[unsafe(method_family = none)]
2528        pub unsafe fn parentJointNameForJointName(
2529            &self,
2530            joint_name: &VNHumanBodyPose3DObservationJointName,
2531        ) -> Option<Retained<VNHumanBodyPose3DObservationJointName>>;
2532    );
2533}
2534
2535/// Methods declared on superclass `VNRecognizedPoints3DObservation`.
2536impl VNHumanBodyPose3DObservation {
2537    extern_methods!(
2538        #[unsafe(method(new))]
2539        #[unsafe(method_family = new)]
2540        pub unsafe fn new() -> Retained<Self>;
2541
2542        #[unsafe(method(init))]
2543        #[unsafe(method_family = init)]
2544        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
2545    );
2546}
2547
2548extern_class!(
2549    /// VNImageAestheticsScoresObservation provides an overall score of aesthetic attributes for an image.
2550    ///
2551    /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vnimageaestheticsscoresobservation?language=objc)
2552    #[unsafe(super(VNObservation, NSObject))]
2553    #[derive(Debug, PartialEq, Eq, Hash)]
2554    pub struct VNImageAestheticsScoresObservation;
2555);
2556
2557extern_conformance!(
2558    unsafe impl NSCoding for VNImageAestheticsScoresObservation {}
2559);
2560
2561extern_conformance!(
2562    unsafe impl NSCopying for VNImageAestheticsScoresObservation {}
2563);
2564
2565unsafe impl CopyingHelper for VNImageAestheticsScoresObservation {
2566    type Result = Self;
2567}
2568
2569extern_conformance!(
2570    unsafe impl NSObjectProtocol for VNImageAestheticsScoresObservation {}
2571);
2572
2573extern_conformance!(
2574    unsafe impl NSSecureCoding for VNImageAestheticsScoresObservation {}
2575);
2576
2577#[cfg(feature = "VNRequestRevisionProviding")]
2578extern_conformance!(
2579    unsafe impl VNRequestRevisionProviding for VNImageAestheticsScoresObservation {}
2580);
2581
2582impl VNImageAestheticsScoresObservation {
2583    extern_methods!(
2584        #[unsafe(method(init))]
2585        #[unsafe(method_family = init)]
2586        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
2587
2588        /// A Boolean value that represents images that are not necessarily of poor image quality, but may not have memorable or exciting content.
2589        #[unsafe(method(isUtility))]
2590        #[unsafe(method_family = none)]
2591        pub unsafe fn isUtility(&self) -> bool;
2592
2593        /// A score which incorporates aesthetic score, failure score, and utility labels.
2594        ///
2595        /// This returns a value within the range of `-1` and `1`, where `-1` is least desirable and `1` is most desirable.
2596        #[unsafe(method(overallScore))]
2597        #[unsafe(method_family = none)]
2598        pub unsafe fn overallScore(&self) -> c_float;
2599    );
2600}
2601
2602/// Methods declared on superclass `NSObject`.
2603impl VNImageAestheticsScoresObservation {
2604    extern_methods!(
2605        #[unsafe(method(new))]
2606        #[unsafe(method_family = new)]
2607        pub unsafe fn new() -> Retained<Self>;
2608    );
2609}