objc2_media_accessibility/generated/
MAFlashingLightsProcessing.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5#[cfg(feature = "objc2")]
6use objc2::__framework_prelude::*;
7use objc2_core_foundation::*;
8#[cfg(feature = "objc2-foundation")]
9use objc2_foundation::*;
10#[cfg(feature = "objc2-io-surface")]
11use objc2_io_surface::*;
12
13use crate::*;
14
15#[cfg(feature = "objc2")]
16extern_class!(
17    /// [Apple's documentation](https://developer.apple.com/documentation/mediaaccessibility/maflashinglightsprocessorresult?language=objc)
18    #[unsafe(super(NSObject))]
19    #[derive(Debug, PartialEq, Eq, Hash)]
20    #[cfg(feature = "objc2")]
21    pub struct MAFlashingLightsProcessorResult;
22);
23
24#[cfg(feature = "objc2")]
25extern_conformance!(
26    unsafe impl NSObjectProtocol for MAFlashingLightsProcessorResult {}
27);
28
29#[cfg(feature = "objc2")]
30impl MAFlashingLightsProcessorResult {
31    extern_methods!(
32        #[unsafe(method(surfaceProcessed))]
33        #[unsafe(method_family = none)]
34        pub unsafe fn surfaceProcessed(&self) -> bool;
35
36        #[unsafe(method(mitigationLevel))]
37        #[unsafe(method_family = none)]
38        pub unsafe fn mitigationLevel(&self) -> c_float;
39
40        #[unsafe(method(intensityLevel))]
41        #[unsafe(method_family = none)]
42        pub unsafe fn intensityLevel(&self) -> c_float;
43    );
44}
45
46/// Methods declared on superclass `NSObject`.
47#[cfg(feature = "objc2")]
48impl MAFlashingLightsProcessorResult {
49    extern_methods!(
50        #[unsafe(method(init))]
51        #[unsafe(method_family = init)]
52        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
53
54        #[unsafe(method(new))]
55        #[unsafe(method_family = new)]
56        pub unsafe fn new() -> Retained<Self>;
57    );
58}
59
60/// [Apple's documentation](https://developer.apple.com/documentation/mediaaccessibility/maflashinglightsprocessoroptionkey?language=objc)
61// NS_TYPED_EXTENSIBLE_ENUM
62#[cfg(feature = "objc2-foundation")]
63pub type MAFlashingLightsProcessorOptionKey = NSString;
64
65#[cfg(feature = "objc2")]
66extern_class!(
67    /// [Apple's documentation](https://developer.apple.com/documentation/mediaaccessibility/maflashinglightsprocessor?language=objc)
68    #[unsafe(super(NSObject))]
69    #[derive(Debug, PartialEq, Eq, Hash)]
70    #[cfg(feature = "objc2")]
71    pub struct MAFlashingLightsProcessor;
72);
73
74#[cfg(feature = "objc2")]
75extern_conformance!(
76    unsafe impl NSObjectProtocol for MAFlashingLightsProcessor {}
77);
78
79#[cfg(feature = "objc2")]
80impl MAFlashingLightsProcessor {
81    extern_methods!(
82        #[cfg(feature = "objc2-io-surface")]
83        /// Determines whether the flashing lights processor is able to process the content in the surface for flashing lights. This might be false on
84        /// unsupported hardware or unsupported color spaces.
85        ///
86        /// Returns: A boolean result.
87        #[unsafe(method(canProcessSurface:))]
88        #[unsafe(method_family = none)]
89        pub unsafe fn canProcessSurface(&self, surface: &IOSurfaceRef) -> bool;
90
91        #[cfg(all(feature = "objc2-foundation", feature = "objc2-io-surface"))]
92        /// Processes an inSurface by analyzing pixels for sequences of flashing lights and then darkens content to reduce the risk of discomfort from some users.
93        /// The outSurface will contain the mitigated content.
94        /// The timestamp indicates the time at which the surface will be shown in the video playback. FPS will be determined based on the values of the timestamps.
95        /// Options dictionary for additional parameters.
96        ///
97        /// Returns: An object which indicates whether the surface was able to be processed, the amount of mitigation that was applied, and the intensitry level that was detected.
98        ///
99        /// # Safety
100        ///
101        /// `options` generic should be of the correct type.
102        #[unsafe(method(processSurface:outSurface:timestamp:options:))]
103        #[unsafe(method_family = none)]
104        pub unsafe fn processSurface_outSurface_timestamp_options(
105            &self,
106            in_surface: &IOSurfaceRef,
107            out_surface: &IOSurfaceRef,
108            timestamp: CFAbsoluteTime,
109            options: Option<&NSDictionary<MAFlashingLightsProcessorOptionKey, AnyObject>>,
110        ) -> Retained<MAFlashingLightsProcessorResult>;
111    );
112}
113
114/// Methods declared on superclass `NSObject`.
115#[cfg(feature = "objc2")]
116impl MAFlashingLightsProcessor {
117    extern_methods!(
118        #[unsafe(method(init))]
119        #[unsafe(method_family = init)]
120        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
121
122        #[unsafe(method(new))]
123        #[unsafe(method_family = new)]
124        pub unsafe fn new() -> Retained<Self>;
125    );
126}