pub struct Decoder<'a> { /* private fields */ }Expand description
JPEG decoder that can return host or CUDA-resident surfaces.
Implementations§
Trait Implementations§
Source§impl ImageCodec for Decoder<'_>
impl ImageCodec for Decoder<'_>
Source§impl<'a> ImageDecode<'a> for Decoder<'a>
impl<'a> ImageDecode<'a> for Decoder<'a>
Source§fn inspect(input: &'a [u8]) -> Result<Info, Self::Error>
fn inspect(input: &'a [u8]) -> Result<Info, Self::Error>
Inspect metadata without decoding pixels.
Source§fn parse(input: &'a [u8]) -> Result<Self::View, Self::Error>
fn parse(input: &'a [u8]) -> Result<Self::View, Self::Error>
Parse compressed bytes into a borrowed view.
Source§fn from_view(view: Self::View) -> Result<Self, Self::Error>
fn from_view(view: Self::View) -> Result<Self, Self::Error>
Build a decoder from a parsed view.
Source§fn decode_into(
&mut self,
out: &mut [u8],
stride: usize,
fmt: PixelFormat,
) -> Result<DecodeOutcome<Self::Warning>, Self::Error>
fn decode_into( &mut self, out: &mut [u8], stride: usize, fmt: PixelFormat, ) -> Result<DecodeOutcome<Self::Warning>, Self::Error>
Decode the full image into caller-owned output.
Source§fn decode_into_with_scratch(
&mut self,
pool: &mut Self::Pool,
out: &mut [u8],
stride: usize,
fmt: PixelFormat,
) -> Result<DecodeOutcome<Self::Warning>, Self::Error>
fn decode_into_with_scratch( &mut self, pool: &mut Self::Pool, out: &mut [u8], stride: usize, fmt: PixelFormat, ) -> Result<DecodeOutcome<Self::Warning>, Self::Error>
Decode the full image into caller-owned output with reusable scratch.
Source§fn decode_region_into(
&mut self,
pool: &mut Self::Pool,
out: &mut [u8],
stride: usize,
fmt: PixelFormat,
roi: Rect,
) -> Result<DecodeOutcome<Self::Warning>, Self::Error>
fn decode_region_into( &mut self, pool: &mut Self::Pool, out: &mut [u8], stride: usize, fmt: PixelFormat, roi: Rect, ) -> Result<DecodeOutcome<Self::Warning>, Self::Error>
Decode a source-coordinate region into caller-owned output.
Source§fn decode_scaled_into(
&mut self,
pool: &mut Self::Pool,
out: &mut [u8],
stride: usize,
fmt: PixelFormat,
scale: Downscale,
) -> Result<DecodeOutcome<Self::Warning>, Self::Error>
fn decode_scaled_into( &mut self, pool: &mut Self::Pool, out: &mut [u8], stride: usize, fmt: PixelFormat, scale: Downscale, ) -> Result<DecodeOutcome<Self::Warning>, Self::Error>
Decode the full image at reduced resolution into caller-owned output.
Source§fn decode_region_scaled_into(
&mut self,
pool: &mut Self::Pool,
out: &mut [u8],
stride: usize,
fmt: PixelFormat,
roi: Rect,
scale: Downscale,
) -> Result<DecodeOutcome<Self::Warning>, Self::Error>
fn decode_region_scaled_into( &mut self, pool: &mut Self::Pool, out: &mut [u8], stride: usize, fmt: PixelFormat, roi: Rect, scale: Downscale, ) -> Result<DecodeOutcome<Self::Warning>, Self::Error>
Decode a source-coordinate region at reduced resolution into caller-owned output.
Source§fn decode_request_into(
&mut self,
pool: &mut Self::Pool,
out: &mut [u8],
stride: usize,
fmt: PixelFormat,
request: DecodeRequest,
) -> Result<DecodeOutcome<Self::Warning>, Self::Error>
fn decode_request_into( &mut self, pool: &mut Self::Pool, out: &mut [u8], stride: usize, fmt: PixelFormat, request: DecodeRequest, ) -> Result<DecodeOutcome<Self::Warning>, Self::Error>
Decode a normalized full/ROI/scaled request into caller-owned output.
Source§impl<'a> ImageDecodeDevice<'a> for Decoder<'a>
impl<'a> ImageDecodeDevice<'a> for Decoder<'a>
Source§type DeviceSurface = Surface
type DeviceSurface = Surface
Device surface returned by decode calls.
Source§fn decode_to_device(
&mut self,
fmt: PixelFormat,
backend: BackendRequest,
) -> Result<Self::DeviceSurface, Self::Error>where
Self: ImageDecodeSubmit<'a, DeviceSurface = Self::DeviceSurface>,
fn decode_to_device(
&mut self,
fmt: PixelFormat,
backend: BackendRequest,
) -> Result<Self::DeviceSurface, Self::Error>where
Self: ImageDecodeSubmit<'a, DeviceSurface = Self::DeviceSurface>,
Decode the full image to the requested backend.
Source§fn decode_region_to_device(
&mut self,
fmt: PixelFormat,
roi: Rect,
backend: BackendRequest,
) -> Result<Self::DeviceSurface, Self::Error>where
Self: ImageDecodeSubmit<'a, DeviceSurface = Self::DeviceSurface>,
fn decode_region_to_device(
&mut self,
fmt: PixelFormat,
roi: Rect,
backend: BackendRequest,
) -> Result<Self::DeviceSurface, Self::Error>where
Self: ImageDecodeSubmit<'a, DeviceSurface = Self::DeviceSurface>,
Decode a source-coordinate region to the requested backend.
Source§fn decode_scaled_to_device(
&mut self,
fmt: PixelFormat,
scale: Downscale,
backend: BackendRequest,
) -> Result<Self::DeviceSurface, Self::Error>where
Self: ImageDecodeSubmit<'a, DeviceSurface = Self::DeviceSurface>,
fn decode_scaled_to_device(
&mut self,
fmt: PixelFormat,
scale: Downscale,
backend: BackendRequest,
) -> Result<Self::DeviceSurface, Self::Error>where
Self: ImageDecodeSubmit<'a, DeviceSurface = Self::DeviceSurface>,
Decode the full image at reduced resolution to the requested backend.
Source§fn decode_region_scaled_to_device(
&mut self,
fmt: PixelFormat,
roi: Rect,
scale: Downscale,
backend: BackendRequest,
) -> Result<Self::DeviceSurface, Self::Error>where
Self: ImageDecodeSubmit<'a, DeviceSurface = Self::DeviceSurface>,
fn decode_region_scaled_to_device(
&mut self,
fmt: PixelFormat,
roi: Rect,
scale: Downscale,
backend: BackendRequest,
) -> Result<Self::DeviceSurface, Self::Error>where
Self: ImageDecodeSubmit<'a, DeviceSurface = Self::DeviceSurface>,
Decode a source-coordinate region at reduced resolution to the requested backend.
Source§impl<'a> ImageDecodeSubmit<'a> for Decoder<'a>
impl<'a> ImageDecodeSubmit<'a> for Decoder<'a>
Source§type Session = CudaSession
type Session = CudaSession
Mutable session state shared across submissions.
Source§type DeviceSurface = Surface
type DeviceSurface = Surface
Device surface returned by completed submissions.
Source§type SubmittedSurface = ReadySubmission<Surface, Error>
type SubmittedSurface = ReadySubmission<Surface, Error>
Submission handle type.
Source§fn 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.
Source§fn 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.
Source§fn 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.
Source§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>
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.
Source§fn submit_request_to_device(
&mut self,
session: &mut Self::Session,
fmt: PixelFormat,
backend: BackendRequest,
request: DecodeRequest,
) -> Result<Self::SubmittedSurface, Self::Error>
fn submit_request_to_device( &mut self, session: &mut Self::Session, fmt: PixelFormat, backend: BackendRequest, request: DecodeRequest, ) -> Result<Self::SubmittedSurface, Self::Error>
Submit a normalized full/ROI/scaled decode request to a device backend.
Auto Trait Implementations§
impl<'a> !Freeze for Decoder<'a>
impl<'a> RefUnwindSafe for Decoder<'a>
impl<'a> Send for Decoder<'a>
impl<'a> Sync for Decoder<'a>
impl<'a> Unpin for Decoder<'a>
impl<'a> UnsafeUnpin for Decoder<'a>
impl<'a> UnwindSafe for Decoder<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more