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#[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 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#[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}