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