objc2_core_video/generated/
CVOpenGLTexture.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#[cfg(feature = "objc2-open-gl")]
6#[cfg(target_os = "macos")]
7use objc2_open_gl::*;
8
9use crate::*;
10
11/// OpenGL texture based image buffer
12///
13/// See also [Apple's documentation](https://developer.apple.com/documentation/corevideo/cvopengltexture?language=objc)
14#[doc(alias = "CVOpenGLTextureRef")]
15#[cfg(all(feature = "CVBuffer", feature = "CVImageBuffer"))]
16pub type CVOpenGLTexture = CVImageBuffer;
17
18#[deprecated = "OpenGL/OpenGLES is no longer supported. Use Metal APIs instead. (Define COREVIDEO_SILENCE_GL_DEPRECATION to silence these warnings)"]
19#[inline]
20pub extern "C-unwind" fn CVOpenGLTextureGetTypeID() -> CFTypeID {
21    extern "C-unwind" {
22        fn CVOpenGLTextureGetTypeID() -> CFTypeID;
23    }
24    unsafe { CVOpenGLTextureGetTypeID() }
25}
26
27/// Returns the texture target (eg. 2D vs. rect texture extension) of the CVOpenGLTexture
28///
29/// Parameter `image`: Target CVOpenGLTexture
30///
31/// Returns: OpenGL texture target
32#[cfg(all(
33    feature = "CVBuffer",
34    feature = "CVImageBuffer",
35    feature = "objc2-open-gl"
36))]
37#[cfg(target_os = "macos")]
38#[deprecated = "OpenGL/OpenGLES is no longer supported. Use Metal APIs instead. (Define COREVIDEO_SILENCE_GL_DEPRECATION to silence these warnings)"]
39#[inline]
40pub extern "C-unwind" fn CVOpenGLTextureGetTarget(image: &CVOpenGLTexture) -> GLenum {
41    extern "C-unwind" {
42        fn CVOpenGLTextureGetTarget(image: &CVOpenGLTexture) -> GLenum;
43    }
44    unsafe { CVOpenGLTextureGetTarget(image) }
45}
46
47/// Returns the texture target name of the CVOpenGLTexture
48///
49/// Parameter `image`: Target CVOpenGLTexture
50///
51/// Returns: OpenGL texture target name
52#[cfg(all(
53    feature = "CVBuffer",
54    feature = "CVImageBuffer",
55    feature = "objc2-open-gl"
56))]
57#[cfg(target_os = "macos")]
58#[deprecated = "OpenGL/OpenGLES is no longer supported. Use Metal APIs instead. (Define COREVIDEO_SILENCE_GL_DEPRECATION to silence these warnings)"]
59#[inline]
60pub extern "C-unwind" fn CVOpenGLTextureGetName(image: &CVOpenGLTexture) -> GLuint {
61    extern "C-unwind" {
62        fn CVOpenGLTextureGetName(image: &CVOpenGLTexture) -> GLuint;
63    }
64    unsafe { CVOpenGLTextureGetName(image) }
65}
66
67/// Returns whether the image is flipped vertically or not.
68///
69/// Parameter `image`: Target CVOpenGLTexture
70///
71/// Returns: True if 0,0 in the texture is upper left, false if 0,0 is lower left
72#[cfg(all(feature = "CVBuffer", feature = "CVImageBuffer"))]
73#[deprecated = "OpenGL/OpenGLES is no longer supported. Use Metal APIs instead. (Define COREVIDEO_SILENCE_GL_DEPRECATION to silence these warnings)"]
74#[inline]
75pub extern "C-unwind" fn CVOpenGLTextureIsFlipped(image: &CVOpenGLTexture) -> bool {
76    extern "C-unwind" {
77        fn CVOpenGLTextureIsFlipped(image: &CVOpenGLTexture) -> Boolean;
78    }
79    let ret = unsafe { CVOpenGLTextureIsFlipped(image) };
80    ret != 0
81}