objc2_core_video/generated/
CVOpenGLBuffer.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2_core_foundation::*;
5
6use crate::*;
7
8extern "C" {
9    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvopenglbufferwidth?language=objc)
10    pub static kCVOpenGLBufferWidth: &'static CFString;
11}
12
13extern "C" {
14    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvopenglbufferheight?language=objc)
15    pub static kCVOpenGLBufferHeight: &'static CFString;
16}
17
18extern "C" {
19    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvopenglbuffertarget?language=objc)
20    pub static kCVOpenGLBufferTarget: &'static CFString;
21}
22
23extern "C" {
24    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvopenglbufferinternalformat?language=objc)
25    pub static kCVOpenGLBufferInternalFormat: &'static CFString;
26}
27
28extern "C" {
29    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvopenglbuffermaximummipmaplevel?language=objc)
30    pub static kCVOpenGLBufferMaximumMipmapLevel: &'static CFString;
31}
32
33/// [Apple's documentation](https://developer.apple.com/documentation/corevideo/cvopenglbuffer?language=objc)
34#[cfg(all(feature = "CVBuffer", feature = "CVImageBuffer"))]
35pub type CVOpenGLBuffer = CVImageBuffer;
36
37#[deprecated = "OpenGL/OpenGLES is no longer supported. Use Metal APIs instead. (Define COREVIDEO_SILENCE_GL_DEPRECATION to silence these warnings)"]
38#[inline]
39pub extern "C-unwind" fn CVOpenGLBufferGetTypeID() -> CFTypeID {
40    extern "C-unwind" {
41        fn CVOpenGLBufferGetTypeID() -> CFTypeID;
42    }
43    unsafe { CVOpenGLBufferGetTypeID() }
44}
45
46extern "C-unwind" {
47    /// Create a new CVOpenGLBuffer that may be used for OpenGL rendering purposes
48    ///
49    /// Parameter `width`: The width of the buffer in pixels
50    ///
51    /// Parameter `height`: The height of the buffer in pixels
52    ///
53    /// Parameter `attributes`: A CFDictionaryRef containing other desired attributes of the buffer (texture target, internal format, max mipmap level, etc.).
54    /// May be NULL.  Defaults are GL_TEXTURE_RECTANGLE_EXT, GL_RGBA, and 0 for kCVOpenGLBufferTarget, kCVOpenGLBufferInternalFormat and kCVOpenGLBufferMaximumMipmapLevel,
55    /// respectively.
56    ///
57    /// Parameter `bufferOut`: The newly created buffer will be placed here.
58    ///
59    /// Returns: kCVReturnSuccess if the attachment succeeded
60    #[cfg(all(feature = "CVBuffer", feature = "CVImageBuffer", feature = "CVReturn"))]
61    #[deprecated = "OpenGL/OpenGLES is no longer supported. Use Metal APIs instead. (Define COREVIDEO_SILENCE_GL_DEPRECATION to silence these warnings)"]
62    pub fn CVOpenGLBufferCreate(
63        allocator: Option<&CFAllocator>,
64        width: usize,
65        height: usize,
66        attributes: Option<&CFDictionary>,
67        buffer_out: NonNull<*mut CVOpenGLBuffer>,
68    ) -> CVReturn;
69}
70
71/// Parameter `openGLBuffer`: Target OpenGL Buffer.
72///
73/// Returns: CVOpenGLBuffer attributes dictionary, NULL if not set.
74#[cfg(all(feature = "CVBuffer", feature = "CVImageBuffer"))]
75#[deprecated = "OpenGL/OpenGLES is no longer supported. Use Metal APIs instead. (Define COREVIDEO_SILENCE_GL_DEPRECATION to silence these warnings)"]
76#[inline]
77pub unsafe extern "C-unwind" fn CVOpenGLBufferGetAttributes(
78    open_gl_buffer: &CVOpenGLBuffer,
79) -> Option<CFRetained<CFDictionary>> {
80    extern "C-unwind" {
81        fn CVOpenGLBufferGetAttributes(
82            open_gl_buffer: &CVOpenGLBuffer,
83        ) -> Option<NonNull<CFDictionary>>;
84    }
85    let ret = unsafe { CVOpenGLBufferGetAttributes(open_gl_buffer) };
86    ret.map(|ret| unsafe { CFRetained::retain(ret) })
87}