objc2_av_foundation/generated/AVCaptureSystemExposureBiasSlider.rs
1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6
7use crate::*;
8
9extern_class!(
10 /// The system's recommended continuous exposure bias control for `-[AVCaptureDevice exposureTargetBias]`.
11 ///
12 ///
13 /// `AVCaptureSystemExposureBiasSlider` uses the range specified by `systemRecommendedExposureBiasRange` on the `activeFormat` from the `AVCaptureDevice` specified during initialization. As the device's `activeFormat` changes, the slider updates its range with the new format's `systemRecommendedExposureBiasRange`.
14 ///
15 /// Controls may be added to an `AVCaptureSession` using `-[AVCaptureSession addControl:]`.
16 ///
17 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avcapturesystemexposurebiasslider?language=objc)
18 #[unsafe(super(AVCaptureControl, NSObject))]
19 #[derive(Debug, PartialEq, Eq, Hash)]
20 #[cfg(feature = "AVCaptureControl")]
21 pub struct AVCaptureSystemExposureBiasSlider;
22);
23
24#[cfg(feature = "AVCaptureControl")]
25unsafe impl NSObjectProtocol for AVCaptureSystemExposureBiasSlider {}
26
27#[cfg(feature = "AVCaptureControl")]
28impl AVCaptureSystemExposureBiasSlider {
29 extern_methods!(
30 #[cfg(feature = "AVCaptureDevice")]
31 /// Initializes an `AVCaptureSystemExposureBiasSlider` for controlling `device`.
32 ///
33 ///
34 /// Parameter `device`: The device to control.
35 ///
36 ///
37 /// `AVCaptureSystemExposureBiasSlider` may only be initialized with `AVCaptureDevice` instances that support setting `exposureTargetBias`, otherwise an `NSInvalidArgumentException` is thrown.
38 #[unsafe(method(initWithDevice:))]
39 #[unsafe(method_family = init)]
40 pub unsafe fn initWithDevice(
41 this: Allocated<Self>,
42 device: &AVCaptureDevice,
43 ) -> Retained<Self>;
44
45 #[cfg(all(feature = "AVCaptureDevice", feature = "block2"))]
46 /// Initializes an `AVCaptureSystemExposureBiasSlider` for controlling `device` with a `
47 /// MainThreadOnly` `action` for handling `exposureTargetBias` changes.
48 ///
49 ///
50 /// Parameter `device`: The device to control.
51 ///
52 /// Parameter `action`: An action called on `
53 /// MainThreadOnly` to handle `exposureTargetBias` changes by `AVCaptureSystemExposureBiasSlider`.
54 ///
55 ///
56 /// `action` is **only** called when `exposureTargetBias` is changed by this control. Clients should not change `exposureTargetBias` on the device when `action` is called.
57 ///
58 /// If you need to react to other sources of `exposureTargetBias` changes, you will still need to use key-value observation.
59 ///
60 /// `AVCaptureSystemExposureBiasSlider` may only be initialized with `AVCaptureDevice` instances that support setting `exposureTargetBias`, otherwise an `NSInvalidArgumentException` is thrown.
61 #[unsafe(method(initWithDevice:action:))]
62 #[unsafe(method_family = init)]
63 pub unsafe fn initWithDevice_action(
64 this: Allocated<Self>,
65 device: &AVCaptureDevice,
66 action: &block2::Block<dyn Fn(c_float)>,
67 ) -> Retained<Self>;
68 );
69}
70
71/// Methods declared on superclass `AVCaptureControl`.
72#[cfg(feature = "AVCaptureControl")]
73impl AVCaptureSystemExposureBiasSlider {
74 extern_methods!(
75 #[unsafe(method(init))]
76 #[unsafe(method_family = init)]
77 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
78
79 #[unsafe(method(new))]
80 #[unsafe(method_family = new)]
81 pub unsafe fn new() -> Retained<Self>;
82 );
83}