//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
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!(
/// A request that detects trajectories of shapes (even small ones) that follow a parabolic path in a sequence of images.
///
///
/// This request detects objects moving and (once their path follows the constraint of a parabola), a VNTrajectoryObservation will be returned with the detected points and the equation describing the parabola.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vndetecttrajectoriesrequest?language=objc)
#[unsafe(super(VNStatefulRequest, VNImageBasedRequest, VNRequest, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(all(feature = "VNRequest", feature = "VNStatefulRequest"))]
pub struct VNDetectTrajectoriesRequest;
);
#[cfg(all(feature = "VNRequest", feature = "VNStatefulRequest"))]
extern_conformance!(
unsafe impl NSCopying for VNDetectTrajectoriesRequest {}
);
#[cfg(all(feature = "VNRequest", feature = "VNStatefulRequest"))]
unsafe impl CopyingHelper for VNDetectTrajectoriesRequest {
type Result = Self;
}
#[cfg(all(feature = "VNRequest", feature = "VNStatefulRequest"))]
extern_conformance!(
unsafe impl NSObjectProtocol for VNDetectTrajectoriesRequest {}
);
#[cfg(all(feature = "VNRequest", feature = "VNStatefulRequest"))]
impl VNDetectTrajectoriesRequest {
extern_methods!(
#[cfg(all(feature = "block2", feature = "objc2-core-media"))]
/// # Safety
///
/// `completion_handler` must be a valid pointer or null.
#[unsafe(method(initWithFrameAnalysisSpacing:completionHandler:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithFrameAnalysisSpacing_completionHandler(
this: Allocated<Self>,
frame_analysis_spacing: CMTime,
completion_handler: VNRequestCompletionHandler,
) -> Retained<Self>;
#[cfg(all(feature = "block2", feature = "objc2-core-media"))]
/// Create a new request that will detect the trajectory of a shape in motion.
///
///
/// Parameter `frameAnalysisSpacing`: The reciprocal of the maximum rate at which buffers will be processed. The request will not process buffers that fall within the frameAnalysisSpacing after it has performed the analysis. The analysis is not done by wall time but by analysis of the time stamps of the samplebuffers being processed. This property is for instance useful to throttle the processing on slower devices. If this is set to kCMTimeZero then no frames get skipped in the analysis.
///
/// Parameter `trajectoryLength`: The number of points required to analyze a parabola that indicates a trajectory. Must be at least 5.
///
/// Parameter `completionHandler`: The block to be invoked after the request has completed its processing. The completion handler gets executed on the same dispatch queue as the request being executed.
///
/// # Safety
///
/// `completion_handler` must be a valid pointer or null.
#[unsafe(method(initWithFrameAnalysisSpacing:trajectoryLength:completionHandler:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithFrameAnalysisSpacing_trajectoryLength_completionHandler(
this: Allocated<Self>,
frame_analysis_spacing: CMTime,
trajectory_length: NSInteger,
completion_handler: VNRequestCompletionHandler,
) -> Retained<Self>;
/// The number of points required to analyze a parabola that indicates a trajectory.
#[unsafe(method(trajectoryLength))]
#[unsafe(method_family = none)]
pub unsafe fn trajectoryLength(&self) -> NSInteger;
/// Specifies the minimum radius of the bounding circle of the object to be tracked. This can be used to filter out noise and small objects. The default is 0.0, which means no filtering is applied. Changing the property from frame to frame can produce eratic trajectories as objects will either disappear or be added to the tracking base on this filtering. The value is specified in normalized coordinates.
#[unsafe(method(objectMinimumNormalizedRadius))]
#[unsafe(method_family = none)]
pub unsafe fn objectMinimumNormalizedRadius(&self) -> c_float;
/// Setter for [`objectMinimumNormalizedRadius`][Self::objectMinimumNormalizedRadius].
#[unsafe(method(setObjectMinimumNormalizedRadius:))]
#[unsafe(method_family = none)]
pub unsafe fn setObjectMinimumNormalizedRadius(
&self,
object_minimum_normalized_radius: c_float,
);
#[deprecated]
#[unsafe(method(minimumObjectSize))]
#[unsafe(method_family = none)]
pub unsafe fn minimumObjectSize(&self) -> c_float;
/// Setter for [`minimumObjectSize`][Self::minimumObjectSize].
#[deprecated]
#[unsafe(method(setMinimumObjectSize:))]
#[unsafe(method_family = none)]
pub unsafe fn setMinimumObjectSize(&self, minimum_object_size: c_float);
/// Specifies the maximum radius of the bounding circle of the object to be tracked. This can be used to filter out unwanted trajectories from larger objects moving through the scene. The default is 1.0, which means no filtering is applied. Changing the maximum from frame to frame can produce eratic trajectories as objects will either disappear or be added to the tracking base on this filtering. The size is specified in normalized coordinates.
#[unsafe(method(objectMaximumNormalizedRadius))]
#[unsafe(method_family = none)]
pub unsafe fn objectMaximumNormalizedRadius(&self) -> c_float;
/// Setter for [`objectMaximumNormalizedRadius`][Self::objectMaximumNormalizedRadius].
#[unsafe(method(setObjectMaximumNormalizedRadius:))]
#[unsafe(method_family = none)]
pub unsafe fn setObjectMaximumNormalizedRadius(
&self,
object_maximum_normalized_radius: c_float,
);
#[deprecated]
#[unsafe(method(maximumObjectSize))]
#[unsafe(method_family = none)]
pub unsafe fn maximumObjectSize(&self) -> c_float;
/// Setter for [`maximumObjectSize`][Self::maximumObjectSize].
#[deprecated]
#[unsafe(method(setMaximumObjectSize:))]
#[unsafe(method_family = none)]
pub unsafe fn setMaximumObjectSize(&self, maximum_object_size: c_float);
#[cfg(feature = "objc2-core-media")]
/// Specifies the desired target frame time for processing trajectory detection. This can be used for real-time processing of frames, which requires execution with a specific amount of time. The target frame time is evaluated from frame-to-frame. If processing takes longer than this target frame time for the currect frame, it will attempt to reduce the amount of time taken by reducing the accuracy (down to a set minimum) for the next frame. If a frame takes less time than this target, then accuracy of the next frame will be increased (up to a set maximum). The default value is kCMTimeIndefinite, meaning accuracy stays at the predefined maximum.
#[unsafe(method(targetFrameTime))]
#[unsafe(method_family = none)]
pub unsafe fn targetFrameTime(&self) -> CMTime;
#[cfg(feature = "objc2-core-media")]
/// Setter for [`targetFrameTime`][Self::targetFrameTime].
#[unsafe(method(setTargetFrameTime:))]
#[unsafe(method_family = none)]
pub unsafe fn setTargetFrameTime(&self, target_frame_time: CMTime);
#[cfg(feature = "VNObservation")]
/// Provides VNTrajectoryObservation results.
#[unsafe(method(results))]
#[unsafe(method_family = none)]
pub unsafe fn results(&self) -> Option<Retained<NSArray<VNTrajectoryObservation>>>;
);
}
/// Methods declared on superclass `VNStatefulRequest`.
#[cfg(all(feature = "VNRequest", feature = "VNStatefulRequest"))]
impl VNDetectTrajectoriesRequest {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[cfg(feature = "block2")]
/// # Safety
///
/// `completion_handler` must be a valid pointer or null.
#[unsafe(method(initWithCompletionHandler:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCompletionHandler(
this: Allocated<Self>,
completion_handler: VNRequestCompletionHandler,
) -> Retained<Self>;
);
}
/// [Apple's documentation](https://developer.apple.com/documentation/vision/vndetecttrajectoriesrequestrevision1?language=objc)
pub static VNDetectTrajectoriesRequestRevision1: NSUInteger = 1;