pub trait ImageDecodeSubmit<'a>: ImageDecode<'a> {
type Session: Default + Send;
type DeviceSurface: DeviceSurface;
type SubmittedSurface: DeviceSubmission<Output = Self::DeviceSurface, Error = Self::Error>;
// Required methods
fn submit_to_device(
&mut self,
session: &mut Self::Session,
fmt: PixelFormat,
backend: BackendRequest,
) -> Result<Self::SubmittedSurface, Self::Error>;
fn submit_region_to_device(
&mut self,
session: &mut Self::Session,
fmt: PixelFormat,
roi: Rect,
backend: BackendRequest,
) -> Result<Self::SubmittedSurface, Self::Error>;
fn submit_scaled_to_device(
&mut self,
session: &mut Self::Session,
fmt: PixelFormat,
scale: Downscale,
backend: BackendRequest,
) -> Result<Self::SubmittedSurface, Self::Error>;
fn submit_region_scaled_to_device(
&mut self,
session: &mut Self::Session,
fmt: PixelFormat,
roi: Rect,
scale: Downscale,
backend: BackendRequest,
) -> Result<Self::SubmittedSurface, Self::Error>;
}Expand description
Decode API for implementations that can submit work to a device backend.
Required Associated Types§
Sourcetype DeviceSurface: DeviceSurface
type DeviceSurface: DeviceSurface
Device surface returned by completed submissions.
Sourcetype SubmittedSurface: DeviceSubmission<Output = Self::DeviceSurface, Error = Self::Error>
type SubmittedSurface: DeviceSubmission<Output = Self::DeviceSurface, Error = Self::Error>
Submission handle type.
Required Methods§
Sourcefn submit_to_device(
&mut self,
session: &mut Self::Session,
fmt: PixelFormat,
backend: BackendRequest,
) -> Result<Self::SubmittedSurface, Self::Error>
fn submit_to_device( &mut self, session: &mut Self::Session, fmt: PixelFormat, backend: BackendRequest, ) -> Result<Self::SubmittedSurface, Self::Error>
Submit full-image decode to the requested backend.
§Errors
Returns the codec-specific ImageCodec::Error when the request is invalid, unsupported,
or cannot be submitted.
Sourcefn submit_region_to_device(
&mut self,
session: &mut Self::Session,
fmt: PixelFormat,
roi: Rect,
backend: BackendRequest,
) -> Result<Self::SubmittedSurface, Self::Error>
fn submit_region_to_device( &mut self, session: &mut Self::Session, fmt: PixelFormat, roi: Rect, backend: BackendRequest, ) -> Result<Self::SubmittedSurface, Self::Error>
Submit region decode to the requested backend.
§Errors
Returns the codec-specific ImageCodec::Error when the region or backend request is
invalid, unsupported, or cannot be submitted.
Sourcefn submit_scaled_to_device(
&mut self,
session: &mut Self::Session,
fmt: PixelFormat,
scale: Downscale,
backend: BackendRequest,
) -> Result<Self::SubmittedSurface, Self::Error>
fn submit_scaled_to_device( &mut self, session: &mut Self::Session, fmt: PixelFormat, scale: Downscale, backend: BackendRequest, ) -> Result<Self::SubmittedSurface, Self::Error>
Submit reduced-resolution decode to the requested backend.
§Errors
Returns the codec-specific ImageCodec::Error when the scale or backend request is
invalid, unsupported, or cannot be submitted.
Sourcefn submit_region_scaled_to_device(
&mut self,
session: &mut Self::Session,
fmt: PixelFormat,
roi: Rect,
scale: Downscale,
backend: BackendRequest,
) -> Result<Self::SubmittedSurface, Self::Error>
fn submit_region_scaled_to_device( &mut self, session: &mut Self::Session, fmt: PixelFormat, roi: Rect, scale: Downscale, backend: BackendRequest, ) -> Result<Self::SubmittedSurface, Self::Error>
Submit region decode at reduced resolution to the requested backend.
§Errors
Returns the codec-specific ImageCodec::Error when the region, scale, or backend request
is invalid, unsupported, or cannot be submitted.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".