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