objc2_vision/generated/VNStatefulRequest.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-media")]
6use objc2_core_media::*;
7use objc2_foundation::*;
8
9use crate::*;
10
11extern_class!(
12 /// A request that builds evidence over time by being reused on multiple images.
13 ///
14 /// The request requires the use of CMSampleBuffers with timestamps as input; otherwise, a VNErrorTimeStampNotFound error will be returned. VNStatefulRequest is used as a base class of other requests, so no objects of this class should be created directly.
15 ///
16 /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vnstatefulrequest?language=objc)
17 #[unsafe(super(VNImageBasedRequest, VNRequest, NSObject))]
18 #[derive(Debug, PartialEq, Eq, Hash)]
19 #[cfg(feature = "VNRequest")]
20 pub struct VNStatefulRequest;
21);
22
23#[cfg(feature = "VNRequest")]
24extern_conformance!(
25 unsafe impl NSCopying for VNStatefulRequest {}
26);
27
28#[cfg(feature = "VNRequest")]
29unsafe impl CopyingHelper for VNStatefulRequest {
30 type Result = Self;
31}
32
33#[cfg(feature = "VNRequest")]
34extern_conformance!(
35 unsafe impl NSObjectProtocol for VNStatefulRequest {}
36);
37
38#[cfg(feature = "VNRequest")]
39impl VNStatefulRequest {
40 extern_methods!(
41 #[unsafe(method(new))]
42 #[unsafe(method_family = new)]
43 pub unsafe fn new() -> Retained<Self>;
44
45 #[unsafe(method(init))]
46 #[unsafe(method_family = init)]
47 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
48
49 #[cfg(feature = "block2")]
50 #[unsafe(method(initWithCompletionHandler:))]
51 #[unsafe(method_family = init)]
52 pub unsafe fn initWithCompletionHandler(
53 this: Allocated<Self>,
54 completion_handler: VNRequestCompletionHandler,
55 ) -> Retained<Self>;
56
57 #[cfg(all(feature = "block2", feature = "objc2-core-media"))]
58 /// Create a new video-based stateful request.
59 ///
60 ///
61 /// Parameter `frameAnalysisSpacing`: The reciprocal of 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 of the time stamps of the samplebuffers being processed.
62 ///
63 /// 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.
64 #[unsafe(method(initWithFrameAnalysisSpacing:completionHandler:))]
65 #[unsafe(method_family = init)]
66 pub unsafe fn initWithFrameAnalysisSpacing_completionHandler(
67 this: Allocated<Self>,
68 frame_analysis_spacing: CMTime,
69 completion_handler: VNRequestCompletionHandler,
70 ) -> Retained<Self>;
71
72 /// The minimum number of frames that the request has to process on before reporting back any observation. This information is provided by the request once initialized with its required paramters.
73 ///
74 /// Video based request often need a minimum number of frames before they can report back any observation. An example would be that a movement detection requires at least 5 frames to be detected. The minimumLatencyFrameCount for that request would report 5 and only after 5 frames have been processed an observation would be returned in the results. This latency is indicative of how responsive a request is in respect to the incoming data.
75 #[unsafe(method(minimumLatencyFrameCount))]
76 #[unsafe(method_family = none)]
77 pub unsafe fn minimumLatencyFrameCount(&self) -> NSInteger;
78
79 #[cfg(feature = "objc2-core-media")]
80 /// The reciprocal of maximum rate at which buffers will be processed.
81 ///
82 /// 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 of the time stamps of the samplebuffers being processed.
83 #[unsafe(method(frameAnalysisSpacing))]
84 #[unsafe(method_family = none)]
85 pub unsafe fn frameAnalysisSpacing(&self) -> CMTime;
86 );
87}