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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-media")]
use objc2_core_media::*;
use objc2_foundation::*;
use crate::*;
/// AVCaptureReactionType string constants
///
///
/// Constants indicating the type of reaction that can be performed in an effect.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avcapturereactiontype?language=objc)
// NS_TYPED_ENUM
pub type AVCaptureReactionType = NSString;
extern "C" {
/// Indicates a reaction which features a thumbs-up symbol.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avcapturereactiontypethumbsup?language=objc)
pub static AVCaptureReactionTypeThumbsUp: &'static AVCaptureReactionType;
}
extern "C" {
/// Indicates a reaction which features a thumbs-down symbol.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avcapturereactiontypethumbsdown?language=objc)
pub static AVCaptureReactionTypeThumbsDown: &'static AVCaptureReactionType;
}
extern "C" {
/// Indicates a reaction which features balloons rising through the scene.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avcapturereactiontypeballoons?language=objc)
pub static AVCaptureReactionTypeBalloons: &'static AVCaptureReactionType;
}
extern "C" {
/// Indicates a reaction which features one or more heart symbols.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avcapturereactiontypeheart?language=objc)
pub static AVCaptureReactionTypeHeart: &'static AVCaptureReactionType;
}
extern "C" {
/// Indicates a reaction which features fireworks bursting in the background.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avcapturereactiontypefireworks?language=objc)
pub static AVCaptureReactionTypeFireworks: &'static AVCaptureReactionType;
}
extern "C" {
/// Indicates a reaction which features a dark and stormy night.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avcapturereactiontyperain?language=objc)
pub static AVCaptureReactionTypeRain: &'static AVCaptureReactionType;
}
extern "C" {
/// Indicates a reaction which features festive spots of color falling through the scene.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avcapturereactiontypeconfetti?language=objc)
pub static AVCaptureReactionTypeConfetti: &'static AVCaptureReactionType;
}
extern "C" {
/// Indicates a reaction which features a bright laser display projecting into the scene.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avcapturereactiontypelasers?language=objc)
pub static AVCaptureReactionTypeLasers: &'static AVCaptureReactionType;
}
/// Returns the name for UIImage or NSImage systemImageNamed: method to obtain the recommended iconography for a specified reaction type.
#[inline]
pub unsafe extern "C-unwind" fn AVCaptureReactionSystemImageNameForType(
reaction_type: &AVCaptureReactionType,
) -> Retained<NSString> {
extern "C-unwind" {
fn AVCaptureReactionSystemImageNameForType(
reaction_type: &AVCaptureReactionType,
) -> *mut NSString;
}
let ret = unsafe { AVCaptureReactionSystemImageNameForType(reaction_type) };
unsafe { Retained::retain_autoreleased(ret) }
.expect("function was marked as returning non-null, but actually returned NULL")
}
extern_class!(
/// Reports the state of a reaction performed on an AVCaptureDevice.
///
///
/// AVCaptureReactionEffectState may be obtained by calling -[AVCaptureDevice reactionEffectsInProgress]. When -[AVCaptureDevice canPerformReactionEffects] returns YES, new entries are added either by calling -[AVCaptureDevice performEffectForReaction:], or by gesture detection in the capture stream when AVCaptureDevice.reactionEffectGesturesEnabled. The effect rendering is done before frames are given to the capture client, and these status objects let you know when these effects are performed.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avcapturereactioneffectstate?language=objc)
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct AVCaptureReactionEffectState;
);
extern_conformance!(
unsafe impl NSObjectProtocol for AVCaptureReactionEffectState {}
);
impl AVCaptureReactionEffectState {
extern_methods!(
/// Indicates the reaction which is running.
///
///
/// There may be multiple reactions of the same type at a given time. Some may come from gesture detection, some may come from calls to -[AVCaptureDevice performReactionEffect:]
#[unsafe(method(reactionType))]
#[unsafe(method_family = none)]
pub unsafe fn reactionType(&self) -> Retained<AVCaptureReactionType>;
#[cfg(feature = "objc2-core-media")]
/// Provides the presentation time of the first frame where the effect is being rendered.
#[unsafe(method(startTime))]
#[unsafe(method_family = none)]
pub unsafe fn startTime(&self) -> CMTime;
#[cfg(feature = "objc2-core-media")]
/// Provides the presentation time of the frame following the last frame where the effect is seen.
///
///
/// Will be kCMTimeInvalid while the effect is in progress, but will be updated to a valid time when the reaction effect completes and the AVCaptureReactionEffectState is removed from -[AVCaptureDevice reactionEffectsInProgress]. (If using NSKeyValueObservingOptionOld, you can access completed effects with valid end times via NSKeyValueChangeOldKey.)
#[unsafe(method(endTime))]
#[unsafe(method_family = none)]
pub unsafe fn endTime(&self) -> CMTime;
);
}
/// Methods declared on superclass `NSObject`.
impl AVCaptureReactionEffectState {
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>;
);
}