objc2_av_foundation/generated/AVCaptureStillImageOutput.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#[cfg(feature = "objc2-core-media")]
7use objc2_core_media::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12extern_class!(
13 /// AVCaptureStillImageOutput is a concrete subclass of AVCaptureOutput that can be used to capture high-quality still images with accompanying metadata.
14 ///
15 ///
16 /// Instances of AVCaptureStillImageOutput can be used to capture, on demand, high quality snapshots from a realtime capture source. Clients can request a still image for the current time using the captureStillImageAsynchronouslyFromConnection:completionHandler: method. Clients can also configure still image outputs to produce still images in specific image formats.
17 ///
18 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avcapturestillimageoutput?language=objc)
19 #[unsafe(super(AVCaptureOutput, NSObject))]
20 #[derive(Debug, PartialEq, Eq, Hash)]
21 #[cfg(feature = "AVCaptureOutputBase")]
22 #[deprecated = "Use AVCapturePhotoOutput instead."]
23 pub struct AVCaptureStillImageOutput;
24);
25
26#[cfg(feature = "AVCaptureOutputBase")]
27extern_conformance!(
28 unsafe impl NSObjectProtocol for AVCaptureStillImageOutput {}
29);
30
31#[cfg(feature = "AVCaptureOutputBase")]
32impl AVCaptureStillImageOutput {
33 extern_methods!(
34 #[deprecated = "Use AVCapturePhotoOutput instead."]
35 #[unsafe(method(init))]
36 #[unsafe(method_family = init)]
37 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
38
39 #[unsafe(method(new))]
40 #[unsafe(method_family = new)]
41 pub unsafe fn new() -> Retained<Self>;
42
43 /// Specifies the options the receiver uses to encode still images before they are delivered.
44 ///
45 ///
46 /// See AVVideoSettings.h for more information on how to construct an output settings dictionary.
47 ///
48 /// On iOS, the only currently supported keys are AVVideoCodecKey and kCVPixelBufferPixelFormatTypeKey. Use -availableImageDataCVPixelFormatTypes and -availableImageDataCodecTypes to determine what codec keys and pixel formats are supported. AVVideoQualityKey is supported on iOS 6.0 and later and may only be used when AVVideoCodecKey is set to AVVideoCodecTypeJPEG.
49 #[deprecated = "Use AVCapturePhotoOutput instead."]
50 #[unsafe(method(outputSettings))]
51 #[unsafe(method_family = none)]
52 pub unsafe fn outputSettings(&self) -> Retained<NSDictionary<NSString, AnyObject>>;
53
54 /// Setter for [`outputSettings`][Self::outputSettings].
55 ///
56 /// This is [copied][objc2_foundation::NSCopying::copy] when set.
57 ///
58 /// # Safety
59 ///
60 /// `output_settings` generic should be of the correct type.
61 #[deprecated = "Use AVCapturePhotoOutput instead."]
62 #[unsafe(method(setOutputSettings:))]
63 #[unsafe(method_family = none)]
64 pub unsafe fn setOutputSettings(&self, output_settings: &NSDictionary<NSString, AnyObject>);
65
66 /// Indicates the supported image pixel formats that can be specified in outputSettings.
67 ///
68 ///
69 /// The value of this property is an NSArray of NSNumbers that can be used as values for the kCVPixelBufferPixelFormatTypeKey in the receiver's outputSettings property. The first format in the returned list is the most efficient output format.
70 #[deprecated = "Use AVCapturePhotoOutput instead."]
71 #[unsafe(method(availableImageDataCVPixelFormatTypes))]
72 #[unsafe(method_family = none)]
73 pub unsafe fn availableImageDataCVPixelFormatTypes(&self) -> Retained<NSArray<NSNumber>>;
74
75 #[cfg(feature = "AVVideoSettings")]
76 /// Indicates the supported image codec formats that can be specified in outputSettings.
77 ///
78 ///
79 /// The value of this property is an NSArray of AVVideoCodecTypes that can be used as values for the AVVideoCodecKey in the receiver's outputSettings property.
80 #[deprecated = "Use AVCapturePhotoOutput instead."]
81 #[unsafe(method(availableImageDataCodecTypes))]
82 #[unsafe(method_family = none)]
83 pub unsafe fn availableImageDataCodecTypes(&self) -> Retained<NSArray<AVVideoCodecType>>;
84
85 /// Indicates whether the receiver supports still image stabilization.
86 ///
87 ///
88 /// The receiver's automaticallyEnablesStillImageStabilizationWhenAvailable property can only be set if this property returns YES. Its value may change as the session's -sessionPreset or input device's -activeFormat changes.
89 #[unsafe(method(isStillImageStabilizationSupported))]
90 #[unsafe(method_family = none)]
91 pub unsafe fn isStillImageStabilizationSupported(&self) -> bool;
92
93 /// Indicates whether the receiver should automatically use still image stabilization when necessary.
94 ///
95 ///
96 /// On a receiver where -isStillImageStabilizationSupported returns YES, image stabilization may be applied to reduce blur commonly found in low light photos. When stabilization is enabled, still image captures incur additional latency. The default value is YES when supported, NO otherwise. Setting this property throws an NSInvalidArgumentException if -isStillImageStabilizationSupported returns NO.
97 #[unsafe(method(automaticallyEnablesStillImageStabilizationWhenAvailable))]
98 #[unsafe(method_family = none)]
99 pub unsafe fn automaticallyEnablesStillImageStabilizationWhenAvailable(&self) -> bool;
100
101 /// Setter for [`automaticallyEnablesStillImageStabilizationWhenAvailable`][Self::automaticallyEnablesStillImageStabilizationWhenAvailable].
102 #[unsafe(method(setAutomaticallyEnablesStillImageStabilizationWhenAvailable:))]
103 #[unsafe(method_family = none)]
104 pub unsafe fn setAutomaticallyEnablesStillImageStabilizationWhenAvailable(
105 &self,
106 automatically_enables_still_image_stabilization_when_available: bool,
107 );
108
109 /// Indicates whether still image stabilization is in use for the current capture.
110 ///
111 ///
112 /// On a receiver where -isStillImageStabilizationSupported returns YES, and automaticallyEnablesStillImageStabilizationWhenAvailable is set to YES, this property may be key-value observed, or queried from inside your key-value observation callback for the
113 /// "
114 /// capturingStillImage" property, to find out if still image stabilization is being applied to the current capture.
115 #[unsafe(method(isStillImageStabilizationActive))]
116 #[unsafe(method_family = none)]
117 pub unsafe fn isStillImageStabilizationActive(&self) -> bool;
118
119 /// Indicates whether the receiver should emit still images at the highest resolution supported by its source AVCaptureDevice's activeFormat.
120 ///
121 ///
122 /// By default, AVCaptureStillImageOutput emits images with the same dimensions as its source AVCaptureDevice's activeFormat.formatDescription. However, if you set this property to YES, the receiver emits still images at its source AVCaptureDevice's activeFormat.highResolutionStillImageDimensions. Note that if you enable video stabilization (see AVCaptureConnection's preferredVideoStabilizationMode) for any output, the high resolution still images emitted by AVCaptureStillImageOutput may be smaller by 10 or more percent.
123 #[unsafe(method(isHighResolutionStillImageOutputEnabled))]
124 #[unsafe(method_family = none)]
125 pub unsafe fn isHighResolutionStillImageOutputEnabled(&self) -> bool;
126
127 /// Setter for [`isHighResolutionStillImageOutputEnabled`][Self::isHighResolutionStillImageOutputEnabled].
128 #[unsafe(method(setHighResolutionStillImageOutputEnabled:))]
129 #[unsafe(method_family = none)]
130 pub unsafe fn setHighResolutionStillImageOutputEnabled(
131 &self,
132 high_resolution_still_image_output_enabled: bool,
133 );
134
135 /// A read-only BOOL value indicating whether still image buffers may be rotated to match the sensor orientation of earlier generation hardware.
136 ///
137 /// Value is YES for camera configurations which support compensation for the sensor orientation, which is applied to HEIC, JPEG, and uncompressed processed photos only; compensation is never applied to Bayer RAW or Apple ProRaw captures.
138 #[unsafe(method(isCameraSensorOrientationCompensationSupported))]
139 #[unsafe(method_family = none)]
140 pub unsafe fn isCameraSensorOrientationCompensationSupported(&self) -> bool;
141
142 /// A BOOL value indicating that still image buffers will be rotated to match the sensor orientation of earlier generation hardware.
143 ///
144 /// Default is YES when cameraSensorOrientationCompensationSupported is YES. Set to NO if your app does not require sensor orientation compensation.
145 #[unsafe(method(isCameraSensorOrientationCompensationEnabled))]
146 #[unsafe(method_family = none)]
147 pub unsafe fn isCameraSensorOrientationCompensationEnabled(&self) -> bool;
148
149 /// Setter for [`isCameraSensorOrientationCompensationEnabled`][Self::isCameraSensorOrientationCompensationEnabled].
150 #[unsafe(method(setCameraSensorOrientationCompensationEnabled:))]
151 #[unsafe(method_family = none)]
152 pub unsafe fn setCameraSensorOrientationCompensationEnabled(
153 &self,
154 camera_sensor_orientation_compensation_enabled: bool,
155 );
156
157 /// A boolean value that becomes true when a still image is being captured.
158 ///
159 ///
160 /// The value of this property is a BOOL that becomes true when a still image is being captured, and false when no still image capture is underway. This property is key-value observable.
161 #[unsafe(method(isCapturingStillImage))]
162 #[unsafe(method_family = none)]
163 pub unsafe fn isCapturingStillImage(&self) -> bool;
164
165 #[cfg(all(
166 feature = "AVCaptureSession",
167 feature = "block2",
168 feature = "objc2-core-media"
169 ))]
170 /// Initiates an asynchronous still image capture, returning the result to a completion handler.
171 ///
172 ///
173 /// Parameter `connection`: The AVCaptureConnection object from which to capture the still image.
174 ///
175 /// Parameter `handler`: A block that will be called when the still image capture is complete. The block will be passed a CMSampleBuffer object containing the image data or an NSError object if an image could not be captured.
176 ///
177 ///
178 /// This method will return immediately after it is invoked, later calling the provided completion handler block when image data is ready. If the request could not be completed, the error parameter will contain an NSError object describing the failure.
179 ///
180 /// Attachments to the image data sample buffer may contain metadata appropriate to the image data format. For instance, a sample buffer containing JPEG data may carry a kCGImagePropertyExifDictionary as an attachment. See
181 /// <ImageIO
182 /// /CGImageProperties.h> for a list of keys and value types.
183 ///
184 /// Clients should not assume that the completion handler will be called on a specific thread.
185 ///
186 /// Calls to captureStillImageAsynchronouslyFromConnection:completionHandler: are not synchronized with AVCaptureDevice manual control completion handlers. Setting a device manual control, waiting for its completion, then calling captureStillImageAsynchronouslyFromConnection:completionHandler: DOES NOT ensure that the still image returned reflects your manual control change. It may be from an earlier time. You can compare your manual control completion handler sync time to the returned still image's presentation time. You can retrieve the sample buffer's pts using CMSampleBufferGetPresentationTimestamp(). If the still image has an earlier timestamp, your manual control command does not apply to it.
187 #[deprecated = "Use AVCapturePhotoOutput instead."]
188 #[unsafe(method(captureStillImageAsynchronouslyFromConnection:completionHandler:))]
189 #[unsafe(method_family = none)]
190 pub unsafe fn captureStillImageAsynchronouslyFromConnection_completionHandler(
191 &self,
192 connection: &AVCaptureConnection,
193 handler: &block2::DynBlock<dyn Fn(*mut CMSampleBuffer, *mut NSError)>,
194 );
195
196 #[cfg(feature = "objc2-core-media")]
197 /// Converts the still image data and metadata attachments in a JPEG sample buffer to an NSData representation.
198 ///
199 ///
200 /// Parameter `jpegSampleBuffer`: The sample buffer carrying JPEG image data, optionally with Exif metadata sample buffer attachments. This method throws an NSInvalidArgumentException if jpegSampleBuffer is NULL or not in the JPEG format.
201 ///
202 ///
203 /// This method returns an NSData representation of a JPEG still image sample buffer, merging the image data and Exif metadata sample buffer attachments without recompressing the image. The returned NSData is suitable for writing to disk.
204 #[deprecated = "Use AVCapturePhotoOutput instead."]
205 #[unsafe(method(jpegStillImageNSDataRepresentation:))]
206 #[unsafe(method_family = none)]
207 pub unsafe fn jpegStillImageNSDataRepresentation(
208 jpeg_sample_buffer: &CMSampleBuffer,
209 ) -> Option<Retained<NSData>>;
210 );
211}
212
213extern_class!(
214 /// AVCaptureBracketedStillImageSettings is an abstract base class that defines an interface for settings pertaining to a bracketed capture.
215 ///
216 ///
217 /// AVCaptureBracketedStillImageSettings may not be instantiated directly.
218 ///
219 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avcapturebracketedstillimagesettings?language=objc)
220 #[unsafe(super(NSObject))]
221 #[derive(Debug, PartialEq, Eq, Hash)]
222 pub struct AVCaptureBracketedStillImageSettings;
223);
224
225extern_conformance!(
226 unsafe impl NSObjectProtocol for AVCaptureBracketedStillImageSettings {}
227);
228
229impl AVCaptureBracketedStillImageSettings {
230 extern_methods!(
231 #[unsafe(method(init))]
232 #[unsafe(method_family = init)]
233 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
234
235 #[unsafe(method(new))]
236 #[unsafe(method_family = new)]
237 pub unsafe fn new() -> Retained<Self>;
238 );
239}
240
241extern_class!(
242 /// AVCaptureManualExposureBracketedStillImageSettings is a concrete subclass of AVCaptureBracketedStillImageSettings to be used when bracketing exposure duration and ISO.
243 ///
244 ///
245 /// An AVCaptureManualExposureBracketedStillImageSettings instance defines the exposure duration and ISO settings that should be applied to one image in a bracket. An array of settings objects is passed to -[AVCaptureStillImageOutput captureStillImageBracketAsynchronouslyFromConnection:withSettingsArray:completionHandler:]. Min and max duration and ISO values are queryable properties of the AVCaptureDevice supplying data to an AVCaptureStillImageOutput instance. If you wish to leave exposureDuration unchanged for this bracketed still image, you may pass the special value AVCaptureExposureDurationCurrent. To keep ISO unchanged, you may pass AVCaptureISOCurrent (see AVCaptureDevice.h).
246 ///
247 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avcapturemanualexposurebracketedstillimagesettings?language=objc)
248 #[unsafe(super(AVCaptureBracketedStillImageSettings, NSObject))]
249 #[derive(Debug, PartialEq, Eq, Hash)]
250 pub struct AVCaptureManualExposureBracketedStillImageSettings;
251);
252
253extern_conformance!(
254 unsafe impl NSObjectProtocol for AVCaptureManualExposureBracketedStillImageSettings {}
255);
256
257impl AVCaptureManualExposureBracketedStillImageSettings {
258 extern_methods!(
259 #[cfg(feature = "objc2-core-media")]
260 /// Creates an AVCaptureManualExposureBracketedStillImageSettings using the specified exposure duration and ISO.
261 ///
262 ///
263 /// Parameter `duration`: The exposure duration in seconds. Pass AVCaptureExposureDurationCurrent to leave the duration unchanged for this bracketed image.
264 ///
265 /// Parameter `ISO`: The ISO. Pass AVCaptureISOCurrent to leave the ISO unchanged for this bracketed image.
266 ///
267 /// Returns: An initialized AVCaptureManualExposureBracketedStillImageSettings instance.
268 #[unsafe(method(manualExposureSettingsWithExposureDuration:ISO:))]
269 #[unsafe(method_family = none)]
270 pub unsafe fn manualExposureSettingsWithExposureDuration_ISO(
271 duration: CMTime,
272 iso: c_float,
273 ) -> Retained<Self>;
274
275 #[cfg(feature = "objc2-core-media")]
276 /// The exposure duration for the still image.
277 #[unsafe(method(exposureDuration))]
278 #[unsafe(method_family = none)]
279 pub unsafe fn exposureDuration(&self) -> CMTime;
280
281 /// The ISO for the still image.
282 #[unsafe(method(ISO))]
283 #[unsafe(method_family = none)]
284 pub unsafe fn ISO(&self) -> c_float;
285 );
286}
287
288/// Methods declared on superclass `AVCaptureBracketedStillImageSettings`.
289impl AVCaptureManualExposureBracketedStillImageSettings {
290 extern_methods!(
291 #[unsafe(method(init))]
292 #[unsafe(method_family = init)]
293 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
294
295 #[unsafe(method(new))]
296 #[unsafe(method_family = new)]
297 pub unsafe fn new() -> Retained<Self>;
298 );
299}
300
301extern_class!(
302 /// AVCaptureAutoExposureBracketedStillImageSettings is a concrete subclass of AVCaptureBracketedStillImageSettings to be used when bracketing exposure target bias.
303 ///
304 ///
305 /// An AVCaptureAutoExposureBracketedStillImageSettings instance defines the exposure target bias setting that should be applied to one image in a bracket. An array of settings objects is passed to -[AVCaptureStillImageOutput captureStillImageBracketAsynchronouslyFromConnection:withSettingsArray:completionHandler:]. Min and max exposure target bias are queryable properties of the AVCaptureDevice supplying data to an AVCaptureStillImageOutput instance. If you wish to leave exposureTargetBias unchanged for this bracketed still image, you may pass the special value AVCaptureExposureTargetBiasCurrent (see AVCaptureDevice.h).
306 ///
307 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avcaptureautoexposurebracketedstillimagesettings?language=objc)
308 #[unsafe(super(AVCaptureBracketedStillImageSettings, NSObject))]
309 #[derive(Debug, PartialEq, Eq, Hash)]
310 pub struct AVCaptureAutoExposureBracketedStillImageSettings;
311);
312
313extern_conformance!(
314 unsafe impl NSObjectProtocol for AVCaptureAutoExposureBracketedStillImageSettings {}
315);
316
317impl AVCaptureAutoExposureBracketedStillImageSettings {
318 extern_methods!(
319 /// Creates an AVCaptureAutoExposureBracketedStillImageSettings using the specified exposure target bias.
320 ///
321 ///
322 /// Parameter `exposureTargetBias`: The exposure target bias. Pass AVCaptureExposureTargetBiasCurrent to leave the exposureTargetBias unchanged for this image.
323 ///
324 /// Returns: An initialized AVCaptureAutoExposureBracketedStillImageSettings instance.
325 #[unsafe(method(autoExposureSettingsWithExposureTargetBias:))]
326 #[unsafe(method_family = none)]
327 pub unsafe fn autoExposureSettingsWithExposureTargetBias(
328 exposure_target_bias: c_float,
329 ) -> Retained<Self>;
330
331 /// The exposure bias for the auto exposure bracketed settings
332 #[unsafe(method(exposureTargetBias))]
333 #[unsafe(method_family = none)]
334 pub unsafe fn exposureTargetBias(&self) -> c_float;
335 );
336}
337
338/// Methods declared on superclass `AVCaptureBracketedStillImageSettings`.
339impl AVCaptureAutoExposureBracketedStillImageSettings {
340 extern_methods!(
341 #[unsafe(method(init))]
342 #[unsafe(method_family = init)]
343 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
344
345 #[unsafe(method(new))]
346 #[unsafe(method_family = new)]
347 pub unsafe fn new() -> Retained<Self>;
348 );
349}
350
351/// AVCaptureStillImageOutputBracketedCapture.
352///
353/// A category of methods for bracketed still image capture.
354///
355///
356/// A "still image bracket" is a batch of images taken as quickly as possible in succession, optionally with different settings from picture to picture.
357///
358/// In a bracketed capture, AVCaptureDevice flashMode property is ignored (flash is forced off), as is AVCaptureStillImageOutput's automaticallyEnablesStillImageStabilizationWhenAvailable property (stabilization is forced off).
359#[deprecated = "Use AVCapturePhotoOutput instead."]
360#[cfg(feature = "AVCaptureOutputBase")]
361impl AVCaptureStillImageOutput {
362 extern_methods!(
363 /// Specifies the maximum number of still images that may be taken in a single bracket.
364 ///
365 ///
366 /// AVCaptureStillImageOutput can only satisfy a limited number of image requests in a single bracket without exhausting system resources. The maximum number of still images that may be taken in a single bracket depends on the size of the images being captured, and consequently may vary with AVCaptureSession -sessionPreset and AVCaptureDevice -activeFormat. Some formats do not support bracketed capture and return a maxBracketedCaptureStillImageCount of 0. This read-only property is key-value observable. If you exceed -maxBracketedCaptureStillImageCount, then -captureStillImageBracketAsynchronouslyFromConnection:withSettingsArray:completionHandler: fails and the completionHandler is called [settings count] times with a NULL sample buffer and AVErrorMaximumStillImageCaptureRequestsExceeded.
367 #[deprecated = "Use AVCapturePhotoOutput maxBracketedCapturePhotoCount instead."]
368 #[unsafe(method(maxBracketedCaptureStillImageCount))]
369 #[unsafe(method_family = none)]
370 pub unsafe fn maxBracketedCaptureStillImageCount(&self) -> NSUInteger;
371
372 /// Indicates whether the receiver supports lens stabilization during bracketed captures.
373 ///
374 ///
375 /// The receiver's lensStabilizationDuringBracketedCaptureEnabled property can only be set if this property returns YES. Its value may change as the session's -sessionPreset or input device's -activeFormat changes. This read-only property is key-value observable.
376 #[deprecated = "Use AVCapturePhotoOutput lensStabilizationDuringBracketedCaptureSupported instead."]
377 #[unsafe(method(isLensStabilizationDuringBracketedCaptureSupported))]
378 #[unsafe(method_family = none)]
379 pub unsafe fn isLensStabilizationDuringBracketedCaptureSupported(&self) -> bool;
380
381 /// Indicates whether the receiver should use lens stabilization during bracketed captures.
382 ///
383 ///
384 /// On a receiver where -isLensStabilizationDuringBracketedCaptureSupported returns YES, lens stabilization may be applied to the bracket to reduce blur commonly found in low light photos. When lens stabilization is enabled, bracketed still image captures incur additional latency. Lens stabilization is more effective with longer-exposure captures, and offers limited or no benefit for exposure durations shorter than 1/30 of a second. It is possible that during the bracket, the lens stabilization module may run out of correction range and therefore will not be active for every frame in the bracket. Each emitted CMSampleBuffer from the bracket will have an attachment of kCMSampleBufferAttachmentKey_StillImageLensStabilizationInfo indicating additional information about stabilization was applied to the buffer, if any. The default value of -isLensStabilizationDuringBracketedCaptureEnabled is NO. This value will be set to NO when -isLensStabilizationDuringBracketedCaptureSupported changes to NO. Setting this property throws an NSInvalidArgumentException if -isLensStabilizationDuringBracketedCaptureSupported returns NO. This property is key-value observable.
385 #[deprecated = "Use AVCapturePhotoOutput with AVCapturePhotoBracketSettings instead."]
386 #[unsafe(method(isLensStabilizationDuringBracketedCaptureEnabled))]
387 #[unsafe(method_family = none)]
388 pub unsafe fn isLensStabilizationDuringBracketedCaptureEnabled(&self) -> bool;
389
390 /// Setter for [`isLensStabilizationDuringBracketedCaptureEnabled`][Self::isLensStabilizationDuringBracketedCaptureEnabled].
391 #[deprecated = "Use AVCapturePhotoOutput with AVCapturePhotoBracketSettings instead."]
392 #[unsafe(method(setLensStabilizationDuringBracketedCaptureEnabled:))]
393 #[unsafe(method_family = none)]
394 pub unsafe fn setLensStabilizationDuringBracketedCaptureEnabled(
395 &self,
396 lens_stabilization_during_bracketed_capture_enabled: bool,
397 );
398
399 #[cfg(all(feature = "AVCaptureSession", feature = "block2"))]
400 /// Allows the receiver to prepare resources in advance of capturing a still image bracket.
401 ///
402 ///
403 /// Parameter `connection`: The connection through which the still image bracket should be captured.
404 ///
405 /// Parameter `settings`: An array of AVCaptureBracketedStillImageSettings objects. All must be of the same kind of AVCaptureBracketedStillImageSettings subclass, or an NSInvalidArgumentException is thrown.
406 ///
407 /// Parameter `handler`: A user provided block that will be called asynchronously once resources have successfully been allocated for the specified bracketed capture operation. If sufficient resources could not be allocated, the "prepared" parameter contains NO, and "error" parameter contains a non-nil error value. If [settings count] exceeds -maxBracketedCaptureStillImageCount, then AVErrorMaximumStillImageCaptureRequestsExceeded is returned. You should not assume that the completion handler will be called on a specific thread.
408 ///
409 ///
410 /// -maxBracketedCaptureStillImageCount tells you the maximum number of images that may be taken in a single bracket given the current AVCaptureDevice/AVCaptureSession/AVCaptureStillImageOutput configuration. But before taking a still image bracket, additional resources may need to be allocated. By calling -prepareToCaptureStillImageBracketFromConnection:withSettingsArray:completionHandler: first, you are able to deterministically know when the receiver is ready to capture the bracket with the specified settings array.
411 #[deprecated = "Use AVCapturePhotoOutput setPreparedPhotoSettingsArray:completionHandler: instead."]
412 #[unsafe(method(prepareToCaptureStillImageBracketFromConnection:withSettingsArray:completionHandler:))]
413 #[unsafe(method_family = none)]
414 pub unsafe fn prepareToCaptureStillImageBracketFromConnection_withSettingsArray_completionHandler(
415 &self,
416 connection: &AVCaptureConnection,
417 settings: &NSArray<AVCaptureBracketedStillImageSettings>,
418 handler: &block2::DynBlock<dyn Fn(Bool, *mut NSError)>,
419 );
420
421 #[cfg(all(
422 feature = "AVCaptureSession",
423 feature = "block2",
424 feature = "objc2-core-media"
425 ))]
426 /// Captures a still image bracket.
427 ///
428 ///
429 /// Parameter `connection`: The connection through which the still image bracket should be captured.
430 ///
431 /// Parameter `settings`: An array of AVCaptureBracketedStillImageSettings objects. All must be of the same kind of AVCaptureBracketedStillImageSettings subclass, or an NSInvalidArgumentException is thrown.
432 ///
433 /// Parameter `handler`: A user provided block that will be called asynchronously as each still image in the bracket is captured. If the capture request is successful, the "sampleBuffer" parameter contains a valid CMSampleBuffer, the "stillImageSettings" parameter contains the settings object corresponding to this still image, and a nil "error" parameter. If the bracketed capture fails, sample buffer is NULL and error is non-nil. If [settings count] exceeds -maxBracketedCaptureStillImageCount, then AVErrorMaximumStillImageCaptureRequestsExceeded is returned. You should not assume that the completion handler will be called on a specific thread.
434 ///
435 ///
436 /// If you have not called -prepareToCaptureStillImageBracketFromConnection:withSettingsArray:completionHandler: for this still image bracket request, the bracket may not be taken immediately, as the receiver may internally need to prepare resources.
437 #[deprecated = "Use AVCapturePhotoOutput capturePhotoWithSettings:delegate: instead."]
438 #[unsafe(method(captureStillImageBracketAsynchronouslyFromConnection:withSettingsArray:completionHandler:))]
439 #[unsafe(method_family = none)]
440 pub unsafe fn captureStillImageBracketAsynchronouslyFromConnection_withSettingsArray_completionHandler(
441 &self,
442 connection: &AVCaptureConnection,
443 settings: &NSArray<AVCaptureBracketedStillImageSettings>,
444 handler: &block2::DynBlock<
445 dyn Fn(
446 *mut CMSampleBuffer,
447 *mut AVCaptureBracketedStillImageSettings,
448 *mut NSError,
449 ),
450 >,
451 );
452 );
453}