objc2_av_foundation/generated/AVCaptureSystemPressure.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::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9/// AVCaptureSystemPressureLevel string constants
10///
11///
12/// The AVCaptureSystemPressureLevel string constants describe varying levels of system pressure that affect capture hardware availability and/or quality.
13///
14/// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avcapturesystempressurelevel?language=objc)
15// NS_TYPED_ENUM
16pub type AVCaptureSystemPressureLevel = NSString;
17
18extern "C" {
19 /// System pressure level is normal (not pressured).
20 ///
21 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avcapturesystempressurelevelnominal?language=objc)
22 pub static AVCaptureSystemPressureLevelNominal: &'static AVCaptureSystemPressureLevel;
23}
24
25extern "C" {
26 /// System pressure is slightly elevated.
27 ///
28 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avcapturesystempressurelevelfair?language=objc)
29 pub static AVCaptureSystemPressureLevelFair: &'static AVCaptureSystemPressureLevel;
30}
31
32extern "C" {
33 /// System pressure is highly elevated. Capture performance may be impacted. Frame rate throttling is advised.
34 ///
35 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avcapturesystempressurelevelserious?language=objc)
36 pub static AVCaptureSystemPressureLevelSerious: &'static AVCaptureSystemPressureLevel;
37}
38
39extern "C" {
40 /// System pressure is critically elevated. Capture quality and performance are significantly impacted. Frame rate throttling is highly advised.
41 ///
42 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avcapturesystempressurelevelcritical?language=objc)
43 pub static AVCaptureSystemPressureLevelCritical: &'static AVCaptureSystemPressureLevel;
44}
45
46extern "C" {
47 /// System pressure is beyond critical. Capture must immediately stop.
48 ///
49 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avcapturesystempressurelevelshutdown?language=objc)
50 pub static AVCaptureSystemPressureLevelShutdown: &'static AVCaptureSystemPressureLevel;
51}
52
53/// Constants indicating factors contributing to the current system pressured state.
54///
55///
56/// Indicates that the system is not currently pressured.
57///
58/// Indicates that the entire system is currently experiencing an elevated thermal level.
59///
60/// Indicates that the system's peak power requirements exceed the battery's current capacity and may result in a system power off.
61///
62/// Indicates that the module capturing depth information is operating at an elevated temperature. As system pressure increases, depth quality may become degraded.
63///
64/// Indicates that the camera module is operating at an elevated temperature.
65///
66/// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avcapturesystempressurefactors?language=objc)
67// NS_OPTIONS
68#[repr(transparent)]
69#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
70pub struct AVCaptureSystemPressureFactors(pub NSUInteger);
71bitflags::bitflags! {
72 impl AVCaptureSystemPressureFactors: NSUInteger {
73 #[doc(alias = "AVCaptureSystemPressureFactorNone")]
74 const None = 0;
75 #[doc(alias = "AVCaptureSystemPressureFactorSystemTemperature")]
76 const SystemTemperature = 1<<0;
77 #[doc(alias = "AVCaptureSystemPressureFactorPeakPower")]
78 const PeakPower = 1<<1;
79 #[doc(alias = "AVCaptureSystemPressureFactorDepthModuleTemperature")]
80 const DepthModuleTemperature = 1<<2;
81 #[doc(alias = "AVCaptureSystemPressureFactorCameraTemperature")]
82 const CameraTemperature = 1<<3;
83 }
84}
85
86unsafe impl Encode for AVCaptureSystemPressureFactors {
87 const ENCODING: Encoding = NSUInteger::ENCODING;
88}
89
90unsafe impl RefEncode for AVCaptureSystemPressureFactors {
91 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
92}
93
94extern_class!(
95 /// A model object describing a system pressure level and contributing factors to the pressured state.
96 ///
97 ///
98 /// Beginning in iOS 11.1, AVCaptureDevice can report its current system pressure state. System pressure refers to a state in which capture quality is degraded or capture hardware availability is limited due to factors such as overall system temperature, insufficient battery charge for current peak power requirements, or camera module temperature.
99 ///
100 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avcapturesystempressurestate?language=objc)
101 #[unsafe(super(NSObject))]
102 #[derive(Debug, PartialEq, Eq, Hash)]
103 pub struct AVCaptureSystemPressureState;
104);
105
106extern_conformance!(
107 unsafe impl NSObjectProtocol for AVCaptureSystemPressureState {}
108);
109
110impl AVCaptureSystemPressureState {
111 extern_methods!(
112 #[unsafe(method(init))]
113 #[unsafe(method_family = init)]
114 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
115
116 #[unsafe(method(new))]
117 #[unsafe(method_family = new)]
118 pub unsafe fn new() -> Retained<Self>;
119
120 /// An enumerated string value characterizing the pressure level to which the system is currently elevated.
121 #[unsafe(method(level))]
122 #[unsafe(method_family = none)]
123 pub unsafe fn level(&self) -> Retained<AVCaptureSystemPressureLevel>;
124
125 /// A bitmask of values indicating the factors contributing to the current system pressure level.
126 #[unsafe(method(factors))]
127 #[unsafe(method_family = none)]
128 pub unsafe fn factors(&self) -> AVCaptureSystemPressureFactors;
129 );
130}