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")]
25extern_conformance!(
26 unsafe impl NSObjectProtocol for AVCaptureSystemExposureBiasSlider {}
27);
28
29#[cfg(feature = "AVCaptureControl")]
30impl AVCaptureSystemExposureBiasSlider {
31 extern_methods!(
32 #[cfg(feature = "AVCaptureDevice")]
33 /// Initializes an `AVCaptureSystemExposureBiasSlider` for controlling `device`.
34 ///
35 ///
36 /// Parameter `device`: The device to control.
37 ///
38 ///
39 /// `AVCaptureSystemExposureBiasSlider` may only be initialized with `AVCaptureDevice` instances that support setting `exposureTargetBias`, otherwise an `NSInvalidArgumentException` is thrown.
40 #[unsafe(method(initWithDevice:))]
41 #[unsafe(method_family = init)]
42 pub unsafe fn initWithDevice(
43 this: Allocated<Self>,
44 device: &AVCaptureDevice,
45 ) -> Retained<Self>;
46
47 #[cfg(all(feature = "AVCaptureDevice", feature = "block2"))]
48 /// Initializes an `AVCaptureSystemExposureBiasSlider` for controlling `device` with a `
49 /// MainThreadOnly` `action` for handling `exposureTargetBias` changes.
50 ///
51 ///
52 /// Parameter `device`: The device to control.
53 ///
54 /// Parameter `action`: An action called on `
55 /// MainThreadOnly` to handle `exposureTargetBias` changes by `AVCaptureSystemExposureBiasSlider`.
56 ///
57 ///
58 /// `action` is **only** called when `exposureTargetBias` is changed by this control. Clients should not change `exposureTargetBias` on the device when `action` is called.
59 ///
60 /// If you need to react to other sources of `exposureTargetBias` changes, you will still need to use key-value observation.
61 ///
62 /// `AVCaptureSystemExposureBiasSlider` may only be initialized with `AVCaptureDevice` instances that support setting `exposureTargetBias`, otherwise an `NSInvalidArgumentException` is thrown.
63 #[unsafe(method(initWithDevice:action:))]
64 #[unsafe(method_family = init)]
65 pub unsafe fn initWithDevice_action(
66 this: Allocated<Self>,
67 device: &AVCaptureDevice,
68 action: &block2::DynBlock<dyn Fn(c_float)>,
69 ) -> Retained<Self>;
70 );
71}
72
73/// Methods declared on superclass `AVCaptureControl`.
74#[cfg(feature = "AVCaptureControl")]
75impl AVCaptureSystemExposureBiasSlider {
76 extern_methods!(
77 #[unsafe(method(init))]
78 #[unsafe(method_family = init)]
79 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
80
81 #[unsafe(method(new))]
82 #[unsafe(method_family = new)]
83 pub unsafe fn new() -> Retained<Self>;
84 );
85}