objc2_av_foundation/generated/AVMetadataObject.rs
1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5#[cfg(feature = "objc2-core-foundation")]
6use objc2_core_foundation::*;
7#[cfg(feature = "objc2-core-image")]
8#[cfg(not(target_os = "watchos"))]
9use objc2_core_image::*;
10#[cfg(feature = "objc2-core-media")]
11use objc2_core_media::*;
12use objc2_foundation::*;
13
14use crate::*;
15
16/// AVMetadataObjectType string constants
17///
18///
19/// Constants indicating the type of an AVMetadataObject.
20///
21/// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadataobjecttype?language=objc)
22// NS_TYPED_ENUM
23pub type AVMetadataObjectType = NSString;
24
25extern_class!(
26 /// AVMetadataObject is an abstract class that defines an interface for a metadata object used by AVFoundation.
27 ///
28 ///
29 /// 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.
30 ///
31 /// The concrete AVMetadataFaceObject is used by AVCaptureMetadataOutput for face detection.
32 ///
33 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadataobject?language=objc)
34 #[unsafe(super(NSObject))]
35 #[derive(Debug, PartialEq, Eq, Hash)]
36 pub struct AVMetadataObject;
37);
38
39extern_conformance!(
40 unsafe impl NSObjectProtocol for AVMetadataObject {}
41);
42
43impl AVMetadataObject {
44 extern_methods!(
45 #[unsafe(method(init))]
46 #[unsafe(method_family = init)]
47 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
48
49 #[unsafe(method(new))]
50 #[unsafe(method_family = new)]
51 pub unsafe fn new() -> Retained<Self>;
52
53 #[cfg(feature = "objc2-core-media")]
54 /// The media time associated with this metadata object.
55 ///
56 ///
57 /// 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.
58 #[unsafe(method(time))]
59 #[unsafe(method_family = none)]
60 pub unsafe fn time(&self) -> CMTime;
61
62 #[cfg(feature = "objc2-core-media")]
63 /// The media duration associated with this metadata object.
64 ///
65 ///
66 /// 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.
67 #[unsafe(method(duration))]
68 #[unsafe(method_family = none)]
69 pub unsafe fn duration(&self) -> CMTime;
70
71 #[cfg(feature = "objc2-core-foundation")]
72 /// The bounding rectangle of the receiver.
73 ///
74 ///
75 /// 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.
76 #[unsafe(method(bounds))]
77 #[unsafe(method_family = none)]
78 pub unsafe fn bounds(&self) -> CGRect;
79
80 /// An identifier for the metadata object.
81 ///
82 ///
83 /// 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.
84 #[unsafe(method(type))]
85 #[unsafe(method_family = none)]
86 pub unsafe fn r#type(&self) -> Retained<AVMetadataObjectType>;
87 );
88}
89
90extern_class!(
91 /// AVMetadataBodyObject is an abstract class that defines an interface for a body metadata object used by AVFoundation.
92 ///
93 ///
94 /// AVMetadataBodyObject represents a single detected body in a picture. It is the base object used to represent bodies, for example AVMetadataHumanBodyObject, AVMetadataCatBodyObject, AVMetadataDogBodyObject.
95 ///
96 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadatabodyobject?language=objc)
97 #[unsafe(super(AVMetadataObject, NSObject))]
98 #[derive(Debug, PartialEq, Eq, Hash)]
99 pub struct AVMetadataBodyObject;
100);
101
102extern_conformance!(
103 unsafe impl NSCopying for AVMetadataBodyObject {}
104);
105
106unsafe impl CopyingHelper for AVMetadataBodyObject {
107 type Result = Self;
108}
109
110extern_conformance!(
111 unsafe impl NSObjectProtocol for AVMetadataBodyObject {}
112);
113
114impl AVMetadataBodyObject {
115 extern_methods!(
116 /// A unique number associated with the receiver.
117 ///
118 ///
119 /// 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.
120 #[unsafe(method(bodyID))]
121 #[unsafe(method_family = none)]
122 pub unsafe fn bodyID(&self) -> NSInteger;
123 );
124}
125
126/// Methods declared on superclass `AVMetadataObject`.
127impl AVMetadataBodyObject {
128 extern_methods!(
129 #[unsafe(method(init))]
130 #[unsafe(method_family = init)]
131 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
132
133 #[unsafe(method(new))]
134 #[unsafe(method_family = new)]
135 pub unsafe fn new() -> Retained<Self>;
136 );
137}
138
139extern "C" {
140 /// An identifier for an instance of AVMetadataHumanBodyObject.
141 ///
142 ///
143 /// AVMetadataHumanBodyObject objects return this constant as their type.
144 ///
145 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadataobjecttypehumanbody?language=objc)
146 pub static AVMetadataObjectTypeHumanBody: &'static AVMetadataObjectType;
147}
148
149extern_class!(
150 /// AVMetadataHumanBodyObject is a concrete subclass of AVMetadataBodyObject defining a detected human body.
151 ///
152 ///
153 /// AVMetadataHumanBodyObject represents a single detected human body in a picture. It is an immutable object describing the various features found in the body.
154 ///
155 /// On supported platforms, AVCaptureMetadataOutput outputs arrays of detected human body objects. See AVCaptureOutput.h.
156 ///
157 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadatahumanbodyobject?language=objc)
158 #[unsafe(super(AVMetadataBodyObject, AVMetadataObject, NSObject))]
159 #[derive(Debug, PartialEq, Eq, Hash)]
160 pub struct AVMetadataHumanBodyObject;
161);
162
163extern_conformance!(
164 unsafe impl NSCopying for AVMetadataHumanBodyObject {}
165);
166
167unsafe impl CopyingHelper for AVMetadataHumanBodyObject {
168 type Result = Self;
169}
170
171extern_conformance!(
172 unsafe impl NSObjectProtocol for AVMetadataHumanBodyObject {}
173);
174
175impl AVMetadataHumanBodyObject {
176 extern_methods!();
177}
178
179/// Methods declared on superclass `AVMetadataObject`.
180impl AVMetadataHumanBodyObject {
181 extern_methods!(
182 #[unsafe(method(init))]
183 #[unsafe(method_family = init)]
184 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
185
186 #[unsafe(method(new))]
187 #[unsafe(method_family = new)]
188 pub unsafe fn new() -> Retained<Self>;
189 );
190}
191
192extern "C" {
193 /// An identifier for an instance of AVMetadataHumanFullBodyObject.
194 ///
195 ///
196 /// AVMetadataHumanFullBodyObject objects return this constant as their type.
197 ///
198 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadataobjecttypehumanfullbody?language=objc)
199 pub static AVMetadataObjectTypeHumanFullBody: &'static AVMetadataObjectType;
200}
201
202extern_class!(
203 /// AVMetadataHumanFullBodyObject is a concrete subclass of AVMetadataBodyObject defining a detected human full body.
204 ///
205 ///
206 /// AVMetadataHumanFullBodyObject represents a single detected human full body in a picture. It is an immutable object describing the various features found in the body.
207 ///
208 /// On supported platforms, AVCaptureMetadataOutput outputs arrays of detected human full body objects. See AVCaptureOutput.h.
209 ///
210 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadatahumanfullbodyobject?language=objc)
211 #[unsafe(super(AVMetadataBodyObject, AVMetadataObject, NSObject))]
212 #[derive(Debug, PartialEq, Eq, Hash)]
213 pub struct AVMetadataHumanFullBodyObject;
214);
215
216extern_conformance!(
217 unsafe impl NSCopying for AVMetadataHumanFullBodyObject {}
218);
219
220unsafe impl CopyingHelper for AVMetadataHumanFullBodyObject {
221 type Result = Self;
222}
223
224extern_conformance!(
225 unsafe impl NSObjectProtocol for AVMetadataHumanFullBodyObject {}
226);
227
228impl AVMetadataHumanFullBodyObject {
229 extern_methods!();
230}
231
232/// Methods declared on superclass `AVMetadataObject`.
233impl AVMetadataHumanFullBodyObject {
234 extern_methods!(
235 #[unsafe(method(init))]
236 #[unsafe(method_family = init)]
237 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
238
239 #[unsafe(method(new))]
240 #[unsafe(method_family = new)]
241 pub unsafe fn new() -> Retained<Self>;
242 );
243}
244
245extern "C" {
246 /// An identifier for an instance of AVMetadataCatBodyObject.
247 ///
248 ///
249 /// AVMetadataCatBodyObject objects return this constant as their type.
250 ///
251 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadataobjecttypecatbody?language=objc)
252 pub static AVMetadataObjectTypeCatBody: &'static AVMetadataObjectType;
253}
254
255extern_class!(
256 /// AVMetadataCatBodyObject is a concrete subclass of AVMetadataBodyObject defining a detected cat body.
257 ///
258 ///
259 /// AVMetadataCatBodyObject represents a single detected cat body in a picture. It is an immutable object describing the various features found in the body.
260 ///
261 /// On supported platforms, AVCaptureMetadataOutput outputs arrays of detected cat body objects. See AVCaptureOutput.h.
262 ///
263 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadatacatbodyobject?language=objc)
264 #[unsafe(super(AVMetadataBodyObject, AVMetadataObject, NSObject))]
265 #[derive(Debug, PartialEq, Eq, Hash)]
266 pub struct AVMetadataCatBodyObject;
267);
268
269extern_conformance!(
270 unsafe impl NSCopying for AVMetadataCatBodyObject {}
271);
272
273unsafe impl CopyingHelper for AVMetadataCatBodyObject {
274 type Result = Self;
275}
276
277extern_conformance!(
278 unsafe impl NSObjectProtocol for AVMetadataCatBodyObject {}
279);
280
281impl AVMetadataCatBodyObject {
282 extern_methods!();
283}
284
285/// Methods declared on superclass `AVMetadataObject`.
286impl AVMetadataCatBodyObject {
287 extern_methods!(
288 #[unsafe(method(init))]
289 #[unsafe(method_family = init)]
290 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
291
292 #[unsafe(method(new))]
293 #[unsafe(method_family = new)]
294 pub unsafe fn new() -> Retained<Self>;
295 );
296}
297
298extern "C" {
299 /// An identifier for an instance of AVMetadataDogBodyObject.
300 ///
301 ///
302 /// AVMetadataDogBodyObject objects return this constant as their type.
303 ///
304 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadataobjecttypedogbody?language=objc)
305 pub static AVMetadataObjectTypeDogBody: &'static AVMetadataObjectType;
306}
307
308extern_class!(
309 /// AVMetadataDogBodyObject is a concrete subclass of AVMetadataBodyObject defining a detected dog body.
310 ///
311 ///
312 /// AVMetadataDogBodyObject represents a single detected dog body in a picture. It is an immutable object describing the various features found in the body.
313 ///
314 /// On supported platforms, AVCaptureMetadataOutput outputs arrays of detected dog body objects. See AVCaptureOutput.h.
315 ///
316 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadatadogbodyobject?language=objc)
317 #[unsafe(super(AVMetadataBodyObject, AVMetadataObject, NSObject))]
318 #[derive(Debug, PartialEq, Eq, Hash)]
319 pub struct AVMetadataDogBodyObject;
320);
321
322extern_conformance!(
323 unsafe impl NSCopying for AVMetadataDogBodyObject {}
324);
325
326unsafe impl CopyingHelper for AVMetadataDogBodyObject {
327 type Result = Self;
328}
329
330extern_conformance!(
331 unsafe impl NSObjectProtocol for AVMetadataDogBodyObject {}
332);
333
334impl AVMetadataDogBodyObject {
335 extern_methods!();
336}
337
338/// Methods declared on superclass `AVMetadataObject`.
339impl AVMetadataDogBodyObject {
340 extern_methods!(
341 #[unsafe(method(init))]
342 #[unsafe(method_family = init)]
343 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
344
345 #[unsafe(method(new))]
346 #[unsafe(method_family = new)]
347 pub unsafe fn new() -> Retained<Self>;
348 );
349}
350
351extern "C" {
352 /// An identifier for an instance of AVMetadataSalientObject.
353 ///
354 ///
355 /// AVMetadataSalientObject objects return this constant as their type.
356 ///
357 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadataobjecttypesalientobject?language=objc)
358 pub static AVMetadataObjectTypeSalientObject: &'static AVMetadataObjectType;
359}
360
361extern_class!(
362 /// AVMetadataSalientObject is a concrete subclass of AVMetadataObject defining the features of a salient object.
363 ///
364 ///
365 /// AVMetadataSalientObject represents a single detected salient area in a picture. It is an immutable object describing the salient object.
366 ///
367 /// On supported platforms, AVCaptureMetadataOutput outputs arrays of detected salient objects. See AVCaptureOutput.h.
368 ///
369 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadatasalientobject?language=objc)
370 #[unsafe(super(AVMetadataObject, NSObject))]
371 #[derive(Debug, PartialEq, Eq, Hash)]
372 pub struct AVMetadataSalientObject;
373);
374
375extern_conformance!(
376 unsafe impl NSCopying for AVMetadataSalientObject {}
377);
378
379unsafe impl CopyingHelper for AVMetadataSalientObject {
380 type Result = Self;
381}
382
383extern_conformance!(
384 unsafe impl NSObjectProtocol for AVMetadataSalientObject {}
385);
386
387impl AVMetadataSalientObject {
388 extern_methods!(
389 /// A unique number associated with the receiver.
390 ///
391 ///
392 /// 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.
393 #[unsafe(method(objectID))]
394 #[unsafe(method_family = none)]
395 pub unsafe fn objectID(&self) -> NSInteger;
396 );
397}
398
399/// Methods declared on superclass `AVMetadataObject`.
400impl AVMetadataSalientObject {
401 extern_methods!(
402 #[unsafe(method(init))]
403 #[unsafe(method_family = init)]
404 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
405
406 #[unsafe(method(new))]
407 #[unsafe(method_family = new)]
408 pub unsafe fn new() -> Retained<Self>;
409 );
410}
411
412extern "C" {
413 /// An identifier for an instance of AVMetadataFaceObject.
414 ///
415 ///
416 /// AVMetadataFaceObject objects return this constant as their type.
417 ///
418 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadataobjecttypeface?language=objc)
419 pub static AVMetadataObjectTypeFace: &'static AVMetadataObjectType;
420}
421
422extern_class!(
423 /// AVMetadataFaceObject is a concrete subclass of AVMetadataObject defining the features of a detected face.
424 ///
425 ///
426 /// AVMetadataFaceObject represents a single detected face in a picture. It is an immutable object describing the various features found in the face.
427 ///
428 /// On supported platforms, AVCaptureMetadataOutput outputs arrays of detected face objects. See AVCaptureOutput.h.
429 ///
430 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadatafaceobject?language=objc)
431 #[unsafe(super(AVMetadataObject, NSObject))]
432 #[derive(Debug, PartialEq, Eq, Hash)]
433 pub struct AVMetadataFaceObject;
434);
435
436extern_conformance!(
437 unsafe impl NSCopying for AVMetadataFaceObject {}
438);
439
440unsafe impl CopyingHelper for AVMetadataFaceObject {
441 type Result = Self;
442}
443
444extern_conformance!(
445 unsafe impl NSObjectProtocol for AVMetadataFaceObject {}
446);
447
448impl AVMetadataFaceObject {
449 extern_methods!(
450 /// A unique number associated with the receiver.
451 ///
452 ///
453 /// 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.
454 #[unsafe(method(faceID))]
455 #[unsafe(method_family = none)]
456 pub unsafe fn faceID(&self) -> NSInteger;
457
458 /// A BOOL indicating whether the rollAngle property is valid for this receiver.
459 #[unsafe(method(hasRollAngle))]
460 #[unsafe(method_family = none)]
461 pub unsafe fn hasRollAngle(&self) -> bool;
462
463 #[cfg(feature = "objc2-core-foundation")]
464 /// The roll angle of the face in degrees.
465 ///
466 ///
467 /// 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.
468 #[unsafe(method(rollAngle))]
469 #[unsafe(method_family = none)]
470 pub unsafe fn rollAngle(&self) -> CGFloat;
471
472 /// A BOOL indicating whether the yawAngle property is valid for this receiver.
473 #[unsafe(method(hasYawAngle))]
474 #[unsafe(method_family = none)]
475 pub unsafe fn hasYawAngle(&self) -> bool;
476
477 #[cfg(feature = "objc2-core-foundation")]
478 /// The yaw angle of the face in degrees.
479 ///
480 ///
481 /// 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.
482 #[unsafe(method(yawAngle))]
483 #[unsafe(method_family = none)]
484 pub unsafe fn yawAngle(&self) -> CGFloat;
485 );
486}
487
488/// Methods declared on superclass `AVMetadataObject`.
489impl AVMetadataFaceObject {
490 extern_methods!(
491 #[unsafe(method(init))]
492 #[unsafe(method_family = init)]
493 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
494
495 #[unsafe(method(new))]
496 #[unsafe(method_family = new)]
497 pub unsafe fn new() -> Retained<Self>;
498 );
499}
500
501extern "C" {
502 /// An identifier for an instance of AVMetadataMachineReadableCodeObject having a type AVMetadataObjectTypeUPCECode.
503 ///
504 ///
505 /// AVMetadataMachineReadableCodeObject objects generated from UPC-E codes return this constant as their type.
506 ///
507 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadataobjecttypeupcecode?language=objc)
508 pub static AVMetadataObjectTypeUPCECode: &'static AVMetadataObjectType;
509}
510
511extern "C" {
512 /// An identifier for an instance of AVMetadataMachineReadableCodeObject having a type AVMetadataObjectTypeCode39Code.
513 ///
514 ///
515 /// AVMetadataMachineReadableCodeObject objects generated from Code 39 codes return this constant as their type.
516 ///
517 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadataobjecttypecode39code?language=objc)
518 pub static AVMetadataObjectTypeCode39Code: &'static AVMetadataObjectType;
519}
520
521extern "C" {
522 /// An identifier for an instance of AVMetadataMachineReadableCodeObject having a type AVMetadataObjectTypeCode39Mod43Code.
523 ///
524 ///
525 /// AVMetadataMachineReadableCodeObject objects generated from Code 39 mod 43 codes return this constant as their type.
526 ///
527 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadataobjecttypecode39mod43code?language=objc)
528 pub static AVMetadataObjectTypeCode39Mod43Code: &'static AVMetadataObjectType;
529}
530
531extern "C" {
532 /// An identifier for an instance of AVMetadataMachineReadableCodeObject having a type AVMetadataObjectTypeEAN13Code.
533 ///
534 ///
535 /// AVMetadataMachineReadableCodeObject objects generated from EAN-13 (including UPC-A) codes return this constant as their type.
536 ///
537 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadataobjecttypeean13code?language=objc)
538 pub static AVMetadataObjectTypeEAN13Code: &'static AVMetadataObjectType;
539}
540
541extern "C" {
542 /// An identifier for an instance of AVMetadataMachineReadableCodeObject having a type AVMetadataObjectTypeEAN8Code.
543 ///
544 ///
545 /// AVMetadataMachineReadableCodeObject objects generated from EAN-8 codes return this constant as their type.
546 ///
547 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadataobjecttypeean8code?language=objc)
548 pub static AVMetadataObjectTypeEAN8Code: &'static AVMetadataObjectType;
549}
550
551extern "C" {
552 /// An identifier for an instance of AVMetadataMachineReadableCodeObject having a type AVMetadataObjectTypeCode93Code.
553 ///
554 ///
555 /// AVMetadataMachineReadableCodeObject objects generated from Code 93 codes return this constant as their type.
556 ///
557 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadataobjecttypecode93code?language=objc)
558 pub static AVMetadataObjectTypeCode93Code: &'static AVMetadataObjectType;
559}
560
561extern "C" {
562 /// An identifier for an instance of AVMetadataMachineReadableCodeObject having a type AVMetadataObjectTypeCode128Code.
563 ///
564 ///
565 /// AVMetadataMachineReadableCodeObject objects generated from Code 128 codes return this constant as their type.
566 ///
567 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadataobjecttypecode128code?language=objc)
568 pub static AVMetadataObjectTypeCode128Code: &'static AVMetadataObjectType;
569}
570
571extern "C" {
572 /// An identifier for an instance of AVMetadataMachineReadableCodeObject having a type AVMetadataObjectTypePDF417Code.
573 ///
574 ///
575 /// AVMetadataMachineReadableCodeObject objects generated from PDF417 codes return this constant as their type.
576 ///
577 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadataobjecttypepdf417code?language=objc)
578 pub static AVMetadataObjectTypePDF417Code: &'static AVMetadataObjectType;
579}
580
581extern "C" {
582 /// An identifier for an instance of AVMetadataMachineReadableCodeObject having a type AVMetadataObjectTypeQRCode.
583 ///
584 ///
585 /// AVMetadataMachineReadableCodeObject objects generated from QR codes return this constant as their type.
586 ///
587 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadataobjecttypeqrcode?language=objc)
588 pub static AVMetadataObjectTypeQRCode: &'static AVMetadataObjectType;
589}
590
591extern "C" {
592 /// An identifier for an instance of AVMetadataMachineReadableCodeObject having a type AVMetadataObjectTypeAztecCode.
593 ///
594 ///
595 /// AVMetadataMachineReadableCodeObject objects generated from Aztec codes return this constant as their type.
596 ///
597 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadataobjecttypeazteccode?language=objc)
598 pub static AVMetadataObjectTypeAztecCode: &'static AVMetadataObjectType;
599}
600
601extern "C" {
602 /// An identifier for an instance of AVMetadataMachineReadableCodeObject having a type AVMetadataObjectTypeInterleaved2of5Code.
603 ///
604 ///
605 /// AVMetadataMachineReadableCodeObject objects generated from Interleaved 2 of 5 codes return this constant as their type.
606 ///
607 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadataobjecttypeinterleaved2of5code?language=objc)
608 pub static AVMetadataObjectTypeInterleaved2of5Code: &'static AVMetadataObjectType;
609}
610
611extern "C" {
612 /// An identifier for an instance of AVMetadataMachineReadableCodeObject having a type AVMetadataObjectTypeITF14Code.
613 ///
614 ///
615 /// AVMetadataMachineReadableCodeObject objects generated from ITF14 codes return this constant as their type.
616 ///
617 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadataobjecttypeitf14code?language=objc)
618 pub static AVMetadataObjectTypeITF14Code: &'static AVMetadataObjectType;
619}
620
621extern "C" {
622 /// An identifier for an instance of AVMetadataMachineReadableCodeObject having a type AVMetadataObjectTypeDataMatrixCode.
623 ///
624 ///
625 /// AVMetadataMachineReadableCodeObject objects generated from DataMatrix codes return this constant as their type.
626 ///
627 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadataobjecttypedatamatrixcode?language=objc)
628 pub static AVMetadataObjectTypeDataMatrixCode: &'static AVMetadataObjectType;
629}
630
631extern "C" {
632 /// An identifier for an instance of AVMetadataMachineReadableCodeObject having a type AVMetadataObjectTypeCodabarCode.
633 ///
634 ///
635 /// AVMetadataMachineReadableCodeObject objects generated from Codabar codes return this constant as their type.
636 ///
637 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadataobjecttypecodabarcode?language=objc)
638 pub static AVMetadataObjectTypeCodabarCode: &'static AVMetadataObjectType;
639}
640
641extern "C" {
642 /// An identifier for an instance of AVMetadataMachineReadableCodeObject having a type AVMetadataObjectTypeGS1DataBarCode.
643 ///
644 ///
645 /// AVMetadataMachineReadableCodeObject objects generated from GS1DataBar codes return this constant as their type.
646 ///
647 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadataobjecttypegs1databarcode?language=objc)
648 pub static AVMetadataObjectTypeGS1DataBarCode: &'static AVMetadataObjectType;
649}
650
651extern "C" {
652 /// An identifier for an instance of AVMetadataMachineReadableCodeObject having a type AVMetadataObjectTypeGS1DataBarExpandedCode.
653 ///
654 ///
655 /// AVMetadataMachineReadableCodeObject objects generated from GS1DataBarExpanded codes return this constant as their type.
656 ///
657 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadataobjecttypegs1databarexpandedcode?language=objc)
658 pub static AVMetadataObjectTypeGS1DataBarExpandedCode: &'static AVMetadataObjectType;
659}
660
661extern "C" {
662 /// An identifier for an instance of AVMetadataMachineReadableCodeObject having a type AVMetadataObjectTypeGS1DataBarLimitedCode.
663 ///
664 ///
665 /// AVMetadataMachineReadableCodeObject objects generated from GS1DataBarLimited codes return this constant as their type.
666 ///
667 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadataobjecttypegs1databarlimitedcode?language=objc)
668 pub static AVMetadataObjectTypeGS1DataBarLimitedCode: &'static AVMetadataObjectType;
669}
670
671extern "C" {
672 /// An identifier for an instance of AVMetadataMachineReadableCodeObject having a type AVMetadataObjectTypeMicroQRCode.
673 ///
674 ///
675 /// AVMetadataMachineReadableCodeObject objects generated from MicroQR codes return this constant as their type.
676 ///
677 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadataobjecttypemicroqrcode?language=objc)
678 pub static AVMetadataObjectTypeMicroQRCode: &'static AVMetadataObjectType;
679}
680
681extern "C" {
682 /// An identifier for an instance of AVMetadataMachineReadableCodeObject having a type AVMetadataObjectTypeMicroPDF417Code.
683 ///
684 ///
685 /// AVMetadataMachineReadableCodeObject objects generated from MicroPDF417 codes return this constant as their type.
686 ///
687 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadataobjecttypemicropdf417code?language=objc)
688 pub static AVMetadataObjectTypeMicroPDF417Code: &'static AVMetadataObjectType;
689}
690
691extern_class!(
692 /// AVMetadataMachineReadableCodeObject is a concrete subclass of AVMetadataObject defining the features of a detected one-dimensional or two-dimensional barcode.
693 ///
694 ///
695 /// AVMetadataMachineReadableCodeObject represents a single detected machine readable code in a picture. It is an immutable object describing the features and payload of a barcode.
696 ///
697 /// On supported platforms, AVCaptureMetadataOutput outputs arrays of detected machine readable code objects. See AVCaptureMetadataOutput.h.
698 ///
699 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadatamachinereadablecodeobject?language=objc)
700 #[unsafe(super(AVMetadataObject, NSObject))]
701 #[derive(Debug, PartialEq, Eq, Hash)]
702 pub struct AVMetadataMachineReadableCodeObject;
703);
704
705extern_conformance!(
706 unsafe impl NSObjectProtocol for AVMetadataMachineReadableCodeObject {}
707);
708
709impl AVMetadataMachineReadableCodeObject {
710 extern_methods!(
711 /// The points defining the (X,Y) locations of the corners of the machine-readable code.
712 ///
713 ///
714 /// 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.
715 #[unsafe(method(corners))]
716 #[unsafe(method_family = none)]
717 pub unsafe fn corners(&self) -> Retained<NSArray<NSDictionary>>;
718
719 /// Returns the receiver's errorCorrectedData decoded into a human-readable string.
720 ///
721 ///
722 /// 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.
723 #[unsafe(method(stringValue))]
724 #[unsafe(method_family = none)]
725 pub unsafe fn stringValue(&self) -> Option<Retained<NSString>>;
726 );
727}
728
729/// Methods declared on superclass `AVMetadataObject`.
730impl AVMetadataMachineReadableCodeObject {
731 extern_methods!(
732 #[unsafe(method(init))]
733 #[unsafe(method_family = init)]
734 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
735
736 #[unsafe(method(new))]
737 #[unsafe(method_family = new)]
738 pub unsafe fn new() -> Retained<Self>;
739 );
740}
741
742/// AVMetadataMachineReadableCodeDescriptor.
743impl AVMetadataMachineReadableCodeObject {
744 extern_methods!(
745 #[cfg(feature = "objc2-core-image")]
746 #[cfg(not(target_os = "watchos"))]
747 /// An abstract representation of a machine readable code's symbol attributes.
748 ///
749 ///
750 /// 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.
751 #[unsafe(method(descriptor))]
752 #[unsafe(method_family = none)]
753 pub unsafe fn descriptor(&self) -> Option<Retained<CIBarcodeDescriptor>>;
754 );
755}