objc2_core_video/generated/
CVImageBuffer.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_core_foundation::*;
6#[cfg(feature = "objc2-core-graphics")]
7use objc2_core_graphics::*;
8
9use crate::*;
10
11extern "C" {
12    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebuffercgcolorspacekey?language=objc)
13    pub static kCVImageBufferCGColorSpaceKey: &'static CFString;
14}
15
16extern "C" {
17    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebuffercleanaperturekey?language=objc)
18    pub static kCVImageBufferCleanApertureKey: &'static CFString;
19}
20
21extern "C" {
22    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebuffercleanaperturewidthkey?language=objc)
23    pub static kCVImageBufferCleanApertureWidthKey: &'static CFString;
24}
25
26extern "C" {
27    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebuffercleanapertureheightkey?language=objc)
28    pub static kCVImageBufferCleanApertureHeightKey: &'static CFString;
29}
30
31extern "C" {
32    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebuffercleanaperturehorizontaloffsetkey?language=objc)
33    pub static kCVImageBufferCleanApertureHorizontalOffsetKey: &'static CFString;
34}
35
36extern "C" {
37    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebuffercleanapertureverticaloffsetkey?language=objc)
38    pub static kCVImageBufferCleanApertureVerticalOffsetKey: &'static CFString;
39}
40
41extern "C" {
42    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebufferpreferredcleanaperturekey?language=objc)
43    pub static kCVImageBufferPreferredCleanApertureKey: &'static CFString;
44}
45
46extern "C" {
47    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebufferfieldcountkey?language=objc)
48    pub static kCVImageBufferFieldCountKey: &'static CFString;
49}
50
51extern "C" {
52    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebufferfielddetailkey?language=objc)
53    pub static kCVImageBufferFieldDetailKey: &'static CFString;
54}
55
56extern "C" {
57    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebufferfielddetailtemporaltopfirst?language=objc)
58    pub static kCVImageBufferFieldDetailTemporalTopFirst: &'static CFString;
59}
60
61extern "C" {
62    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebufferfielddetailtemporalbottomfirst?language=objc)
63    pub static kCVImageBufferFieldDetailTemporalBottomFirst: &'static CFString;
64}
65
66extern "C" {
67    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebufferfielddetailspatialfirstlineearly?language=objc)
68    pub static kCVImageBufferFieldDetailSpatialFirstLineEarly: &'static CFString;
69}
70
71extern "C" {
72    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebufferfielddetailspatialfirstlinelate?language=objc)
73    pub static kCVImageBufferFieldDetailSpatialFirstLineLate: &'static CFString;
74}
75
76extern "C" {
77    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebufferpixelaspectratiokey?language=objc)
78    pub static kCVImageBufferPixelAspectRatioKey: &'static CFString;
79}
80
81extern "C" {
82    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebufferpixelaspectratiohorizontalspacingkey?language=objc)
83    pub static kCVImageBufferPixelAspectRatioHorizontalSpacingKey: &'static CFString;
84}
85
86extern "C" {
87    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebufferpixelaspectratioverticalspacingkey?language=objc)
88    pub static kCVImageBufferPixelAspectRatioVerticalSpacingKey: &'static CFString;
89}
90
91extern "C" {
92    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebufferdisplaydimensionskey?language=objc)
93    pub static kCVImageBufferDisplayDimensionsKey: &'static CFString;
94}
95
96extern "C" {
97    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebufferdisplaywidthkey?language=objc)
98    pub static kCVImageBufferDisplayWidthKey: &'static CFString;
99}
100
101extern "C" {
102    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebufferdisplayheightkey?language=objc)
103    pub static kCVImageBufferDisplayHeightKey: &'static CFString;
104}
105
106extern "C" {
107    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebuffergammalevelkey?language=objc)
108    pub static kCVImageBufferGammaLevelKey: &'static CFString;
109}
110
111extern "C" {
112    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebuffericcprofilekey?language=objc)
113    pub static kCVImageBufferICCProfileKey: &'static CFString;
114}
115
116extern "C" {
117    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebufferycbcrmatrixkey?language=objc)
118    pub static kCVImageBufferYCbCrMatrixKey: &'static CFString;
119}
120
121extern "C" {
122    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebufferycbcrmatrix_itu_r_709_2?language=objc)
123    pub static kCVImageBufferYCbCrMatrix_ITU_R_709_2: &'static CFString;
124}
125
126extern "C" {
127    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebufferycbcrmatrix_itu_r_601_4?language=objc)
128    pub static kCVImageBufferYCbCrMatrix_ITU_R_601_4: &'static CFString;
129}
130
131extern "C" {
132    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebufferycbcrmatrix_smpte_240m_1995?language=objc)
133    pub static kCVImageBufferYCbCrMatrix_SMPTE_240M_1995: &'static CFString;
134}
135
136extern "C" {
137    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebufferycbcrmatrix_dci_p3?language=objc)
138    pub static kCVImageBufferYCbCrMatrix_DCI_P3: &'static CFString;
139}
140
141extern "C" {
142    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebufferycbcrmatrix_p3_d65?language=objc)
143    pub static kCVImageBufferYCbCrMatrix_P3_D65: &'static CFString;
144}
145
146extern "C" {
147    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebufferycbcrmatrix_itu_r_2020?language=objc)
148    pub static kCVImageBufferYCbCrMatrix_ITU_R_2020: &'static CFString;
149}
150
151extern "C" {
152    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebuffercolorprimarieskey?language=objc)
153    pub static kCVImageBufferColorPrimariesKey: &'static CFString;
154}
155
156extern "C" {
157    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebuffercolorprimaries_itu_r_709_2?language=objc)
158    pub static kCVImageBufferColorPrimaries_ITU_R_709_2: &'static CFString;
159}
160
161extern "C" {
162    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebuffercolorprimaries_ebu_3213?language=objc)
163    pub static kCVImageBufferColorPrimaries_EBU_3213: &'static CFString;
164}
165
166extern "C" {
167    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebuffercolorprimaries_smpte_c?language=objc)
168    pub static kCVImageBufferColorPrimaries_SMPTE_C: &'static CFString;
169}
170
171extern "C" {
172    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebuffercolorprimaries_p22?language=objc)
173    pub static kCVImageBufferColorPrimaries_P22: &'static CFString;
174}
175
176extern "C" {
177    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebuffercolorprimaries_dci_p3?language=objc)
178    pub static kCVImageBufferColorPrimaries_DCI_P3: &'static CFString;
179}
180
181extern "C" {
182    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebuffercolorprimaries_p3_d65?language=objc)
183    pub static kCVImageBufferColorPrimaries_P3_D65: &'static CFString;
184}
185
186extern "C" {
187    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebuffercolorprimaries_itu_r_2020?language=objc)
188    pub static kCVImageBufferColorPrimaries_ITU_R_2020: &'static CFString;
189}
190
191extern "C" {
192    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebuffertransferfunctionkey?language=objc)
193    pub static kCVImageBufferTransferFunctionKey: &'static CFString;
194}
195
196extern "C" {
197    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebuffertransferfunction_itu_r_709_2?language=objc)
198    pub static kCVImageBufferTransferFunction_ITU_R_709_2: &'static CFString;
199}
200
201extern "C" {
202    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebuffertransferfunction_smpte_240m_1995?language=objc)
203    pub static kCVImageBufferTransferFunction_SMPTE_240M_1995: &'static CFString;
204}
205
206extern "C" {
207    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebuffertransferfunction_usegamma?language=objc)
208    pub static kCVImageBufferTransferFunction_UseGamma: &'static CFString;
209}
210
211extern "C" {
212    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebuffertransferfunction_ebu_3213?language=objc)
213    pub static kCVImageBufferTransferFunction_EBU_3213: &'static CFString;
214}
215
216extern "C" {
217    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebuffertransferfunction_smpte_c?language=objc)
218    pub static kCVImageBufferTransferFunction_SMPTE_C: &'static CFString;
219}
220
221extern "C" {
222    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebuffertransferfunction_srgb?language=objc)
223    pub static kCVImageBufferTransferFunction_sRGB: &'static CFString;
224}
225
226extern "C" {
227    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebuffertransferfunction_itu_r_2020?language=objc)
228    pub static kCVImageBufferTransferFunction_ITU_R_2020: &'static CFString;
229}
230
231extern "C" {
232    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebuffertransferfunction_smpte_st_428_1?language=objc)
233    pub static kCVImageBufferTransferFunction_SMPTE_ST_428_1: &'static CFString;
234}
235
236extern "C" {
237    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebuffertransferfunction_smpte_st_2084_pq?language=objc)
238    pub static kCVImageBufferTransferFunction_SMPTE_ST_2084_PQ: &'static CFString;
239}
240
241extern "C" {
242    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebuffertransferfunction_itu_r_2100_hlg?language=objc)
243    pub static kCVImageBufferTransferFunction_ITU_R_2100_HLG: &'static CFString;
244}
245
246extern "C" {
247    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebuffertransferfunction_linear?language=objc)
248    pub static kCVImageBufferTransferFunction_Linear: &'static CFString;
249}
250
251extern "C" {
252    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebufferchromalocationtopfieldkey?language=objc)
253    pub static kCVImageBufferChromaLocationTopFieldKey: &'static CFString;
254}
255
256extern "C" {
257    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebufferchromalocationbottomfieldkey?language=objc)
258    pub static kCVImageBufferChromaLocationBottomFieldKey: &'static CFString;
259}
260
261extern "C" {
262    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebufferchromalocation_left?language=objc)
263    pub static kCVImageBufferChromaLocation_Left: &'static CFString;
264}
265
266extern "C" {
267    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebufferchromalocation_center?language=objc)
268    pub static kCVImageBufferChromaLocation_Center: &'static CFString;
269}
270
271extern "C" {
272    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebufferchromalocation_topleft?language=objc)
273    pub static kCVImageBufferChromaLocation_TopLeft: &'static CFString;
274}
275
276extern "C" {
277    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebufferchromalocation_top?language=objc)
278    pub static kCVImageBufferChromaLocation_Top: &'static CFString;
279}
280
281extern "C" {
282    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebufferchromalocation_bottomleft?language=objc)
283    pub static kCVImageBufferChromaLocation_BottomLeft: &'static CFString;
284}
285
286extern "C" {
287    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebufferchromalocation_bottom?language=objc)
288    pub static kCVImageBufferChromaLocation_Bottom: &'static CFString;
289}
290
291extern "C" {
292    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebufferchromalocation_dv420?language=objc)
293    pub static kCVImageBufferChromaLocation_DV420: &'static CFString;
294}
295
296extern "C" {
297    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebufferchromasubsamplingkey?language=objc)
298    pub static kCVImageBufferChromaSubsamplingKey: &'static CFString;
299}
300
301extern "C" {
302    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebufferchromasubsampling_420?language=objc)
303    pub static kCVImageBufferChromaSubsampling_420: &'static CFString;
304}
305
306extern "C" {
307    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebufferchromasubsampling_422?language=objc)
308    pub static kCVImageBufferChromaSubsampling_422: &'static CFString;
309}
310
311extern "C" {
312    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebufferchromasubsampling_411?language=objc)
313    pub static kCVImageBufferChromaSubsampling_411: &'static CFString;
314}
315
316extern "C" {
317    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebufferalphachannelisopaque?language=objc)
318    pub static kCVImageBufferAlphaChannelIsOpaque: &'static CFString;
319}
320
321extern "C" {
322    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebufferalphachannelmodekey?language=objc)
323    pub static kCVImageBufferAlphaChannelModeKey: &'static CFString;
324}
325
326extern "C" {
327    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebufferalphachannelmode_straightalpha?language=objc)
328    pub static kCVImageBufferAlphaChannelMode_StraightAlpha: &'static CFString;
329}
330
331extern "C" {
332    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebufferalphachannelmode_premultipliedalpha?language=objc)
333    pub static kCVImageBufferAlphaChannelMode_PremultipliedAlpha: &'static CFString;
334}
335
336extern "C" {
337    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebufferpostdecodeprocessingsequencemetadatakey?language=objc)
338    pub static kCVImageBufferPostDecodeProcessingSequenceMetadataKey: Option<&'static CFString>;
339}
340
341extern "C" {
342    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebufferpostdecodeprocessingframemetadatakey?language=objc)
343    pub static kCVImageBufferPostDecodeProcessingFrameMetadataKey: Option<&'static CFString>;
344}
345
346extern "C-unwind" {
347    pub fn CVYCbCrMatrixGetIntegerCodePointForString(
348        y_cb_cr_matrix_string: Option<&CFString>,
349    ) -> c_int;
350}
351
352extern "C-unwind" {
353    pub fn CVColorPrimariesGetIntegerCodePointForString(
354        color_primaries_string: Option<&CFString>,
355    ) -> c_int;
356}
357
358extern "C-unwind" {
359    pub fn CVTransferFunctionGetIntegerCodePointForString(
360        transfer_function_string: Option<&CFString>,
361    ) -> c_int;
362}
363
364#[inline]
365pub unsafe extern "C-unwind" fn CVYCbCrMatrixGetStringForIntegerCodePoint(
366    y_cb_cr_matrix_code_point: c_int,
367) -> Option<CFRetained<CFString>> {
368    extern "C-unwind" {
369        fn CVYCbCrMatrixGetStringForIntegerCodePoint(
370            y_cb_cr_matrix_code_point: c_int,
371        ) -> Option<NonNull<CFString>>;
372    }
373    let ret = unsafe { CVYCbCrMatrixGetStringForIntegerCodePoint(y_cb_cr_matrix_code_point) };
374    ret.map(|ret| unsafe { CFRetained::retain(ret) })
375}
376
377#[inline]
378pub unsafe extern "C-unwind" fn CVColorPrimariesGetStringForIntegerCodePoint(
379    color_primaries_code_point: c_int,
380) -> Option<CFRetained<CFString>> {
381    extern "C-unwind" {
382        fn CVColorPrimariesGetStringForIntegerCodePoint(
383            color_primaries_code_point: c_int,
384        ) -> Option<NonNull<CFString>>;
385    }
386    let ret = unsafe { CVColorPrimariesGetStringForIntegerCodePoint(color_primaries_code_point) };
387    ret.map(|ret| unsafe { CFRetained::retain(ret) })
388}
389
390#[inline]
391pub unsafe extern "C-unwind" fn CVTransferFunctionGetStringForIntegerCodePoint(
392    transfer_function_code_point: c_int,
393) -> Option<CFRetained<CFString>> {
394    extern "C-unwind" {
395        fn CVTransferFunctionGetStringForIntegerCodePoint(
396            transfer_function_code_point: c_int,
397        ) -> Option<NonNull<CFString>>;
398    }
399    let ret =
400        unsafe { CVTransferFunctionGetStringForIntegerCodePoint(transfer_function_code_point) };
401    ret.map(|ret| unsafe { CFRetained::retain(ret) })
402}
403
404/// Base type for all CoreVideo image buffers
405///
406/// See also [Apple's documentation](https://developer.apple.com/documentation/corevideo/cvimagebuffer?language=objc)
407#[cfg(feature = "CVBuffer")]
408pub type CVImageBuffer = CVBuffer;
409
410extern "C-unwind" {
411    /// Returns the full encoded dimensions of a CVImageBuffer.  For example, for an NTSC DV frame this would be 720x480
412    ///
413    /// Parameter `imageBuffer`: A CVImageBuffer that you wish to retrieve the encoded size from.
414    ///
415    /// Returns: A CGSize returning the full encoded size of the buffer
416    /// Returns zero size if called with a non-CVImageBufferRef type or NULL.
417    #[cfg(feature = "CVBuffer")]
418    pub fn CVImageBufferGetEncodedSize(image_buffer: &CVImageBuffer) -> CGSize;
419}
420
421extern "C-unwind" {
422    /// Returns the nominal output display size (in square pixels) of a CVImageBuffer.
423    /// For example, for an NTSC DV frame this would be 640x480
424    ///
425    /// Parameter `imageBuffer`: A CVImageBuffer that you wish to retrieve the display size from.
426    ///
427    /// Returns: A CGSize returning the nominal display size of the buffer
428    /// Returns zero size if called with a non-CVImageBufferRef type or NULL.
429    #[cfg(feature = "CVBuffer")]
430    pub fn CVImageBufferGetDisplaySize(image_buffer: &CVImageBuffer) -> CGSize;
431}
432
433extern "C-unwind" {
434    /// Returns the source rectangle of a CVImageBuffer that represents the clean aperture
435    /// of the buffer in encoded pixels.    For example, an NTSC DV frame would return a CGRect with an
436    /// origin of 8,0 and a size of 704,480.
437    /// Note that the origin of this rect always the lower left    corner.   This is the same coordinate system as
438    /// used by CoreImage.
439    ///
440    /// Parameter `imageBuffer`: A CVImageBuffer that you wish to retrieve the display size from.
441    ///
442    /// Returns: A CGSize returning the nominal display size of the buffer
443    /// Returns zero rect if called with a non-CVImageBufferRef type or NULL.
444    #[cfg(feature = "CVBuffer")]
445    pub fn CVImageBufferGetCleanRect(image_buffer: &CVImageBuffer) -> CGRect;
446}
447
448/// Returns whether the image is flipped vertically or not.
449///
450/// Parameter `imageBuffer`: target
451///
452/// Returns: True if 0,0 in the texture is upper left, false if 0,0 is lower left.
453#[cfg(feature = "CVBuffer")]
454#[inline]
455pub unsafe extern "C-unwind" fn CVImageBufferIsFlipped(image_buffer: &CVImageBuffer) -> bool {
456    extern "C-unwind" {
457        fn CVImageBufferIsFlipped(image_buffer: &CVImageBuffer) -> Boolean;
458    }
459    let ret = unsafe { CVImageBufferIsFlipped(image_buffer) };
460    ret != 0
461}
462
463/// Returns the color space of a CVImageBuffer.
464///
465/// Parameter `imageBuffer`: A CVImageBuffer that you wish to retrieve the color space from.
466///
467/// Returns: A CGColorSpaceRef representing the color space of the buffer.
468/// Returns NULL if called with a non-CVImageBufferRef type or NULL.
469#[cfg(all(feature = "CVBuffer", feature = "objc2-core-graphics"))]
470#[inline]
471pub unsafe extern "C-unwind" fn CVImageBufferGetColorSpace(
472    image_buffer: &CVImageBuffer,
473) -> Option<CFRetained<CGColorSpace>> {
474    extern "C-unwind" {
475        fn CVImageBufferGetColorSpace(
476            image_buffer: &CVImageBuffer,
477        ) -> Option<NonNull<CGColorSpace>>;
478    }
479    let ret = unsafe { CVImageBufferGetColorSpace(image_buffer) };
480    ret.map(|ret| unsafe { CFRetained::retain(ret) })
481}
482
483/// Attempts to synthesize a CGColorSpace from an image buffer's attachments.
484///
485/// Parameter `attachments`: A CFDictionary of attachments for an image buffer, obtained using CVBufferCopyAttachments().
486///
487/// Returns: A CGColorSpaceRef representing the color space of the buffer.
488/// Returns NULL if the attachments dictionary does not contain the information required to synthesize a CGColorSpace.
489///
490/// To generate a CGColorSpace, the attachments dictionary should include values for either:
491/// 1. kCVImageBufferICCProfile
492/// 2. kCVImageBufferColorPrimariesKey, kCVImageBufferTransferFunctionKey, and kCVImageBufferYCbCrMatrixKey (and possibly kCVImageBufferGammaLevelKey)
493/// The client is responsible for releasing the CGColorSpaceRef when it is done with it (CGColorSpaceRelease() or CFRelease())
494#[cfg(feature = "objc2-core-graphics")]
495#[inline]
496pub unsafe extern "C-unwind" fn CVImageBufferCreateColorSpaceFromAttachments(
497    attachments: &CFDictionary,
498) -> Option<CFRetained<CGColorSpace>> {
499    extern "C-unwind" {
500        fn CVImageBufferCreateColorSpaceFromAttachments(
501            attachments: &CFDictionary,
502        ) -> Option<NonNull<CGColorSpace>>;
503    }
504    let ret = unsafe { CVImageBufferCreateColorSpaceFromAttachments(attachments) };
505    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
506}
507
508extern "C" {
509    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebuffermasteringdisplaycolorvolumekey?language=objc)
510    pub static kCVImageBufferMasteringDisplayColorVolumeKey: &'static CFString;
511}
512
513extern "C" {
514    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebuffercontentlightlevelinfokey?language=objc)
515    pub static kCVImageBufferContentLightLevelInfoKey: &'static CFString;
516}
517
518extern "C" {
519    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebufferambientviewingenvironmentkey?language=objc)
520    pub static kCVImageBufferAmbientViewingEnvironmentKey: &'static CFString;
521}
522
523extern "C" {
524    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebuffersceneilluminationkey?language=objc)
525    pub static kCVImageBufferSceneIlluminationKey: &'static CFString;
526}
527
528extern "C" {
529    /// Specifies region of interest that image statistics cover.
530    ///
531    /// This value should be a CGRect dictionary created by CGRectCreateDictionaryRepresentation(). The origin in the CGRect represents the x,y coordinate within the CVPixelBuffer where region of interest is located.
532    ///
533    /// See also [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebufferregionofinterestkey?language=objc)
534    pub static kCVImageBufferRegionOfInterestKey: &'static CFString;
535}
536
537extern "C" {
538    /// Indicates that the transfer function or gamma of the content is a log format and identifies the specific log curve.
539    ///
540    /// The value is a CFString holding fully specified reverse DNS identifier.
541    /// Content captured in Apple Log will have this key set to kCVImageBufferLogTransferFunction_AppleLog.
542    ///
543    /// Indicates the Apple Log identifier.
544    ///
545    /// You can download the Apple Log Profile White Paper from the Apple Developer Downloads website.
546    ///
547    /// See also [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebufferlogtransferfunctionkey?language=objc)
548    pub static kCVImageBufferLogTransferFunctionKey: &'static CFString;
549}
550
551extern "C" {
552    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvimagebufferlogtransferfunction_applelog?language=objc)
553    pub static kCVImageBufferLogTransferFunction_AppleLog: &'static CFString;
554}