use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
#[cfg(feature = "objc2-core-media")]
use objc2_core_media::*;
#[cfg(feature = "objc2-core-video")]
use objc2_core_video::*;
use objc2_foundation::*;
use crate::*;
pub type CNDetectionID = i64;
pub type CNDetectionGroupID = i64;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct CNDetectionType(pub NSInteger);
impl CNDetectionType {
#[doc(alias = "CNDetectionTypeUnknown")]
pub const Unknown: Self = Self(0);
#[doc(alias = "CNDetectionTypeHumanFace")]
pub const HumanFace: Self = Self(1);
#[doc(alias = "CNDetectionTypeHumanHead")]
pub const HumanHead: Self = Self(2);
#[doc(alias = "CNDetectionTypeHumanTorso")]
pub const HumanTorso: Self = Self(3);
#[doc(alias = "CNDetectionTypeCatBody")]
pub const CatBody: Self = Self(4);
#[doc(alias = "CNDetectionTypeDogBody")]
pub const DogBody: Self = Self(5);
#[doc(alias = "CNDetectionTypeCatHead")]
pub const CatHead: Self = Self(9);
#[doc(alias = "CNDetectionTypeDogHead")]
pub const DogHead: Self = Self(10);
#[doc(alias = "CNDetectionTypeSportsBall")]
pub const SportsBall: Self = Self(11);
#[doc(alias = "CNDetectionTypeAutoFocus")]
pub const AutoFocus: Self = Self(100);
#[doc(alias = "CNDetectionTypeFixedFocus")]
pub const FixedFocus: Self = Self(101);
#[doc(alias = "CNDetectionTypeCustom")]
pub const Custom: Self = Self(102);
}
unsafe impl Encode for CNDetectionType {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for CNDetectionType {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct CNDetection;
);
unsafe impl Send for CNDetection {}
unsafe impl Sync for CNDetection {}
extern_conformance!(
unsafe impl NSCopying for CNDetection {}
);
unsafe impl CopyingHelper for CNDetection {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for CNDetection {}
);
impl CNDetection {
extern_methods!(
#[cfg(all(feature = "objc2-core-foundation", feature = "objc2-core-media"))]
#[unsafe(method(initWithTime:detectionType:normalizedRect:focusDisparity:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithTime_detectionType_normalizedRect_focusDisparity(
this: Allocated<Self>,
time: CMTime,
detection_type: CNDetectionType,
normalized_rect: CGRect,
focus_disparity: c_float,
) -> Retained<Self>;
#[cfg(feature = "objc2-core-media")]
#[unsafe(method(time))]
#[unsafe(method_family = none)]
pub unsafe fn time(&self) -> CMTime;
#[unsafe(method(detectionType))]
#[unsafe(method_family = none)]
pub unsafe fn detectionType(&self) -> CNDetectionType;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(normalizedRect))]
#[unsafe(method_family = none)]
pub unsafe fn normalizedRect(&self) -> CGRect;
#[unsafe(method(focusDisparity))]
#[unsafe(method_family = none)]
pub unsafe fn focusDisparity(&self) -> c_float;
#[unsafe(method(detectionID))]
#[unsafe(method_family = none)]
pub unsafe fn detectionID(&self) -> CNDetectionID;
#[unsafe(method(detectionGroupID))]
#[unsafe(method_family = none)]
pub unsafe fn detectionGroupID(&self) -> CNDetectionGroupID;
#[unsafe(method(isValidDetectionID:))]
#[unsafe(method_family = none)]
pub unsafe fn isValidDetectionID(detection_id: CNDetectionID) -> bool;
#[unsafe(method(isValidDetectionGroupID:))]
#[unsafe(method_family = none)]
pub unsafe fn isValidDetectionGroupID(detection_group_id: CNDetectionGroupID) -> bool;
#[unsafe(method(accessibilityLabelForDetectionType:))]
#[unsafe(method_family = none)]
pub unsafe fn accessibilityLabelForDetectionType(
detection_type: CNDetectionType,
) -> Retained<NSString>;
#[cfg(all(feature = "objc2-core-foundation", feature = "objc2-core-video"))]
#[unsafe(method(disparityInNormalizedRect:sourceDisparity:detectionType:priorDisparity:))]
#[unsafe(method_family = none)]
pub unsafe fn disparityInNormalizedRect_sourceDisparity_detectionType_priorDisparity(
normalized_rect: CGRect,
source_disparity: &CVPixelBuffer,
detection_type: CNDetectionType,
prior_disparity: c_float,
) -> c_float;
#[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>;
);
}