pub trait ToDynamic {
// Required methods
fn decode_to_image(
&self,
data: &[u8]
) -> Result<Option<DynamicImage>, DecodeError>;
fn decode_to_image_with<T: PixelType>(
&self,
data: &[u8]
) -> Result<Option<DynamicImage>, DecodeError>;
}
Available on crate feature
image
only.Expand description
Extension trait for JxlDecoder
Required Methods§
sourcefn decode_to_image(
&self,
data: &[u8]
) -> Result<Option<DynamicImage>, DecodeError>
fn decode_to_image( &self, data: &[u8] ) -> Result<Option<DynamicImage>, DecodeError>
Decode the JPEG XL image to a DynamicImage
§Errors
Return a DecodeError
when internal decoding fails.
Return Ok(None)
when the image is not representable as a DynamicImage
sourcefn decode_to_image_with<T: PixelType>(
&self,
data: &[u8]
) -> Result<Option<DynamicImage>, DecodeError>
fn decode_to_image_with<T: PixelType>( &self, data: &[u8] ) -> Result<Option<DynamicImage>, DecodeError>
Decode the JPEG XL image to a DynamicImage
with a specific pixel type
§Errors
Return a DecodeError
when internal decoding fails.
Return Ok(None)
when the image is not representable as a DynamicImage
Object Safety§
This trait is not object safe.