objc2_core_video/generated/
CVOpenGLTextureCache.rs1use core::cell::UnsafeCell;
4use core::ffi::*;
5use core::marker::{PhantomData, PhantomPinned};
6use core::ptr::NonNull;
7#[cfg(feature = "objc2")]
8use objc2::__framework_prelude::*;
9use objc2_core_foundation::*;
10#[cfg(feature = "objc2-open-gl")]
11#[cfg(target_os = "macos")]
12use objc2_open_gl::*;
13
14use crate::*;
15
16#[doc(alias = "CVOpenGLTextureCacheRef")]
20#[repr(C)]
21pub struct CVOpenGLTextureCache {
22 inner: [u8; 0],
23 _p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
24}
25
26cf_type!(
27 unsafe impl CVOpenGLTextureCache {}
28);
29#[cfg(feature = "objc2")]
30cf_objc2_type!(
31 unsafe impl RefEncode<"__CVOpenGLTextureCache"> for CVOpenGLTextureCache {}
32);
33
34extern "C" {
35 #[deprecated = "OpenGL/OpenGLES is no longer supported. Use Metal APIs instead. (Define COREVIDEO_SILENCE_GL_DEPRECATION to silence these warnings)"]
37 pub static kCVOpenGLTextureCacheChromaSamplingModeKey: &'static CFString;
38}
39
40extern "C" {
41 #[deprecated = "OpenGL/OpenGLES is no longer supported. Use Metal APIs instead. (Define COREVIDEO_SILENCE_GL_DEPRECATION to silence these warnings)"]
43 pub static kCVOpenGLTextureCacheChromaSamplingModeAutomatic: &'static CFString;
44}
45
46extern "C" {
47 #[deprecated = "OpenGL/OpenGLES is no longer supported. Use Metal APIs instead. (Define COREVIDEO_SILENCE_GL_DEPRECATION to silence these warnings)"]
49 pub static kCVOpenGLTextureCacheChromaSamplingModeHighestQuality: &'static CFString;
50}
51
52extern "C" {
53 #[deprecated = "OpenGL/OpenGLES is no longer supported. Use Metal APIs instead. (Define COREVIDEO_SILENCE_GL_DEPRECATION to silence these warnings)"]
55 pub static kCVOpenGLTextureCacheChromaSamplingModeBestPerformance: &'static CFString;
56}
57
58unsafe impl ConcreteType for CVOpenGLTextureCache {
59 #[doc(alias = "CVOpenGLTextureCacheGetTypeID")]
60 #[inline]
61 fn type_id() -> CFTypeID {
62 extern "C-unwind" {
63 fn CVOpenGLTextureCacheGetTypeID() -> CFTypeID;
64 }
65 unsafe { CVOpenGLTextureCacheGetTypeID() }
66 }
67}
68
69impl CVOpenGLTextureCache {
70 #[doc(alias = "CVOpenGLTextureCacheCreate")]
94 #[cfg(all(feature = "CVReturn", feature = "objc2-open-gl"))]
95 #[cfg(target_os = "macos")]
96 #[deprecated = "OpenGL/OpenGLES is no longer supported. Use Metal APIs instead. (Define COREVIDEO_SILENCE_GL_DEPRECATION to silence these warnings)"]
97 #[inline]
98 pub unsafe fn create(
99 allocator: Option<&CFAllocator>,
100 cache_attributes: Option<&CFDictionary>,
101 cgl_context: CGLContextObj,
102 cgl_pixel_format: CGLPixelFormatObj,
103 texture_attributes: Option<&CFDictionary>,
104 cache_out: NonNull<*mut CVOpenGLTextureCache>,
105 ) -> CVReturn {
106 extern "C-unwind" {
107 fn CVOpenGLTextureCacheCreate(
108 allocator: Option<&CFAllocator>,
109 cache_attributes: Option<&CFDictionary>,
110 cgl_context: CGLContextObj,
111 cgl_pixel_format: CGLPixelFormatObj,
112 texture_attributes: Option<&CFDictionary>,
113 cache_out: NonNull<*mut CVOpenGLTextureCache>,
114 ) -> CVReturn;
115 }
116 unsafe {
117 CVOpenGLTextureCacheCreate(
118 allocator,
119 cache_attributes,
120 cgl_context,
121 cgl_pixel_format,
122 texture_attributes,
123 cache_out,
124 )
125 }
126 }
127
128 #[doc(alias = "CVOpenGLTextureCacheCreateTextureFromImage")]
147 #[cfg(all(
148 feature = "CVBuffer",
149 feature = "CVImageBuffer",
150 feature = "CVOpenGLTexture",
151 feature = "CVReturn"
152 ))]
153 #[deprecated = "OpenGL/OpenGLES is no longer supported. Use Metal APIs instead. (Define COREVIDEO_SILENCE_GL_DEPRECATION to silence these warnings)"]
154 #[inline]
155 pub unsafe fn create_texture_from_image(
156 allocator: Option<&CFAllocator>,
157 texture_cache: &CVOpenGLTextureCache,
158 source_image: &CVImageBuffer,
159 attributes: Option<&CFDictionary>,
160 texture_out: NonNull<*mut CVOpenGLTexture>,
161 ) -> CVReturn {
162 extern "C-unwind" {
163 fn CVOpenGLTextureCacheCreateTextureFromImage(
164 allocator: Option<&CFAllocator>,
165 texture_cache: &CVOpenGLTextureCache,
166 source_image: &CVImageBuffer,
167 attributes: Option<&CFDictionary>,
168 texture_out: NonNull<*mut CVOpenGLTexture>,
169 ) -> CVReturn;
170 }
171 unsafe {
172 CVOpenGLTextureCacheCreateTextureFromImage(
173 allocator,
174 texture_cache,
175 source_image,
176 attributes,
177 texture_out,
178 )
179 }
180 }
181
182 #[doc(alias = "CVOpenGLTextureCacheFlush")]
193 #[cfg(feature = "CVBase")]
194 #[deprecated = "OpenGL/OpenGLES is no longer supported. Use Metal APIs instead. (Define COREVIDEO_SILENCE_GL_DEPRECATION to silence these warnings)"]
195 #[inline]
196 pub fn flush(&self, options: CVOptionFlags) {
197 extern "C-unwind" {
198 fn CVOpenGLTextureCacheFlush(
199 texture_cache: &CVOpenGLTextureCache,
200 options: CVOptionFlags,
201 );
202 }
203 unsafe { CVOpenGLTextureCacheFlush(self, options) }
204 }
205}
206
207extern "C-unwind" {
208 #[cfg(all(feature = "CVReturn", feature = "objc2-open-gl"))]
209 #[cfg(target_os = "macos")]
210 #[deprecated = "renamed to `CVOpenGLTextureCache::create`"]
211 pub fn CVOpenGLTextureCacheCreate(
212 allocator: Option<&CFAllocator>,
213 cache_attributes: Option<&CFDictionary>,
214 cgl_context: CGLContextObj,
215 cgl_pixel_format: CGLPixelFormatObj,
216 texture_attributes: Option<&CFDictionary>,
217 cache_out: NonNull<*mut CVOpenGLTextureCache>,
218 ) -> CVReturn;
219}
220
221extern "C-unwind" {
222 #[cfg(all(
223 feature = "CVBuffer",
224 feature = "CVImageBuffer",
225 feature = "CVOpenGLTexture",
226 feature = "CVReturn"
227 ))]
228 #[deprecated = "renamed to `CVOpenGLTextureCache::create_texture_from_image`"]
229 pub fn CVOpenGLTextureCacheCreateTextureFromImage(
230 allocator: Option<&CFAllocator>,
231 texture_cache: &CVOpenGLTextureCache,
232 source_image: &CVImageBuffer,
233 attributes: Option<&CFDictionary>,
234 texture_out: NonNull<*mut CVOpenGLTexture>,
235 ) -> CVReturn;
236}
237
238#[cfg(feature = "CVBase")]
239#[deprecated = "renamed to `CVOpenGLTextureCache::flush`"]
240#[inline]
241pub extern "C-unwind" fn CVOpenGLTextureCacheFlush(
242 texture_cache: &CVOpenGLTextureCache,
243 options: CVOptionFlags,
244) {
245 extern "C-unwind" {
246 fn CVOpenGLTextureCacheFlush(texture_cache: &CVOpenGLTextureCache, options: CVOptionFlags);
247 }
248 unsafe { CVOpenGLTextureCacheFlush(texture_cache, options) }
249}