Skip to main content

ImageDecodeDevice

Trait ImageDecodeDevice 

Source
pub trait ImageDecodeDevice<'a>: ImageDecode<'a> {
    type DeviceSurface: DeviceSurface;

    // Provided methods
    fn decode_to_device(
        &mut self,
        fmt: PixelFormat,
        backend: BackendRequest,
    ) -> Result<<Self as ImageDecodeDevice<'a>>::DeviceSurface, Self::Error>
       where Self: ImageDecodeSubmit<'a, DeviceSurface = <Self as ImageDecodeDevice<'a>>::DeviceSurface> { ... }
    fn decode_region_to_device(
        &mut self,
        fmt: PixelFormat,
        roi: Rect,
        backend: BackendRequest,
    ) -> Result<<Self as ImageDecodeDevice<'a>>::DeviceSurface, Self::Error>
       where Self: ImageDecodeSubmit<'a, DeviceSurface = <Self as ImageDecodeDevice<'a>>::DeviceSurface> { ... }
    fn decode_scaled_to_device(
        &mut self,
        fmt: PixelFormat,
        scale: Downscale,
        backend: BackendRequest,
    ) -> Result<<Self as ImageDecodeDevice<'a>>::DeviceSurface, Self::Error>
       where Self: ImageDecodeSubmit<'a, DeviceSurface = <Self as ImageDecodeDevice<'a>>::DeviceSurface> { ... }
    fn decode_region_scaled_to_device(
        &mut self,
        fmt: PixelFormat,
        roi: Rect,
        scale: Downscale,
        backend: BackendRequest,
    ) -> Result<<Self as ImageDecodeDevice<'a>>::DeviceSurface, Self::Error>
       where Self: ImageDecodeSubmit<'a, DeviceSurface = <Self as ImageDecodeDevice<'a>>::DeviceSurface> { ... }
}
Expand description

Synchronous device-output decode API.

Required Associated Types§

Source

type DeviceSurface: DeviceSurface

Device surface returned by decode calls.

Provided Methods§

Source

fn decode_to_device( &mut self, fmt: PixelFormat, backend: BackendRequest, ) -> Result<<Self as ImageDecodeDevice<'a>>::DeviceSurface, Self::Error>
where Self: ImageDecodeSubmit<'a, DeviceSurface = <Self as ImageDecodeDevice<'a>>::DeviceSurface>,

Decode the full image to the requested backend.

§Errors

Returns the codec-specific ImageCodec::Error if submission or device execution fails.

Source

fn decode_region_to_device( &mut self, fmt: PixelFormat, roi: Rect, backend: BackendRequest, ) -> Result<<Self as ImageDecodeDevice<'a>>::DeviceSurface, Self::Error>
where Self: ImageDecodeSubmit<'a, DeviceSurface = <Self as ImageDecodeDevice<'a>>::DeviceSurface>,

Decode a source-coordinate region to the requested backend.

§Errors

Returns the codec-specific ImageCodec::Error if the region is invalid or submission or device execution fails.

Source

fn decode_scaled_to_device( &mut self, fmt: PixelFormat, scale: Downscale, backend: BackendRequest, ) -> Result<<Self as ImageDecodeDevice<'a>>::DeviceSurface, Self::Error>
where Self: ImageDecodeSubmit<'a, DeviceSurface = <Self as ImageDecodeDevice<'a>>::DeviceSurface>,

Decode the full image at reduced resolution to the requested backend.

§Errors

Returns the codec-specific ImageCodec::Error if the scale is unsupported or submission or device execution fails.

Source

fn decode_region_scaled_to_device( &mut self, fmt: PixelFormat, roi: Rect, scale: Downscale, backend: BackendRequest, ) -> Result<<Self as ImageDecodeDevice<'a>>::DeviceSurface, Self::Error>
where Self: ImageDecodeSubmit<'a, DeviceSurface = <Self as ImageDecodeDevice<'a>>::DeviceSurface>,

Decode a source-coordinate region at reduced resolution to the requested backend.

§Errors

Returns the codec-specific ImageCodec::Error if the region or scale is invalid or submission or device execution fails.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§