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