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