objc2_core_video/generated/
CVPixelFormatDescription.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5#[cfg(feature = "objc2")]
6use objc2::__framework_prelude::*;
7use objc2_core_foundation::*;
8
9use crate::*;
10
11extern "C" {
12    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvpixelformatname?language=objc)
13    pub static kCVPixelFormatName: &'static CFString;
14}
15
16extern "C" {
17    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvpixelformatconstant?language=objc)
18    pub static kCVPixelFormatConstant: &'static CFString;
19}
20
21extern "C" {
22    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvpixelformatcodectype?language=objc)
23    pub static kCVPixelFormatCodecType: &'static CFString;
24}
25
26extern "C" {
27    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvpixelformatfourcc?language=objc)
28    pub static kCVPixelFormatFourCC: &'static CFString;
29}
30
31extern "C" {
32    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvpixelformatcontainsalpha?language=objc)
33    pub static kCVPixelFormatContainsAlpha: &'static CFString;
34}
35
36extern "C" {
37    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvpixelformatcontainsycbcr?language=objc)
38    pub static kCVPixelFormatContainsYCbCr: &'static CFString;
39}
40
41extern "C" {
42    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvpixelformatcontainsrgb?language=objc)
43    pub static kCVPixelFormatContainsRGB: &'static CFString;
44}
45
46extern "C" {
47    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvpixelformatcontainsgrayscale?language=objc)
48    pub static kCVPixelFormatContainsGrayscale: &'static CFString;
49}
50
51extern "C" {
52    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvpixelformatcontainssenselarray?language=objc)
53    pub static kCVPixelFormatContainsSenselArray: &'static CFString;
54}
55
56extern "C" {
57    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvpixelformatcomponentrange?language=objc)
58    pub static kCVPixelFormatComponentRange: &'static CFString;
59}
60
61extern "C" {
62    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvpixelformatcomponentrange_videorange?language=objc)
63    pub static kCVPixelFormatComponentRange_VideoRange: &'static CFString;
64}
65
66extern "C" {
67    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvpixelformatcomponentrange_fullrange?language=objc)
68    pub static kCVPixelFormatComponentRange_FullRange: &'static CFString;
69}
70
71extern "C" {
72    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvpixelformatcomponentrange_widerange?language=objc)
73    pub static kCVPixelFormatComponentRange_WideRange: &'static CFString;
74}
75
76extern "C" {
77    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvpixelformatplanes?language=objc)
78    pub static kCVPixelFormatPlanes: &'static CFString;
79}
80
81extern "C" {
82    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvpixelformatblockwidth?language=objc)
83    pub static kCVPixelFormatBlockWidth: &'static CFString;
84}
85
86extern "C" {
87    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvpixelformatblockheight?language=objc)
88    pub static kCVPixelFormatBlockHeight: &'static CFString;
89}
90
91extern "C" {
92    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvpixelformatbitsperblock?language=objc)
93    pub static kCVPixelFormatBitsPerBlock: &'static CFString;
94}
95
96extern "C" {
97    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvpixelformatbitspercomponent?language=objc)
98    pub static kCVPixelFormatBitsPerComponent: &'static CFString;
99}
100
101extern "C" {
102    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvpixelformatblockhorizontalalignment?language=objc)
103    pub static kCVPixelFormatBlockHorizontalAlignment: &'static CFString;
104}
105
106extern "C" {
107    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvpixelformatblockverticalalignment?language=objc)
108    pub static kCVPixelFormatBlockVerticalAlignment: &'static CFString;
109}
110
111extern "C" {
112    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvpixelformatblackblock?language=objc)
113    pub static kCVPixelFormatBlackBlock: &'static CFString;
114}
115
116extern "C" {
117    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvpixelformathorizontalsubsampling?language=objc)
118    pub static kCVPixelFormatHorizontalSubsampling: &'static CFString;
119}
120
121extern "C" {
122    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvpixelformatverticalsubsampling?language=objc)
123    pub static kCVPixelFormatVerticalSubsampling: &'static CFString;
124}
125
126extern "C" {
127    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvpixelformatopenglformat?language=objc)
128    pub static kCVPixelFormatOpenGLFormat: &'static CFString;
129}
130
131extern "C" {
132    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvpixelformatopengltype?language=objc)
133    pub static kCVPixelFormatOpenGLType: &'static CFString;
134}
135
136extern "C" {
137    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvpixelformatopenglinternalformat?language=objc)
138    pub static kCVPixelFormatOpenGLInternalFormat: &'static CFString;
139}
140
141extern "C" {
142    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvpixelformatcgbitmapinfo?language=objc)
143    pub static kCVPixelFormatCGBitmapInfo: &'static CFString;
144}
145
146extern "C" {
147    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvpixelformatqdcompatibility?language=objc)
148    pub static kCVPixelFormatQDCompatibility: &'static CFString;
149}
150
151extern "C" {
152    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvpixelformatcgbitmapcontextcompatibility?language=objc)
153    pub static kCVPixelFormatCGBitmapContextCompatibility: &'static CFString;
154}
155
156extern "C" {
157    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvpixelformatcgimagecompatibility?language=objc)
158    pub static kCVPixelFormatCGImageCompatibility: &'static CFString;
159}
160
161extern "C" {
162    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvpixelformatopenglcompatibility?language=objc)
163    pub static kCVPixelFormatOpenGLCompatibility: &'static CFString;
164}
165
166extern "C" {
167    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvpixelformatopenglescompatibility?language=objc)
168    pub static kCVPixelFormatOpenGLESCompatibility: &'static CFString;
169}
170
171/// [Apple's documentation](https://developer.apple.com/documentation/corevideo/cvfillextendedpixelscallback?language=objc)
172#[cfg(all(
173    feature = "CVBuffer",
174    feature = "CVImageBuffer",
175    feature = "CVPixelBuffer"
176))]
177pub type CVFillExtendedPixelsCallBack =
178    Option<unsafe extern "C-unwind" fn(NonNull<CVPixelBuffer>, *mut c_void) -> Boolean>;
179
180/// [Apple's documentation](https://developer.apple.com/documentation/corevideo/cvfillextendedpixelscallbackdata?language=objc)
181#[cfg(all(
182    feature = "CVBuffer",
183    feature = "CVImageBuffer",
184    feature = "CVPixelBuffer"
185))]
186#[repr(C)]
187#[derive(Clone, Copy, Debug, PartialEq)]
188pub struct CVFillExtendedPixelsCallBackData {
189    pub version: CFIndex,
190    pub fillCallBack: CVFillExtendedPixelsCallBack,
191    pub refCon: *mut c_void,
192}
193
194#[cfg(all(
195    feature = "CVBuffer",
196    feature = "CVImageBuffer",
197    feature = "CVPixelBuffer",
198    feature = "objc2"
199))]
200unsafe impl Encode for CVFillExtendedPixelsCallBackData {
201    const ENCODING: Encoding = Encoding::Struct(
202        "?",
203        &[
204            <CFIndex>::ENCODING,
205            <CVFillExtendedPixelsCallBack>::ENCODING,
206            <*mut c_void>::ENCODING,
207        ],
208    );
209}
210
211#[cfg(all(
212    feature = "CVBuffer",
213    feature = "CVImageBuffer",
214    feature = "CVPixelBuffer",
215    feature = "objc2"
216))]
217unsafe impl RefEncode for CVFillExtendedPixelsCallBackData {
218    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
219}
220
221extern "C" {
222    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvpixelformatfillextendedpixelscallback?language=objc)
223    pub static kCVPixelFormatFillExtendedPixelsCallback: &'static CFString;
224}
225
226#[inline]
227pub unsafe extern "C-unwind" fn CVPixelFormatDescriptionCreateWithPixelFormatType(
228    allocator: Option<&CFAllocator>,
229    pixel_format: OSType,
230) -> Option<CFRetained<CFDictionary>> {
231    extern "C-unwind" {
232        fn CVPixelFormatDescriptionCreateWithPixelFormatType(
233            allocator: Option<&CFAllocator>,
234            pixel_format: OSType,
235        ) -> Option<NonNull<CFDictionary>>;
236    }
237    let ret = unsafe { CVPixelFormatDescriptionCreateWithPixelFormatType(allocator, pixel_format) };
238    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
239}
240
241#[inline]
242pub unsafe extern "C-unwind" fn CVPixelFormatDescriptionArrayCreateWithAllPixelFormatTypes(
243    allocator: Option<&CFAllocator>,
244) -> Option<CFRetained<CFArray>> {
245    extern "C-unwind" {
246        fn CVPixelFormatDescriptionArrayCreateWithAllPixelFormatTypes(
247            allocator: Option<&CFAllocator>,
248        ) -> Option<NonNull<CFArray>>;
249    }
250    let ret = unsafe { CVPixelFormatDescriptionArrayCreateWithAllPixelFormatTypes(allocator) };
251    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
252}
253
254extern "C-unwind" {
255    pub fn CVPixelFormatDescriptionRegisterDescriptionWithPixelFormatType(
256        description: &CFDictionary,
257        pixel_format: OSType,
258    );
259}
260
261/// Checks if a compressed pixel format is supported on the current platform.
262///
263/// Parameter `pixelFormatType`: compressed pixel format.
264///
265/// Returns: True if pixel format is supported on the current platform.
266#[inline]
267pub unsafe extern "C-unwind" fn CVIsCompressedPixelFormatAvailable(
268    pixel_format_type: OSType,
269) -> bool {
270    extern "C-unwind" {
271        fn CVIsCompressedPixelFormatAvailable(pixel_format_type: OSType) -> Boolean;
272    }
273    let ret = unsafe { CVIsCompressedPixelFormatAvailable(pixel_format_type) };
274    ret != 0
275}