objc2_core_video/generated/
CVOpenGLTextureCache.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::cell::UnsafeCell;
4use core::ffi::*;
5use core::marker::{PhantomData, PhantomPinned};
6use core::ptr::NonNull;
7use objc2_core_foundation::*;
8
9use crate::*;
10
11/// CoreVideo OpenGL Texture Cache
12///
13/// See also [Apple's documentation](https://developer.apple.com/documentation/corevideo/cvopengltexturecache?language=objc)
14#[repr(C)]
15pub struct CVOpenGLTextureCache {
16    inner: [u8; 0],
17    _p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
18}
19
20cf_type!(
21    #[encoding_name = "__CVOpenGLTextureCache"]
22    unsafe impl CVOpenGLTextureCache {}
23);
24
25extern "C" {
26    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvopengltexturecachechromasamplingmodekey?language=objc)
27    pub static kCVOpenGLTextureCacheChromaSamplingModeKey: &'static CFString;
28}
29
30extern "C" {
31    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvopengltexturecachechromasamplingmodeautomatic?language=objc)
32    pub static kCVOpenGLTextureCacheChromaSamplingModeAutomatic: &'static CFString;
33}
34
35extern "C" {
36    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvopengltexturecachechromasamplingmodehighestquality?language=objc)
37    pub static kCVOpenGLTextureCacheChromaSamplingModeHighestQuality: &'static CFString;
38}
39
40extern "C" {
41    /// [Apple's documentation](https://developer.apple.com/documentation/corevideo/kcvopengltexturecachechromasamplingmodebestperformance?language=objc)
42    pub static kCVOpenGLTextureCacheChromaSamplingModeBestPerformance: &'static CFString;
43}
44
45unsafe impl ConcreteType for CVOpenGLTextureCache {
46    #[doc(alias = "CVOpenGLTextureCacheGetTypeID")]
47    #[inline]
48    fn type_id() -> CFTypeID {
49        extern "C-unwind" {
50            fn CVOpenGLTextureCacheGetTypeID() -> CFTypeID;
51        }
52        unsafe { CVOpenGLTextureCacheGetTypeID() }
53    }
54}
55
56extern "C-unwind" {
57    /// Creates a CVOpenGLTexture object from an existing CVImageBuffer
58    ///
59    /// Parameter `allocator`: The CFAllocatorRef to use for allocating the CVOpenGLTexture object.  May be NULL.
60    ///
61    /// Parameter `textureCache`: The texture cache object that will manage the texture
62    ///
63    /// Parameter `sourceImage`: The CVImageBuffer that you want to create a CVOpenGLTexture from.
64    ///
65    /// Parameter `attributes`: For Future use only! - The desired buffer attributes for the CVOpenGLTexture.
66    ///
67    /// Parameter `textureOut`: The newly created texture object will be placed here.
68    ///
69    /// Returns: Returns kCVReturnSuccess on success
70    #[cfg(all(
71        feature = "CVBuffer",
72        feature = "CVImageBuffer",
73        feature = "CVOpenGLTexture",
74        feature = "CVReturn"
75    ))]
76    #[deprecated = "OpenGL/OpenGLES is no longer supported. Use Metal APIs instead. (Define COREVIDEO_SILENCE_GL_DEPRECATION to silence these warnings)"]
77    pub fn CVOpenGLTextureCacheCreateTextureFromImage(
78        allocator: Option<&CFAllocator>,
79        texture_cache: &CVOpenGLTextureCache,
80        source_image: &CVImageBuffer,
81        attributes: Option<&CFDictionary>,
82        texture_out: NonNull<*mut CVOpenGLTexture>,
83    ) -> CVReturn;
84}
85
86extern "C-unwind" {
87    /// Performs internal housekeeping/recycling operations
88    ///
89    /// This call must be made periodically to give the texture cache a chance to make OpenGL calls
90    /// on the OpenGL context used to create it in order to do housekeeping operations.
91    ///
92    /// Parameter `textureCache`: The texture cache object to flush
93    ///
94    /// Parameter `options`: Currently unused, set to 0.
95    ///
96    /// Returns: Returns kCVReturnSuccess on success
97    #[cfg(feature = "CVBase")]
98    #[deprecated = "OpenGL/OpenGLES is no longer supported. Use Metal APIs instead. (Define COREVIDEO_SILENCE_GL_DEPRECATION to silence these warnings)"]
99    pub fn CVOpenGLTextureCacheFlush(texture_cache: &CVOpenGLTextureCache, options: CVOptionFlags);
100}