use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-media")]
use objc2_core_media::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct CNDetectionTrack;
);
extern_conformance!(
unsafe impl NSCopying for CNDetectionTrack {}
);
unsafe impl CopyingHelper for CNDetectionTrack {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for CNDetectionTrack {}
);
impl CNDetectionTrack {
extern_methods!(
#[cfg(feature = "CNDetection")]
#[unsafe(method(detectionType))]
#[unsafe(method_family = none)]
pub unsafe fn detectionType(&self) -> CNDetectionType;
#[cfg(feature = "CNDetection")]
#[unsafe(method(detectionID))]
#[unsafe(method_family = none)]
pub unsafe fn detectionID(&self) -> CNDetectionID;
#[cfg(feature = "CNDetection")]
#[unsafe(method(detectionGroupID))]
#[unsafe(method_family = none)]
pub unsafe fn detectionGroupID(&self) -> CNDetectionGroupID;
#[unsafe(method(isUserCreated))]
#[unsafe(method_family = none)]
pub unsafe fn isUserCreated(&self) -> bool;
#[unsafe(method(isDiscrete))]
#[unsafe(method_family = none)]
pub unsafe fn isDiscrete(&self) -> bool;
#[cfg(all(feature = "CNDetection", feature = "objc2-core-media"))]
#[unsafe(method(detectionAtOrBeforeTime:))]
#[unsafe(method_family = none)]
pub unsafe fn detectionAtOrBeforeTime(&self, time: CMTime)
-> Option<Retained<CNDetection>>;
#[cfg(all(feature = "CNDetection", feature = "objc2-core-media"))]
#[unsafe(method(detectionNearestTime:))]
#[unsafe(method_family = none)]
pub unsafe fn detectionNearestTime(&self, time: CMTime) -> Option<Retained<CNDetection>>;
#[cfg(all(feature = "CNDetection", feature = "objc2-core-media"))]
#[unsafe(method(detectionsInTimeRange:))]
#[unsafe(method_family = none)]
pub unsafe fn detectionsInTimeRange(
&self,
time_range: CMTimeRange,
) -> Retained<NSArray<CNDetection>>;
#[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_class!(
#[unsafe(super(CNDetectionTrack, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct CNFixedDetectionTrack;
);
extern_conformance!(
unsafe impl NSCopying for CNFixedDetectionTrack {}
);
unsafe impl CopyingHelper for CNFixedDetectionTrack {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for CNFixedDetectionTrack {}
);
impl CNFixedDetectionTrack {
extern_methods!(
#[unsafe(method(initWithFocusDisparity:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithFocusDisparity(
this: Allocated<Self>,
focus_disparity: c_float,
) -> Retained<Self>;
#[cfg(feature = "CNDetection")]
#[unsafe(method(initWithOriginalDetection:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithOriginalDetection(
this: Allocated<Self>,
original_detection: &CNDetection,
) -> Retained<Self>;
#[unsafe(method(focusDisparity))]
#[unsafe(method_family = none)]
pub unsafe fn focusDisparity(&self) -> c_float;
#[cfg(feature = "CNDetection")]
#[unsafe(method(originalDetection))]
#[unsafe(method_family = none)]
pub unsafe fn originalDetection(&self) -> Option<Retained<CNDetection>>;
);
}
impl CNFixedDetectionTrack {
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_class!(
#[unsafe(super(CNDetectionTrack, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct CNCustomDetectionTrack;
);
extern_conformance!(
unsafe impl NSCopying for CNCustomDetectionTrack {}
);
unsafe impl CopyingHelper for CNCustomDetectionTrack {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for CNCustomDetectionTrack {}
);
impl CNCustomDetectionTrack {
extern_methods!(
#[cfg(feature = "CNDetection")]
#[unsafe(method(initWithDetections:smooth:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithDetections_smooth(
this: Allocated<Self>,
detections: &NSArray<CNDetection>,
apply_smoothing: bool,
) -> Retained<Self>;
#[cfg(feature = "CNDetection")]
#[unsafe(method(allDetections))]
#[unsafe(method_family = none)]
pub unsafe fn allDetections(&self) -> Retained<NSArray<CNDetection>>;
);
}
impl CNCustomDetectionTrack {
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>;
);
}