use crate::{api, arc, av, cg, define_obj_type, ns, objc};
#[cfg(feature = "cm")]
use crate::cm;
define_obj_type!(
#[doc(alias = "AVMetadataObjectType")]
pub Type(ns::String)
);
impl Type {
#[doc(alias = "AVMetadataObjectTypeHumanBody")]
#[inline]
pub fn human_body() -> &'static Type {
unsafe { AVMetadataObjectTypeHumanBody }
}
#[doc(alias = "AVMetadataObjectTypeHumanFullBody")]
#[inline]
pub fn human_full_body() -> &'static Type {
unsafe { AVMetadataObjectTypeHumanFullBody }
}
#[doc(alias = "AVMetadataObjectTypeCatBody")]
#[inline]
pub fn cat_body() -> &'static Type {
unsafe { AVMetadataObjectTypeCatBody }
}
#[doc(alias = "AVMetadataObjectTypeDogBody")]
#[inline]
pub fn dog_body() -> &'static Type {
unsafe { AVMetadataObjectTypeDogBody }
}
#[doc(alias = "AVMetadataObjectTypeSalientObject")]
#[inline]
pub fn salient_object() -> &'static Type {
unsafe { AVMetadataObjectTypeSalientObject }
}
#[doc(alias = "AVMetadataObjectTypeFace")]
#[inline]
pub fn face() -> &'static Type {
unsafe { AVMetadataObjectTypeFace }
}
#[doc(alias = "AVMetadataObjectTypeUPCECode")]
#[inline]
pub fn upc_e_code() -> &'static Type {
unsafe { AVMetadataObjectTypeUPCECode }
}
#[doc(alias = "AVMetadataObjectTypeCode39Code")]
#[inline]
pub fn code_39_code() -> &'static Type {
unsafe { AVMetadataObjectTypeCode39Code }
}
#[doc(alias = "AVMetadataObjectTypeCode39Mod43Code")]
#[inline]
pub fn code_39_mod_43_code() -> &'static Type {
unsafe { AVMetadataObjectTypeCode39Mod43Code }
}
#[doc(alias = "AVMetadataObjectTypeEAN13Code")]
#[inline]
pub fn ean_13_code() -> &'static Type {
unsafe { AVMetadataObjectTypeEAN13Code }
}
#[doc(alias = "AVMetadataObjectTypeEAN8Code")]
#[inline]
pub fn ean_8_code() -> &'static Type {
unsafe { AVMetadataObjectTypeEAN8Code }
}
#[doc(alias = "AVMetadataObjectTypeCode93Code")]
#[inline]
pub fn code_93_code() -> &'static Type {
unsafe { AVMetadataObjectTypeCode93Code }
}
#[doc(alias = "AVMetadataObjectTypeCode128Code")]
#[inline]
pub fn code_128_code() -> &'static Type {
unsafe { AVMetadataObjectTypeCode128Code }
}
#[doc(alias = "AVMetadataObjectTypePDF417Code")]
#[inline]
pub fn pdf_417_code() -> &'static Type {
unsafe { AVMetadataObjectTypePDF417Code }
}
#[doc(alias = "AVMetadataObjectTypeQRCode")]
#[inline]
pub fn qr_code() -> &'static Type {
unsafe { AVMetadataObjectTypeQRCode }
}
#[doc(alias = "AVMetadataObjectTypeAztecCode")]
#[inline]
pub fn aztec_code() -> &'static Type {
unsafe { AVMetadataObjectTypeAztecCode }
}
#[doc(alias = "AVMetadataObjectTypeInterleaved2of5Code")]
#[inline]
pub fn interleaved_2_to_5_code() -> &'static Type {
unsafe { AVMetadataObjectTypeInterleaved2of5Code }
}
#[doc(alias = "AVMetadataObjectTypeITF14Code")]
#[inline]
pub fn itf_14_code() -> &'static Type {
unsafe { AVMetadataObjectTypeITF14Code }
}
#[doc(alias = "AVMetadataObjectTypeDataMatrixCode")]
#[inline]
pub fn data_matrix_code() -> &'static Type {
unsafe { AVMetadataObjectTypeDataMatrixCode }
}
#[doc(alias = "AVMetadataObjectTypeCodabarCode")]
#[inline]
pub fn codebar_code() -> &'static Type {
unsafe { AVMetadataObjectTypeCodabarCode }
}
#[doc(alias = "AVMetadataObjectTypeGS1DataBarCode")]
#[inline]
pub fn gs_1_data_bar_code() -> &'static Type {
unsafe { AVMetadataObjectTypeGS1DataBarCode }
}
#[doc(alias = "AVMetadataObjectTypeGS1DataBarExpandedCode")]
#[inline]
pub fn gs_1_data_bar_expanded_code() -> &'static Type {
unsafe { AVMetadataObjectTypeGS1DataBarExpandedCode }
}
#[doc(alias = "AVMetadataObjectTypeGS1DataBarLimitedCode")]
#[inline]
pub fn gs_1_data_bar_limited_code() -> &'static Type {
unsafe { AVMetadataObjectTypeGS1DataBarLimitedCode }
}
#[doc(alias = "AVMetadataObjectTypeMicroQRCode")]
#[inline]
pub fn micro_qr_code() -> &'static Type {
unsafe { AVMetadataObjectTypeMicroQRCode }
}
#[doc(alias = "AVMetadataObjectTypeMicroPDF417Code")]
#[inline]
pub fn micro_pdf_417_code() -> &'static Type {
unsafe { AVMetadataObjectTypeMicroPDF417Code }
}
#[api::available(macos = 26.0, ios = 26.0, maccatalyst = 26.0, tvos = 26.0)]
pub fn cat_head() -> &'static Type {
unsafe { AVMetadataObjectTypeCatHead }
}
#[api::available(macos = 26.0, ios = 26.0, maccatalyst = 26.0, tvos = 26.0)]
pub fn dog_head() -> &'static Type {
unsafe { AVMetadataObjectTypeDogHead }
}
}
#[api::weak]
unsafe extern "C" {
static AVMetadataObjectTypeHumanBody: &'static Type;
static AVMetadataObjectTypeHumanFullBody: &'static Type;
static AVMetadataObjectTypeCatBody: &'static Type;
static AVMetadataObjectTypeDogBody: &'static Type;
static AVMetadataObjectTypeSalientObject: &'static Type;
static AVMetadataObjectTypeFace: &'static Type;
static AVMetadataObjectTypeUPCECode: &'static Type;
static AVMetadataObjectTypeCode39Code: &'static Type;
static AVMetadataObjectTypeCode39Mod43Code: &'static Type;
static AVMetadataObjectTypeEAN13Code: &'static Type;
static AVMetadataObjectTypeEAN8Code: &'static Type;
static AVMetadataObjectTypeCode93Code: &'static Type;
static AVMetadataObjectTypeCode128Code: &'static Type;
static AVMetadataObjectTypePDF417Code: &'static Type;
static AVMetadataObjectTypeQRCode: &'static Type;
static AVMetadataObjectTypeAztecCode: &'static Type;
static AVMetadataObjectTypeInterleaved2of5Code: &'static Type;
static AVMetadataObjectTypeITF14Code: &'static Type;
static AVMetadataObjectTypeDataMatrixCode: &'static Type;
static AVMetadataObjectTypeCodabarCode: &'static Type;
static AVMetadataObjectTypeGS1DataBarCode: &'static Type;
static AVMetadataObjectTypeGS1DataBarExpandedCode: &'static Type;
static AVMetadataObjectTypeGS1DataBarLimitedCode: &'static Type;
static AVMetadataObjectTypeMicroQRCode: &'static Type;
static AVMetadataObjectTypeMicroPDF417Code: &'static Type;
#[api::available(macos = 26.0, ios = 26.0, maccatalyst = 26.0, tvos = 26.0)]
static AVMetadataObjectTypeCatHead: &'static Type;
#[api::available(macos = 26.0, ios = 26.0, maccatalyst = 26.0, tvos = 26.0)]
static AVMetadataObjectTypeDogHead: &'static Type;
}
define_obj_type!(
#[doc(alias = "AVMetadataObject")]
pub Obj(ns::Id)
);
impl Obj {
#[objc::msg_send(bounds)]
pub fn bounds(&self) -> cg::Rect;
#[cfg(feature = "cm")]
#[objc::msg_send(time)]
pub fn time(&self) -> cm::Time;
#[cfg(feature = "cm")]
#[objc::msg_send(duration)]
pub fn duration(&self) -> cm::Time;
#[objc::msg_send(type)]
pub fn obj_type(&self) -> &Type;
#[objc::msg_send(groupID)]
#[api::available(macos = 26.0, ios = 26.0, maccatalyst = 26.0, tvos = 26.0)]
pub fn group_id(&self) -> isize;
#[objc::msg_send(objectID)]
#[api::available(macos = 26.0, ios = 26.0, maccatalyst = 26.0, tvos = 26.0)]
pub fn obj_id(&self) -> isize;
}
impl Obj {
#[objc::msg_send(cinematicVideoFocusMode)]
#[api::available(macos = 26.0, ios = 26.0, maccatalyst = 26.0, tvos = 26.0)]
pub fn cinematic_video_focus_mode(&self) -> av::CaptureCinematicVideoFocusMode;
#[objc::msg_send(isFixedFocus)]
#[api::available(macos = 26.0, ios = 26.0, maccatalyst = 26.0, tvos = 26.0)]
pub fn is_fixed_focus(&self) -> bool;
}
define_obj_type!(
#[doc(alias = "AVMetadataBodyObject")]
pub BodyObj(Obj));
impl BodyObj {
#[objc::msg_send(bodyID)]
pub fn body_id(&self) -> isize;
}
define_obj_type!(
#[doc(alias = "AVMetadataCatBodyObject")]
pub CatBodyObj(BodyObj)
);
define_obj_type!(
#[doc(alias = "AVMetadataCatHeadObject")]
pub CatHeadObj(Obj)
);
define_obj_type!(
#[doc(alias = "AVMetadataDogBodyObject")]
pub DogBodyObj(BodyObj)
);
define_obj_type!(
#[doc(alias = "AVMetadataDogHeadObject")]
pub DogHeadObj(Obj)
);
define_obj_type!(
#[doc(alias = "AVMetadataHumanBodyObject")]
pub HumanBodyObj(BodyObj)
);
define_obj_type!(
#[doc(alias = "AVMetadataHumanFullBodyObject")]
pub HumanFullBodyObj(BodyObj)
);
define_obj_type!(
#[doc(alias = "AVMetadataFaceObject")]
pub FaceObj(Obj)
);
define_obj_type!(
#[doc(alias = "AVMetadataMachineReadableCodeObject")]
pub MachineReadableCodeObj(Obj)
);
define_obj_type!(
#[doc(alias = "AVMetadataSalientObject")]
pub SalientObj(Obj)
);
impl SalientObj {
#[objc::msg_send(objectID)]
pub fn obj_id(&self) -> isize;
}
impl FaceObj {
#[objc::msg_send(faceID)]
pub fn face_id(&self) -> isize;
#[objc::msg_send(hasRollAngle)]
pub fn has_roll_angle(&self) -> bool;
#[objc::msg_send(rollAngle)]
pub unsafe fn roll_angle_throws(&self) -> cg::Float;
#[inline]
pub fn roll_angle(&self) -> Option<cg::Float> {
if self.has_roll_angle() {
Some(unsafe { self.roll_angle_throws() })
} else {
None
}
}
#[objc::msg_send(hasYawAngle)]
pub fn has_yaw_angle(&self) -> bool;
#[objc::msg_send(yawAngle)]
pub unsafe fn yaw_angle_throws(&self) -> cg::Float;
#[inline]
pub fn yaw_angle(&self) -> Option<cg::Float> {
if self.has_yaw_angle() {
Some(unsafe { self.yaw_angle_throws() })
} else {
None
}
}
}
impl MachineReadableCodeObj {
#[objc::msg_send(corners)]
pub fn corners(&self) -> arc::R<ns::Dictionary<ns::String, ns::Id>>;
#[objc::msg_send(stringValue)]
pub fn string_value(&self) -> Option<arc::R<ns::String>>;
}
#[cfg(feature = "ci")]
use crate::ci;
#[cfg(feature = "ci")]
impl MachineReadableCodeObj {
#[objc::msg_send(descriptor)]
pub fn descriptor(&self) -> Option<arc::R<ci::BarcodeDesc>>;
}