objc2_cinematic/generated/
CNScript.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-av-foundation")]
7use objc2_av_foundation::*;
8#[cfg(feature = "objc2-core-media")]
9use objc2_core_media::*;
10use objc2_foundation::*;
11
12use crate::*;
13
14extern_class!(
15 #[unsafe(super(NSObject))]
23 #[derive(Debug, PartialEq, Eq, Hash)]
24 pub struct CNScript;
25);
26
27unsafe impl Send for CNScript {}
28
29unsafe impl Sync for CNScript {}
30
31extern_conformance!(
32 unsafe impl NSObjectProtocol for CNScript {}
33);
34
35impl CNScript {
36 extern_methods!(
37 #[cfg(all(feature = "block2", feature = "objc2-av-foundation"))]
38 #[unsafe(method(loadFromAsset:changes:progress:completionHandler:))]
45 #[unsafe(method_family = none)]
46 pub unsafe fn loadFromAsset_changes_progress_completionHandler(
47 asset: &AVAsset,
48 changes: Option<&CNScriptChanges>,
49 progress: Option<&NSProgress>,
50 completion_handler: &block2::DynBlock<dyn Fn(*mut CNScript, *mut NSError)>,
51 );
52
53 #[unsafe(method(reloadWithChanges:))]
58 #[unsafe(method_family = none)]
59 pub unsafe fn reloadWithChanges(&self, changes: Option<&CNScriptChanges>);
60
61 #[unsafe(method(changes))]
63 #[unsafe(method_family = none)]
64 pub unsafe fn changes(&self) -> Retained<CNScriptChanges>;
65
66 #[cfg(feature = "objc2-core-media")]
67 #[unsafe(method(changesTrimmedByTimeRange:))]
69 #[unsafe(method_family = none)]
70 pub unsafe fn changesTrimmedByTimeRange(
71 &self,
72 time_range: CMTimeRange,
73 ) -> Retained<CNScriptChanges>;
74
75 #[cfg(feature = "objc2-core-media")]
76 #[unsafe(method(timeRange))]
78 #[unsafe(method_family = none)]
79 pub unsafe fn timeRange(&self) -> CMTimeRange;
80
81 #[cfg(feature = "objc2-core-media")]
82 #[unsafe(method(frameAtTime:tolerance:))]
84 #[unsafe(method_family = none)]
85 pub unsafe fn frameAtTime_tolerance(
86 &self,
87 time: CMTime,
88 tolerance: CMTime,
89 ) -> Option<Retained<CNScriptFrame>>;
90
91 #[cfg(feature = "objc2-core-media")]
92 #[unsafe(method(framesInTimeRange:))]
94 #[unsafe(method_family = none)]
95 pub unsafe fn framesInTimeRange(
96 &self,
97 time_range: CMTimeRange,
98 ) -> Retained<NSArray<CNScriptFrame>>;
99
100 #[cfg(all(feature = "CNDecision", feature = "objc2-core-media"))]
101 #[unsafe(method(decisionAtTime:tolerance:))]
103 #[unsafe(method_family = none)]
104 pub unsafe fn decisionAtTime_tolerance(
105 &self,
106 time: CMTime,
107 tolerance: CMTime,
108 ) -> Option<Retained<CNDecision>>;
109
110 #[cfg(all(feature = "CNDecision", feature = "objc2-core-media"))]
111 #[unsafe(method(decisionsInTimeRange:))]
113 #[unsafe(method_family = none)]
114 pub unsafe fn decisionsInTimeRange(
115 &self,
116 time_range: CMTimeRange,
117 ) -> Retained<NSArray<CNDecision>>;
118
119 #[cfg(all(feature = "CNDecision", feature = "objc2-core-media"))]
120 #[unsafe(method(decisionAfterTime:))]
122 #[unsafe(method_family = none)]
123 pub unsafe fn decisionAfterTime(&self, time: CMTime) -> Option<Retained<CNDecision>>;
124
125 #[cfg(all(feature = "CNDecision", feature = "objc2-core-media"))]
126 #[unsafe(method(decisionBeforeTime:))]
128 #[unsafe(method_family = none)]
129 pub unsafe fn decisionBeforeTime(&self, time: CMTime) -> Option<Retained<CNDecision>>;
130
131 #[cfg(all(feature = "CNDecision", feature = "objc2-core-media"))]
132 #[unsafe(method(primaryDecisionAtTime:))]
135 #[unsafe(method_family = none)]
136 pub unsafe fn primaryDecisionAtTime(&self, time: CMTime) -> Option<Retained<CNDecision>>;
137
138 #[cfg(all(feature = "CNDecision", feature = "objc2-core-media"))]
139 #[unsafe(method(secondaryDecisionAtTime:))]
141 #[unsafe(method_family = none)]
142 pub unsafe fn secondaryDecisionAtTime(&self, time: CMTime) -> Option<Retained<CNDecision>>;
143
144 #[cfg(all(feature = "CNDecision", feature = "objc2-core-media"))]
145 #[unsafe(method(timeRangeOfTransitionAfterDecision:))]
147 #[unsafe(method_family = none)]
148 pub unsafe fn timeRangeOfTransitionAfterDecision(
149 &self,
150 decision: &CNDecision,
151 ) -> CMTimeRange;
152
153 #[cfg(all(feature = "CNDecision", feature = "objc2-core-media"))]
154 #[unsafe(method(timeRangeOfTransitionBeforeDecision:))]
156 #[unsafe(method_family = none)]
157 pub unsafe fn timeRangeOfTransitionBeforeDecision(
158 &self,
159 decision: &CNDecision,
160 ) -> CMTimeRange;
161
162 #[cfg(all(feature = "CNDecision", feature = "objc2-core-media"))]
163 #[unsafe(method(userDecisionsInTimeRange:))]
165 #[unsafe(method_family = none)]
166 pub unsafe fn userDecisionsInTimeRange(
167 &self,
168 time_range: CMTimeRange,
169 ) -> Retained<NSArray<CNDecision>>;
170
171 #[cfg(all(feature = "CNDecision", feature = "objc2-core-media"))]
172 #[unsafe(method(baseDecisionsInTimeRange:))]
174 #[unsafe(method_family = none)]
175 pub unsafe fn baseDecisionsInTimeRange(
176 &self,
177 time_range: CMTimeRange,
178 ) -> Retained<NSArray<CNDecision>>;
179
180 #[cfg(all(feature = "CNDetection", feature = "CNDetectionTrack"))]
181 #[unsafe(method(detectionTrackForID:))]
183 #[unsafe(method_family = none)]
184 pub unsafe fn detectionTrackForID(
185 &self,
186 detection_id: CNDetectionID,
187 ) -> Option<Retained<CNDetectionTrack>>;
188
189 #[cfg(all(feature = "CNDecision", feature = "CNDetectionTrack"))]
190 #[unsafe(method(detectionTrackForDecision:))]
192 #[unsafe(method_family = none)]
193 pub unsafe fn detectionTrackForDecision(
194 &self,
195 decision: &CNDecision,
196 ) -> Option<Retained<CNDetectionTrack>>;
197
198 #[unsafe(method(fNumber))]
204 #[unsafe(method_family = none)]
205 pub unsafe fn fNumber(&self) -> c_float;
206
207 #[unsafe(method(setFNumber:))]
209 #[unsafe(method_family = none)]
210 pub unsafe fn setFNumber(&self, f_number: c_float);
211
212 #[cfg(feature = "CNDecision")]
213 #[unsafe(method(addUserDecision:))]
219 #[unsafe(method_family = none)]
220 pub unsafe fn addUserDecision(&self, decision: &CNDecision) -> bool;
221
222 #[cfg(feature = "CNDecision")]
223 #[unsafe(method(removeUserDecision:))]
230 #[unsafe(method_family = none)]
231 pub unsafe fn removeUserDecision(&self, decision: &CNDecision) -> bool;
232
233 #[unsafe(method(removeAllUserDecisions))]
235 #[unsafe(method_family = none)]
236 pub unsafe fn removeAllUserDecisions(&self);
237
238 #[cfg(all(feature = "CNDetection", feature = "CNDetectionTrack"))]
239 #[unsafe(method(addDetectionTrack:))]
243 #[unsafe(method_family = none)]
244 pub unsafe fn addDetectionTrack(&self, detection_track: &CNDetectionTrack)
245 -> CNDetectionID;
246
247 #[cfg(feature = "CNDetectionTrack")]
248 #[unsafe(method(removeDetectionTrack:))]
254 #[unsafe(method_family = none)]
255 pub unsafe fn removeDetectionTrack(&self, detection_track: &CNDetectionTrack) -> bool;
256
257 #[cfg(feature = "CNDetectionTrack")]
258 #[unsafe(method(addedDetectionTracks))]
260 #[unsafe(method_family = none)]
261 pub unsafe fn addedDetectionTracks(&self) -> Retained<NSArray<CNDetectionTrack>>;
262
263 #[unsafe(method(init))]
264 #[unsafe(method_family = init)]
265 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
266
267 #[unsafe(method(new))]
268 #[unsafe(method_family = new)]
269 pub unsafe fn new() -> Retained<Self>;
270 );
271}
272
273extern_class!(
274 #[unsafe(super(NSObject))]
279 #[derive(Debug, PartialEq, Eq, Hash)]
280 pub struct CNScriptChanges;
281);
282
283extern_conformance!(
284 unsafe impl NSObjectProtocol for CNScriptChanges {}
285);
286
287impl CNScriptChanges {
288 extern_methods!(
289 #[unsafe(method(initWithDataRepresentation:))]
291 #[unsafe(method_family = init)]
292 pub unsafe fn initWithDataRepresentation(
293 this: Allocated<Self>,
294 data_representation: &NSData,
295 ) -> Option<Retained<Self>>;
296
297 #[unsafe(method(dataRepresentation))]
301 #[unsafe(method_family = none)]
302 pub unsafe fn dataRepresentation(&self) -> Retained<NSData>;
303
304 #[unsafe(method(fNumber))]
306 #[unsafe(method_family = none)]
307 pub unsafe fn fNumber(&self) -> c_float;
308
309 #[cfg(feature = "CNDecision")]
310 #[unsafe(method(userDecisions))]
312 #[unsafe(method_family = none)]
313 pub unsafe fn userDecisions(&self) -> Retained<NSArray<CNDecision>>;
314
315 #[cfg(feature = "CNDetectionTrack")]
316 #[unsafe(method(addedDetectionTracks))]
318 #[unsafe(method_family = none)]
319 pub unsafe fn addedDetectionTracks(&self) -> Retained<NSArray<CNDetectionTrack>>;
320
321 #[unsafe(method(init))]
322 #[unsafe(method_family = init)]
323 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
324
325 #[unsafe(method(new))]
326 #[unsafe(method_family = new)]
327 pub unsafe fn new() -> Retained<Self>;
328 );
329}
330
331extern_class!(
332 #[unsafe(super(NSObject))]
344 #[derive(Debug, PartialEq, Eq, Hash)]
345 pub struct CNScriptFrame;
346);
347
348unsafe impl Send for CNScriptFrame {}
349
350unsafe impl Sync for CNScriptFrame {}
351
352extern_conformance!(
353 unsafe impl NSCopying for CNScriptFrame {}
354);
355
356unsafe impl CopyingHelper for CNScriptFrame {
357 type Result = Self;
358}
359
360extern_conformance!(
361 unsafe impl NSObjectProtocol for CNScriptFrame {}
362);
363
364impl CNScriptFrame {
365 extern_methods!(
366 #[cfg(feature = "objc2-core-media")]
367 #[unsafe(method(time))]
369 #[unsafe(method_family = none)]
370 pub unsafe fn time(&self) -> CMTime;
371
372 #[unsafe(method(focusDisparity))]
378 #[unsafe(method_family = none)]
379 pub unsafe fn focusDisparity(&self) -> c_float;
380
381 #[cfg(feature = "CNDetection")]
382 #[unsafe(method(focusDetection))]
386 #[unsafe(method_family = none)]
387 pub unsafe fn focusDetection(&self) -> Retained<CNDetection>;
388
389 #[cfg(feature = "CNDetection")]
390 #[unsafe(method(allDetections))]
392 #[unsafe(method_family = none)]
393 pub unsafe fn allDetections(&self) -> Retained<NSArray<CNDetection>>;
394
395 #[unsafe(method(init))]
396 #[unsafe(method_family = init)]
397 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
398
399 #[unsafe(method(new))]
400 #[unsafe(method_family = new)]
401 pub unsafe fn new() -> Retained<Self>;
402 );
403}
404
405impl CNScriptFrame {
407 extern_methods!(
408 #[cfg(feature = "CNDetection")]
409 #[unsafe(method(detectionForID:))]
411 #[unsafe(method_family = none)]
412 pub unsafe fn detectionForID(
413 &self,
414 detection_id: CNDetectionID,
415 ) -> Option<Retained<CNDetection>>;
416
417 #[cfg(feature = "CNDetection")]
418 #[unsafe(method(bestDetectionForGroupID:))]
421 #[unsafe(method_family = none)]
422 pub unsafe fn bestDetectionForGroupID(
423 &self,
424 detection_group_id: CNDetectionGroupID,
425 ) -> Option<Retained<CNDetection>>;
426 );
427}