objc2_core_video/generated/
CVPixelFormatDescription.rs1use 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 pub static kCVPixelFormatName: &'static CFString;
14}
15
16extern "C" {
17 pub static kCVPixelFormatConstant: &'static CFString;
19}
20
21extern "C" {
22 pub static kCVPixelFormatCodecType: &'static CFString;
24}
25
26extern "C" {
27 pub static kCVPixelFormatFourCC: &'static CFString;
29}
30
31extern "C" {
32 pub static kCVPixelFormatContainsAlpha: &'static CFString;
34}
35
36extern "C" {
37 pub static kCVPixelFormatContainsYCbCr: &'static CFString;
39}
40
41extern "C" {
42 pub static kCVPixelFormatContainsRGB: &'static CFString;
44}
45
46extern "C" {
47 pub static kCVPixelFormatContainsGrayscale: &'static CFString;
49}
50
51extern "C" {
52 pub static kCVPixelFormatContainsSenselArray: &'static CFString;
54}
55
56extern "C" {
57 pub static kCVPixelFormatComponentRange: &'static CFString;
59}
60
61extern "C" {
62 pub static kCVPixelFormatComponentRange_VideoRange: &'static CFString;
64}
65
66extern "C" {
67 pub static kCVPixelFormatComponentRange_FullRange: &'static CFString;
69}
70
71extern "C" {
72 pub static kCVPixelFormatComponentRange_WideRange: &'static CFString;
74}
75
76extern "C" {
77 pub static kCVPixelFormatPlanes: &'static CFString;
79}
80
81extern "C" {
82 pub static kCVPixelFormatBlockWidth: &'static CFString;
84}
85
86extern "C" {
87 pub static kCVPixelFormatBlockHeight: &'static CFString;
89}
90
91extern "C" {
92 pub static kCVPixelFormatBitsPerBlock: &'static CFString;
94}
95
96extern "C" {
97 pub static kCVPixelFormatBitsPerComponent: &'static CFString;
99}
100
101extern "C" {
102 pub static kCVPixelFormatBlockHorizontalAlignment: &'static CFString;
104}
105
106extern "C" {
107 pub static kCVPixelFormatBlockVerticalAlignment: &'static CFString;
109}
110
111extern "C" {
112 pub static kCVPixelFormatBlackBlock: &'static CFString;
114}
115
116extern "C" {
117 pub static kCVPixelFormatHorizontalSubsampling: &'static CFString;
119}
120
121extern "C" {
122 pub static kCVPixelFormatVerticalSubsampling: &'static CFString;
124}
125
126extern "C" {
127 pub static kCVPixelFormatOpenGLFormat: &'static CFString;
129}
130
131extern "C" {
132 pub static kCVPixelFormatOpenGLType: &'static CFString;
134}
135
136extern "C" {
137 pub static kCVPixelFormatOpenGLInternalFormat: &'static CFString;
139}
140
141extern "C" {
142 pub static kCVPixelFormatCGBitmapInfo: &'static CFString;
144}
145
146extern "C" {
147 pub static kCVPixelFormatQDCompatibility: &'static CFString;
149}
150
151extern "C" {
152 pub static kCVPixelFormatCGBitmapContextCompatibility: &'static CFString;
154}
155
156extern "C" {
157 pub static kCVPixelFormatCGImageCompatibility: &'static CFString;
159}
160
161extern "C" {
162 pub static kCVPixelFormatOpenGLCompatibility: &'static CFString;
164}
165
166extern "C" {
167 pub static kCVPixelFormatOpenGLESCompatibility: &'static CFString;
169}
170
171#[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#[cfg(all(
182 feature = "CVBuffer",
183 feature = "CVImageBuffer",
184 feature = "CVPixelBuffer"
185))]
186#[repr(C)]
187#[allow(unpredictable_function_pointer_comparisons)]
188#[derive(Clone, Copy, Debug, PartialEq)]
189pub struct CVFillExtendedPixelsCallBackData {
190 pub version: CFIndex,
191 pub fillCallBack: CVFillExtendedPixelsCallBack,
192 pub refCon: *mut c_void,
193}
194
195#[cfg(all(
196 feature = "CVBuffer",
197 feature = "CVImageBuffer",
198 feature = "CVPixelBuffer",
199 feature = "objc2"
200))]
201unsafe impl Encode for CVFillExtendedPixelsCallBackData {
202 const ENCODING: Encoding = Encoding::Struct(
203 "?",
204 &[
205 <CFIndex>::ENCODING,
206 <CVFillExtendedPixelsCallBack>::ENCODING,
207 <*mut c_void>::ENCODING,
208 ],
209 );
210}
211
212#[cfg(all(
213 feature = "CVBuffer",
214 feature = "CVImageBuffer",
215 feature = "CVPixelBuffer",
216 feature = "objc2"
217))]
218unsafe impl RefEncode for CVFillExtendedPixelsCallBackData {
219 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
220}
221
222extern "C" {
223 pub static kCVPixelFormatFillExtendedPixelsCallback: &'static CFString;
225}
226
227#[inline]
228pub extern "C-unwind" fn CVPixelFormatDescriptionCreateWithPixelFormatType(
229 allocator: Option<&CFAllocator>,
230 pixel_format: OSType,
231) -> Option<CFRetained<CFDictionary>> {
232 extern "C-unwind" {
233 fn CVPixelFormatDescriptionCreateWithPixelFormatType(
234 allocator: Option<&CFAllocator>,
235 pixel_format: OSType,
236 ) -> Option<NonNull<CFDictionary>>;
237 }
238 let ret = unsafe { CVPixelFormatDescriptionCreateWithPixelFormatType(allocator, pixel_format) };
239 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
240}
241
242#[inline]
243pub extern "C-unwind" fn CVPixelFormatDescriptionArrayCreateWithAllPixelFormatTypes(
244 allocator: Option<&CFAllocator>,
245) -> Option<CFRetained<CFArray>> {
246 extern "C-unwind" {
247 fn CVPixelFormatDescriptionArrayCreateWithAllPixelFormatTypes(
248 allocator: Option<&CFAllocator>,
249 ) -> Option<NonNull<CFArray>>;
250 }
251 let ret = unsafe { CVPixelFormatDescriptionArrayCreateWithAllPixelFormatTypes(allocator) };
252 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
253}
254
255extern "C-unwind" {
256 pub fn CVPixelFormatDescriptionRegisterDescriptionWithPixelFormatType(
260 description: &CFDictionary,
261 pixel_format: OSType,
262 );
263}
264
265#[inline]
271pub extern "C-unwind" fn CVPixelFormatTypeCopyFourCharCodeString(
272 pixel_format: OSType,
273) -> CFRetained<CFString> {
274 extern "C-unwind" {
275 fn CVPixelFormatTypeCopyFourCharCodeString(
276 pixel_format: OSType,
277 ) -> Option<NonNull<CFString>>;
278 }
279 let ret = unsafe { CVPixelFormatTypeCopyFourCharCodeString(pixel_format) };
280 let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
281 unsafe { CFRetained::from_raw(ret) }
282}
283
284#[inline]
290pub extern "C-unwind" fn CVIsCompressedPixelFormatAvailable(pixel_format_type: OSType) -> bool {
291 extern "C-unwind" {
292 fn CVIsCompressedPixelFormatAvailable(pixel_format_type: OSType) -> Boolean;
293 }
294 let ret = unsafe { CVIsCompressedPixelFormatAvailable(pixel_format_type) };
295 ret != 0
296}