objc2-av-foundation 0.3.2

Bindings to the AVFoundation framework
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
#[cfg(feature = "objc2-core-image")]
#[cfg(not(target_os = "watchos"))]
use objc2_core_image::*;
#[cfg(feature = "objc2-core-media")]
use objc2_core_media::*;
use objc2_foundation::*;

use crate::*;

/// AVMetadataObjectType string constants
///
///
/// Constants indicating the type of an AVMetadataObject.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadataobjecttype?language=objc)
// NS_TYPED_ENUM
pub type AVMetadataObjectType = NSString;

extern_class!(
    /// AVMetadataObject is an abstract class that defines an interface for a metadata object used by AVFoundation.
    ///
    ///
    /// AVMetadataObject provides an abstract interface for metadata associated with a piece of media. One example is face metadata that might be detected in a picture. All metadata objects have a time, duration, bounds, and type.
    ///
    /// The concrete AVMetadataFaceObject is used by AVCaptureMetadataOutput for face detection.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadataobject?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct AVMetadataObject;
);

extern_conformance!(
    unsafe impl NSObjectProtocol for AVMetadataObject {}
);

impl AVMetadataObject {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;

        #[cfg(feature = "objc2-core-media")]
        /// The media time associated with this metadata object.
        ///
        ///
        /// The value of this property is a CMTime associated with the metadata object. For capture, it is the time at which this object was captured. If this metadata object originates from a CMSampleBuffer, its time matches the sample buffer's presentation time. This property may return kCMTimeInvalid.
        #[unsafe(method(time))]
        #[unsafe(method_family = none)]
        pub unsafe fn time(&self) -> CMTime;

        #[cfg(feature = "objc2-core-media")]
        /// The media duration associated with this metadata object.
        ///
        ///
        /// The value of this property is a CMTime representing the duration of the metadata object. If this metadata object originates from a CMSampleBuffer, its duration matches the sample buffer's duration. This property may return kCMTimeInvalid.
        #[unsafe(method(duration))]
        #[unsafe(method_family = none)]
        pub unsafe fn duration(&self) -> CMTime;

        #[cfg(feature = "objc2-core-foundation")]
        /// The bounding rectangle of the receiver.
        ///
        ///
        /// The value of this property is a CGRect representing the bounding rectangle of the object with respect to the picture in which it resides. The rectangle's origin is top left. If the metadata originates from video, bounds may be expressed as scalar values from 0. - 1. If the original video has been scaled down, the bounds of the metadata object still are meaningful. This property may return CGRectZero if the metadata has no bounds.
        #[unsafe(method(bounds))]
        #[unsafe(method_family = none)]
        pub unsafe fn bounds(&self) -> CGRect;

        /// An identifier for the metadata object.
        ///
        ///
        /// The value of this property is an AVMetadataObjectType representing the type of the metadata object. Clients inspecting a collection of metadata objects can use this property to filter objects with a matching type.
        #[unsafe(method(type))]
        #[unsafe(method_family = none)]
        pub unsafe fn r#type(&self) -> Retained<AVMetadataObjectType>;

        /// An identifier associated with a metadata object used to group it with other metadata objects belonging to a common parent.
        ///
        /// When presented with a collection of ``AVMetadataObject`` instances of different types, you may use the objects' ``groupID`` to combine them into groups. For example, a human body and face belonging to the same person have the same ``groupID``.  If an object's ``groupID`` property is set to -1, it is invalid. When set to a value of >=0, it is unique across all object groups.
        #[unsafe(method(groupID))]
        #[unsafe(method_family = none)]
        pub unsafe fn groupID(&self) -> NSInteger;

        /// A unique identifier for each detected object type (face, body, hands, heads and salient objects) in a collection.
        ///
        /// Defaults to a value of -1 when invalid or not available. When used in conjunction with an ``AVCaptureMetadataOutput``, each newly detected object that enters the scene is assigned a unique identifier. ``objectID``s are never re-used as objects leave the picture and new ones enter. Objects that leave the picture and then re-enter are assigned a new ``objectID``.
        #[unsafe(method(objectID))]
        #[unsafe(method_family = none)]
        pub unsafe fn objectID(&self) -> NSInteger;
    );
}

/// AVMetadataObjectCinematicVideoSupport.
impl AVMetadataObject {
    extern_methods!(
        #[cfg(feature = "AVCaptureDevice")]
        /// The current focus mode when an object is detected during a Cinematic Video recording.
        ///
        /// Default is ``AVCaptureCinematicVideoFocusMode/AVCaptureCinematicVideoFocusModeNone``.
        #[unsafe(method(cinematicVideoFocusMode))]
        #[unsafe(method_family = none)]
        pub unsafe fn cinematicVideoFocusMode(&self) -> AVCaptureCinematicVideoFocusMode;

        /// A BOOL indicating whether this metadata object represents a fixed focus.
        #[unsafe(method(isFixedFocus))]
        #[unsafe(method_family = none)]
        pub unsafe fn isFixedFocus(&self) -> bool;
    );
}

extern_class!(
    /// AVMetadataBodyObject is an abstract class that defines an interface for a body metadata object used by AVFoundation.
    ///
    ///
    /// AVMetadataBodyObject represents a single detected body in a picture. It is the base object used to represent bodies, for example AVMetadataHumanBodyObject, AVMetadataCatBodyObject, AVMetadataDogBodyObject.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadatabodyobject?language=objc)
    #[unsafe(super(AVMetadataObject, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct AVMetadataBodyObject;
);

extern_conformance!(
    unsafe impl NSCopying for AVMetadataBodyObject {}
);

unsafe impl CopyingHelper for AVMetadataBodyObject {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for AVMetadataBodyObject {}
);

impl AVMetadataBodyObject {
    extern_methods!(
        /// A unique number associated with the receiver.
        ///
        ///
        /// The value of this property is an NSInteger indicating the unique identifier of this body type (Human, Dog, Cat) in the picture. When a new body enters the picture, it is assigned a new unique identifier. bodyIDs are not re-used as bodies leave the picture and new ones enter. Bodies that leave the picture then re-enter are assigned a new bodyID.
        #[unsafe(method(bodyID))]
        #[unsafe(method_family = none)]
        pub unsafe fn bodyID(&self) -> NSInteger;
    );
}

/// Methods declared on superclass `AVMetadataObject`.
impl AVMetadataBodyObject {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}

extern "C" {
    /// An identifier for an instance of AVMetadataHumanBodyObject.
    ///
    ///
    /// AVMetadataHumanBodyObject objects return this constant as their type.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadataobjecttypehumanbody?language=objc)
    pub static AVMetadataObjectTypeHumanBody: &'static AVMetadataObjectType;
}

extern_class!(
    /// AVMetadataHumanBodyObject is a concrete subclass of AVMetadataBodyObject defining a detected human body.
    ///
    ///
    /// AVMetadataHumanBodyObject represents a single detected human body in a picture. It is an immutable object describing the various features found in the body.
    ///
    /// On supported platforms, AVCaptureMetadataOutput outputs arrays of detected human body objects. See AVCaptureOutput.h.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadatahumanbodyobject?language=objc)
    #[unsafe(super(AVMetadataBodyObject, AVMetadataObject, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct AVMetadataHumanBodyObject;
);

extern_conformance!(
    unsafe impl NSCopying for AVMetadataHumanBodyObject {}
);

unsafe impl CopyingHelper for AVMetadataHumanBodyObject {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for AVMetadataHumanBodyObject {}
);

impl AVMetadataHumanBodyObject {
    extern_methods!();
}

/// Methods declared on superclass `AVMetadataObject`.
impl AVMetadataHumanBodyObject {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}

extern "C" {
    /// An identifier for an instance of AVMetadataHumanFullBodyObject.
    ///
    ///
    /// AVMetadataHumanFullBodyObject objects return this constant as their type.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadataobjecttypehumanfullbody?language=objc)
    pub static AVMetadataObjectTypeHumanFullBody: &'static AVMetadataObjectType;
}

extern_class!(
    /// AVMetadataHumanFullBodyObject is a concrete subclass of AVMetadataBodyObject defining a detected human full body.
    ///
    ///
    /// AVMetadataHumanFullBodyObject represents a single detected human full body in a picture. It is an immutable object describing the various features found in the body.
    ///
    /// On supported platforms, AVCaptureMetadataOutput outputs arrays of detected human full body objects. See AVCaptureOutput.h.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadatahumanfullbodyobject?language=objc)
    #[unsafe(super(AVMetadataBodyObject, AVMetadataObject, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct AVMetadataHumanFullBodyObject;
);

extern_conformance!(
    unsafe impl NSCopying for AVMetadataHumanFullBodyObject {}
);

unsafe impl CopyingHelper for AVMetadataHumanFullBodyObject {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for AVMetadataHumanFullBodyObject {}
);

impl AVMetadataHumanFullBodyObject {
    extern_methods!();
}

/// Methods declared on superclass `AVMetadataObject`.
impl AVMetadataHumanFullBodyObject {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}

extern "C" {
    /// An identifier for an instance of a cat head object.
    ///
    /// ``AVMetadataCatHeadObject`` objects return this constant as their type.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadataobjecttypecathead?language=objc)
    pub static AVMetadataObjectTypeCatHead: &'static AVMetadataObjectType;
}

extern_class!(
    /// A concrete metadata object subclass representing a cat head.
    ///
    /// ``AVMetadataCatHeadObject`` is a concrete subclass of ``AVMetadataObject`` representing a cat head.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadatacatheadobject?language=objc)
    #[unsafe(super(AVMetadataObject, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct AVMetadataCatHeadObject;
);

extern_conformance!(
    unsafe impl NSCopying for AVMetadataCatHeadObject {}
);

unsafe impl CopyingHelper for AVMetadataCatHeadObject {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for AVMetadataCatHeadObject {}
);

impl AVMetadataCatHeadObject {
    extern_methods!();
}

/// Methods declared on superclass `AVMetadataObject`.
impl AVMetadataCatHeadObject {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}

extern "C" {
    /// An identifier for an instance of AVMetadataCatBodyObject.
    ///
    ///
    /// AVMetadataCatBodyObject objects return this constant as their type.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadataobjecttypecatbody?language=objc)
    pub static AVMetadataObjectTypeCatBody: &'static AVMetadataObjectType;
}

extern_class!(
    /// AVMetadataCatBodyObject is a concrete subclass of AVMetadataBodyObject defining a detected cat body.
    ///
    ///
    /// AVMetadataCatBodyObject represents a single detected cat body in a picture. It is an immutable object describing the various features found in the body.
    ///
    /// On supported platforms, AVCaptureMetadataOutput outputs arrays of detected cat body objects. See AVCaptureOutput.h.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadatacatbodyobject?language=objc)
    #[unsafe(super(AVMetadataBodyObject, AVMetadataObject, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct AVMetadataCatBodyObject;
);

extern_conformance!(
    unsafe impl NSCopying for AVMetadataCatBodyObject {}
);

unsafe impl CopyingHelper for AVMetadataCatBodyObject {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for AVMetadataCatBodyObject {}
);

impl AVMetadataCatBodyObject {
    extern_methods!();
}

/// Methods declared on superclass `AVMetadataObject`.
impl AVMetadataCatBodyObject {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}

extern "C" {
    /// An identifier for an instance of a dog head object.
    ///
    /// ``AVMetadataDogHeadObject`` objects return this constant as their type.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadataobjecttypedoghead?language=objc)
    pub static AVMetadataObjectTypeDogHead: &'static AVMetadataObjectType;
}

extern_class!(
    /// A concrete metadata object subclass representing a dog head.
    ///
    /// ``AVMetadataDogHeadObject`` is a concrete subclass of ``AVMetadataObject`` representing a dog head.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadatadogheadobject?language=objc)
    #[unsafe(super(AVMetadataObject, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct AVMetadataDogHeadObject;
);

extern_conformance!(
    unsafe impl NSCopying for AVMetadataDogHeadObject {}
);

unsafe impl CopyingHelper for AVMetadataDogHeadObject {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for AVMetadataDogHeadObject {}
);

impl AVMetadataDogHeadObject {
    extern_methods!();
}

/// Methods declared on superclass `AVMetadataObject`.
impl AVMetadataDogHeadObject {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}

extern "C" {
    /// An identifier for an instance of AVMetadataDogBodyObject.
    ///
    ///
    /// AVMetadataDogBodyObject objects return this constant as their type.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadataobjecttypedogbody?language=objc)
    pub static AVMetadataObjectTypeDogBody: &'static AVMetadataObjectType;
}

extern_class!(
    /// AVMetadataDogBodyObject is a concrete subclass of AVMetadataBodyObject defining a detected dog body.
    ///
    ///
    /// AVMetadataDogBodyObject represents a single detected dog body in a picture. It is an immutable object describing the various features found in the body.
    ///
    /// On supported platforms, AVCaptureMetadataOutput outputs arrays of detected dog body objects. See AVCaptureOutput.h.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadatadogbodyobject?language=objc)
    #[unsafe(super(AVMetadataBodyObject, AVMetadataObject, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct AVMetadataDogBodyObject;
);

extern_conformance!(
    unsafe impl NSCopying for AVMetadataDogBodyObject {}
);

unsafe impl CopyingHelper for AVMetadataDogBodyObject {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for AVMetadataDogBodyObject {}
);

impl AVMetadataDogBodyObject {
    extern_methods!();
}

/// Methods declared on superclass `AVMetadataObject`.
impl AVMetadataDogBodyObject {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}

extern "C" {
    /// An identifier for an instance of AVMetadataSalientObject.
    ///
    ///
    /// AVMetadataSalientObject objects return this constant as their type.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadataobjecttypesalientobject?language=objc)
    pub static AVMetadataObjectTypeSalientObject: &'static AVMetadataObjectType;
}

extern_class!(
    /// AVMetadataSalientObject is a concrete subclass of AVMetadataObject defining the features of a salient object.
    ///
    ///
    /// AVMetadataSalientObject represents a single detected salient area in a picture. It is an immutable object describing the salient object.
    ///
    /// On supported platforms, AVCaptureMetadataOutput outputs arrays of detected salient objects. See AVCaptureOutput.h.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadatasalientobject?language=objc)
    #[unsafe(super(AVMetadataObject, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct AVMetadataSalientObject;
);

extern_conformance!(
    unsafe impl NSCopying for AVMetadataSalientObject {}
);

unsafe impl CopyingHelper for AVMetadataSalientObject {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for AVMetadataSalientObject {}
);

impl AVMetadataSalientObject {
    extern_methods!(
        /// A unique number associated with the receiver.
        ///
        ///
        /// The value of this property is an NSInteger indicating the unique identifier of this object in the picture. When a new object enters the picture, it is assigned a new unique identifier. objectIDs are not re-used as object leave the picture and new ones enter. Objects that leave the picture then re-enter are assigned a new objectID.
        #[unsafe(method(objectID))]
        #[unsafe(method_family = none)]
        pub unsafe fn objectID(&self) -> NSInteger;
    );
}

/// Methods declared on superclass `AVMetadataObject`.
impl AVMetadataSalientObject {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}

extern "C" {
    /// An identifier for an instance of AVMetadataFaceObject.
    ///
    ///
    /// AVMetadataFaceObject objects return this constant as their type.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadataobjecttypeface?language=objc)
    pub static AVMetadataObjectTypeFace: &'static AVMetadataObjectType;
}

extern_class!(
    /// AVMetadataFaceObject is a concrete subclass of AVMetadataObject defining the features of a detected face.
    ///
    ///
    /// AVMetadataFaceObject represents a single detected face in a picture. It is an immutable object describing the various features found in the face.
    ///
    /// On supported platforms, AVCaptureMetadataOutput outputs arrays of detected face objects. See AVCaptureOutput.h.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadatafaceobject?language=objc)
    #[unsafe(super(AVMetadataObject, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct AVMetadataFaceObject;
);

extern_conformance!(
    unsafe impl NSCopying for AVMetadataFaceObject {}
);

unsafe impl CopyingHelper for AVMetadataFaceObject {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for AVMetadataFaceObject {}
);

impl AVMetadataFaceObject {
    extern_methods!(
        /// A unique number associated with the receiver.
        ///
        ///
        /// The value of this property is an NSInteger indicating the unique identifier of this face in the picture. When a new face enters the picture, it is assigned a new unique identifier. faceIDs are not re-used as faces leave the picture and new ones enter. Faces that leave the picture then re-enter are assigned a new faceID.
        #[unsafe(method(faceID))]
        #[unsafe(method_family = none)]
        pub unsafe fn faceID(&self) -> NSInteger;

        /// A BOOL indicating whether the rollAngle property is valid for this receiver.
        #[unsafe(method(hasRollAngle))]
        #[unsafe(method_family = none)]
        pub unsafe fn hasRollAngle(&self) -> bool;

        #[cfg(feature = "objc2-core-foundation")]
        /// The roll angle of the face in degrees.
        ///
        ///
        /// The value of this property is a CGFloat indicating the face's angle of roll (or tilt) in degrees. A value of 0.0 indicates that the face is level in the picture. If -hasRollAngle returns NO, then reading this property throws an NSGenericException.
        #[unsafe(method(rollAngle))]
        #[unsafe(method_family = none)]
        pub unsafe fn rollAngle(&self) -> CGFloat;

        /// A BOOL indicating whether the yawAngle property is valid for this receiver.
        #[unsafe(method(hasYawAngle))]
        #[unsafe(method_family = none)]
        pub unsafe fn hasYawAngle(&self) -> bool;

        #[cfg(feature = "objc2-core-foundation")]
        /// The yaw angle of the face in degrees.
        ///
        ///
        /// The value of this property is a CGFloat indicating the face's angle of yaw (or turn) in degrees. A value of 0.0 indicates that the face is straight on in the picture. If -hasYawAngle returns NO, then reading this property throws an NSGenericException.
        #[unsafe(method(yawAngle))]
        #[unsafe(method_family = none)]
        pub unsafe fn yawAngle(&self) -> CGFloat;
    );
}

/// Methods declared on superclass `AVMetadataObject`.
impl AVMetadataFaceObject {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}

extern "C" {
    /// An identifier for an instance of AVMetadataMachineReadableCodeObject having a type AVMetadataObjectTypeUPCECode.
    ///
    ///
    /// AVMetadataMachineReadableCodeObject objects generated from UPC-E codes return this constant as their type.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadataobjecttypeupcecode?language=objc)
    pub static AVMetadataObjectTypeUPCECode: &'static AVMetadataObjectType;
}

extern "C" {
    /// An identifier for an instance of AVMetadataMachineReadableCodeObject having a type AVMetadataObjectTypeCode39Code.
    ///
    ///
    /// AVMetadataMachineReadableCodeObject objects generated from Code 39 codes return this constant as their type.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadataobjecttypecode39code?language=objc)
    pub static AVMetadataObjectTypeCode39Code: &'static AVMetadataObjectType;
}

extern "C" {
    /// An identifier for an instance of AVMetadataMachineReadableCodeObject having a type AVMetadataObjectTypeCode39Mod43Code.
    ///
    ///
    /// AVMetadataMachineReadableCodeObject objects generated from Code 39 mod 43 codes return this constant as their type.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadataobjecttypecode39mod43code?language=objc)
    pub static AVMetadataObjectTypeCode39Mod43Code: &'static AVMetadataObjectType;
}

extern "C" {
    /// An identifier for an instance of AVMetadataMachineReadableCodeObject having a type AVMetadataObjectTypeEAN13Code.
    ///
    ///
    /// AVMetadataMachineReadableCodeObject objects generated from EAN-13 (including UPC-A) codes return this constant as their type.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadataobjecttypeean13code?language=objc)
    pub static AVMetadataObjectTypeEAN13Code: &'static AVMetadataObjectType;
}

extern "C" {
    /// An identifier for an instance of AVMetadataMachineReadableCodeObject having a type AVMetadataObjectTypeEAN8Code.
    ///
    ///
    /// AVMetadataMachineReadableCodeObject objects generated from EAN-8 codes return this constant as their type.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadataobjecttypeean8code?language=objc)
    pub static AVMetadataObjectTypeEAN8Code: &'static AVMetadataObjectType;
}

extern "C" {
    /// An identifier for an instance of AVMetadataMachineReadableCodeObject having a type AVMetadataObjectTypeCode93Code.
    ///
    ///
    /// AVMetadataMachineReadableCodeObject objects generated from Code 93 codes return this constant as their type.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadataobjecttypecode93code?language=objc)
    pub static AVMetadataObjectTypeCode93Code: &'static AVMetadataObjectType;
}

extern "C" {
    /// An identifier for an instance of AVMetadataMachineReadableCodeObject having a type AVMetadataObjectTypeCode128Code.
    ///
    ///
    /// AVMetadataMachineReadableCodeObject objects generated from Code 128 codes return this constant as their type.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadataobjecttypecode128code?language=objc)
    pub static AVMetadataObjectTypeCode128Code: &'static AVMetadataObjectType;
}

extern "C" {
    /// An identifier for an instance of AVMetadataMachineReadableCodeObject having a type AVMetadataObjectTypePDF417Code.
    ///
    ///
    /// AVMetadataMachineReadableCodeObject objects generated from PDF417 codes return this constant as their type.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadataobjecttypepdf417code?language=objc)
    pub static AVMetadataObjectTypePDF417Code: &'static AVMetadataObjectType;
}

extern "C" {
    /// An identifier for an instance of AVMetadataMachineReadableCodeObject having a type AVMetadataObjectTypeQRCode.
    ///
    ///
    /// AVMetadataMachineReadableCodeObject objects generated from QR codes return this constant as their type.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadataobjecttypeqrcode?language=objc)
    pub static AVMetadataObjectTypeQRCode: &'static AVMetadataObjectType;
}

extern "C" {
    /// An identifier for an instance of AVMetadataMachineReadableCodeObject having a type AVMetadataObjectTypeAztecCode.
    ///
    ///
    /// AVMetadataMachineReadableCodeObject objects generated from Aztec codes return this constant as their type.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadataobjecttypeazteccode?language=objc)
    pub static AVMetadataObjectTypeAztecCode: &'static AVMetadataObjectType;
}

extern "C" {
    /// An identifier for an instance of AVMetadataMachineReadableCodeObject having a type AVMetadataObjectTypeInterleaved2of5Code.
    ///
    ///
    /// AVMetadataMachineReadableCodeObject objects generated from Interleaved 2 of 5 codes return this constant as their type.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadataobjecttypeinterleaved2of5code?language=objc)
    pub static AVMetadataObjectTypeInterleaved2of5Code: &'static AVMetadataObjectType;
}

extern "C" {
    /// An identifier for an instance of AVMetadataMachineReadableCodeObject having a type AVMetadataObjectTypeITF14Code.
    ///
    ///
    /// AVMetadataMachineReadableCodeObject objects generated from ITF14 codes return this constant as their type.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadataobjecttypeitf14code?language=objc)
    pub static AVMetadataObjectTypeITF14Code: &'static AVMetadataObjectType;
}

extern "C" {
    /// An identifier for an instance of AVMetadataMachineReadableCodeObject having a type AVMetadataObjectTypeDataMatrixCode.
    ///
    ///
    /// AVMetadataMachineReadableCodeObject objects generated from DataMatrix codes return this constant as their type.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadataobjecttypedatamatrixcode?language=objc)
    pub static AVMetadataObjectTypeDataMatrixCode: &'static AVMetadataObjectType;
}

extern "C" {
    /// An identifier for an instance of AVMetadataMachineReadableCodeObject having a type AVMetadataObjectTypeCodabarCode.
    ///
    ///
    /// AVMetadataMachineReadableCodeObject objects generated from Codabar codes return this constant as their type.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadataobjecttypecodabarcode?language=objc)
    pub static AVMetadataObjectTypeCodabarCode: &'static AVMetadataObjectType;
}

extern "C" {
    /// An identifier for an instance of AVMetadataMachineReadableCodeObject having a type AVMetadataObjectTypeGS1DataBarCode.
    ///
    ///
    /// AVMetadataMachineReadableCodeObject objects generated from GS1DataBar codes return this constant as their type.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadataobjecttypegs1databarcode?language=objc)
    pub static AVMetadataObjectTypeGS1DataBarCode: &'static AVMetadataObjectType;
}

extern "C" {
    /// An identifier for an instance of AVMetadataMachineReadableCodeObject having a type AVMetadataObjectTypeGS1DataBarExpandedCode.
    ///
    ///
    /// AVMetadataMachineReadableCodeObject objects generated from GS1DataBarExpanded codes return this constant as their type.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadataobjecttypegs1databarexpandedcode?language=objc)
    pub static AVMetadataObjectTypeGS1DataBarExpandedCode: &'static AVMetadataObjectType;
}

extern "C" {
    /// An identifier for an instance of AVMetadataMachineReadableCodeObject having a type AVMetadataObjectTypeGS1DataBarLimitedCode.
    ///
    ///
    /// AVMetadataMachineReadableCodeObject objects generated from GS1DataBarLimited codes return this constant as their type.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadataobjecttypegs1databarlimitedcode?language=objc)
    pub static AVMetadataObjectTypeGS1DataBarLimitedCode: &'static AVMetadataObjectType;
}

extern "C" {
    /// An identifier for an instance of AVMetadataMachineReadableCodeObject having a type AVMetadataObjectTypeMicroQRCode.
    ///
    ///
    /// AVMetadataMachineReadableCodeObject objects generated from MicroQR codes return this constant as their type.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadataobjecttypemicroqrcode?language=objc)
    pub static AVMetadataObjectTypeMicroQRCode: &'static AVMetadataObjectType;
}

extern "C" {
    /// An identifier for an instance of AVMetadataMachineReadableCodeObject having a type AVMetadataObjectTypeMicroPDF417Code.
    ///
    ///
    /// AVMetadataMachineReadableCodeObject objects generated from MicroPDF417 codes return this constant as their type.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadataobjecttypemicropdf417code?language=objc)
    pub static AVMetadataObjectTypeMicroPDF417Code: &'static AVMetadataObjectType;
}

extern_class!(
    /// AVMetadataMachineReadableCodeObject is a concrete subclass of AVMetadataObject defining the features of a detected one-dimensional or two-dimensional barcode.
    ///
    ///
    /// AVMetadataMachineReadableCodeObject represents a single detected machine readable code in a picture. It is an immutable object describing the features and payload of a barcode.
    ///
    /// On supported platforms, AVCaptureMetadataOutput outputs arrays of detected machine readable code objects. See AVCaptureMetadataOutput.h.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadatamachinereadablecodeobject?language=objc)
    #[unsafe(super(AVMetadataObject, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct AVMetadataMachineReadableCodeObject;
);

extern_conformance!(
    unsafe impl NSObjectProtocol for AVMetadataMachineReadableCodeObject {}
);

impl AVMetadataMachineReadableCodeObject {
    extern_methods!(
        /// The points defining the (X,Y) locations of the corners of the machine-readable code.
        ///
        ///
        /// The value of this property is an NSArray of NSDictionaries, each of which has been created from a CGPoint using CGPointCreateDictionaryRepresentation(), representing the coordinates of the corners of the object with respect to the image in which it resides. If the metadata originates from video, the points may be expressed as scalar values from 0. - 1. The points in the corners differ from the bounds rectangle in that bounds is axis-aligned to orientation of the captured image, and the values of the corners reside within the bounds rectangle. The points are arranged in counter-clockwise order (clockwise if the code or image is mirrored), starting with the top-left of the code in its canonical orientation.
        #[unsafe(method(corners))]
        #[unsafe(method_family = none)]
        pub unsafe fn corners(&self) -> Retained<NSArray<NSDictionary>>;

        /// Returns the receiver's errorCorrectedData decoded into a human-readable string.
        ///
        ///
        /// The value of this property is an NSString created by decoding the binary payload according to the format of the machine readable code. Returns nil if a string representation cannot be created from the payload.
        #[unsafe(method(stringValue))]
        #[unsafe(method_family = none)]
        pub unsafe fn stringValue(&self) -> Option<Retained<NSString>>;
    );
}

/// Methods declared on superclass `AVMetadataObject`.
impl AVMetadataMachineReadableCodeObject {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}

/// AVMetadataMachineReadableCodeDescriptor.
impl AVMetadataMachineReadableCodeObject {
    extern_methods!(
        #[cfg(feature = "objc2-core-image")]
        #[cfg(not(target_os = "watchos"))]
        /// An abstract representation of a machine readable code's symbol attributes.
        ///
        ///
        /// The value may be nil if an abstract representation of a machine readable code object is not defined for the code type or could not be detected.
        #[unsafe(method(descriptor))]
        #[unsafe(method_family = none)]
        pub unsafe fn descriptor(&self) -> Option<Retained<CIBarcodeDescriptor>>;
    );
}