Skip to main content

IOSurfaceMetalExt

Trait IOSurfaceMetalExt 

Source
pub trait IOSurfaceMetalExt {
    // Required methods
    fn info(&self) -> IOSurfaceInfo;
    fn is_ycbcr_biplanar(&self) -> bool;
    fn texture_params(&self) -> Vec<TextureParams>;
    fn metal_textures<T, F>(
        &self,
        create_texture: F,
    ) -> Option<CapturedTextures<T>>
       where F: Fn(&TextureParams, *const c_void) -> Option<T>;
    fn create_metal_textures(
        &self,
        device: &MetalDevice,
    ) -> Option<MetalCapturedTextures>;
}
Expand description

Extension trait that adds Metal-related convenience methods to apple_cf::iosurface::IOSurface.

It’s a trait (rather than inherent impls) because Rust’s orphan rules forbid inherent impls on out-of-crate types.

Bring this trait into scope to call info(), texture_params(), metal_textures(...), create_metal_textures(...), etc. on any IOSurface.

Required Methods§

Source

fn info(&self) -> IOSurfaceInfo

Detailed information about this surface for Metal texture creation.

Source

fn is_ycbcr_biplanar(&self) -> bool

Whether this surface uses a YCbCr biplanar format.

Source

fn texture_params(&self) -> Vec<TextureParams>

Texture params (one per plane) needed to create matching Metal textures.

Source

fn metal_textures<T, F>(&self, create_texture: F) -> Option<CapturedTextures<T>>

Generic texture creation via user-supplied closure.

Source

fn create_metal_textures( &self, device: &MetalDevice, ) -> Option<MetalCapturedTextures>

Convenience: create concrete MetalTextures using a MetalDevice.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§