use core::ptr::NonNull;
#[cfg(feature = "objc2")]
use objc2::__framework_prelude::*;
use objc2_core_foundation::*;
#[cfg(feature = "objc2-metal")]
#[cfg(not(target_os = "watchos"))]
use objc2_metal::*;
use crate::*;
#[doc(alias = "CVMetalTextureRef")]
#[cfg(all(feature = "CVBuffer", feature = "CVImageBuffer"))]
pub type CVMetalTexture = CVImageBuffer;
#[inline]
pub extern "C-unwind" fn CVMetalTextureGetTypeID() -> CFTypeID {
extern "C-unwind" {
fn CVMetalTextureGetTypeID() -> CFTypeID;
}
unsafe { CVMetalTextureGetTypeID() }
}
#[cfg(all(
feature = "CVBuffer",
feature = "CVImageBuffer",
feature = "objc2",
feature = "objc2-metal"
))]
#[cfg(not(target_os = "watchos"))]
#[inline]
pub extern "C-unwind" fn CVMetalTextureGetTexture(
image: &CVMetalTexture,
) -> Option<Retained<ProtocolObject<dyn MTLTexture>>> {
extern "C-unwind" {
fn CVMetalTextureGetTexture(image: &CVMetalTexture) -> *mut ProtocolObject<dyn MTLTexture>;
}
let ret = unsafe { CVMetalTextureGetTexture(image) };
unsafe { Retained::retain_autoreleased(ret) }
}
#[cfg(all(feature = "CVBuffer", feature = "CVImageBuffer"))]
#[inline]
pub extern "C-unwind" fn CVMetalTextureIsFlipped(image: &CVMetalTexture) -> bool {
extern "C-unwind" {
fn CVMetalTextureIsFlipped(image: &CVMetalTexture) -> Boolean;
}
let ret = unsafe { CVMetalTextureIsFlipped(image) };
ret != 0
}
extern "C" {
pub static kCVMetalTextureUsage: &'static CFString;
}
extern "C" {
pub static kCVMetalTextureStorageMode: &'static CFString;
}