pub trait DecodePng: 'static {
// Required method
fn decode_png<'alloc>(
&mut self,
alloc: &'alloc Allocator<'_>,
data: &[u8],
) -> Option<DecodedImage<'alloc>>;
}Available on crate feature
kitty-graphics only.Expand description
A PNG decoder that can be used by the Kitty graphics protocol to decode PNG images into 8-bit RGBA pixels.
See set_png_decoder for more details.
Required Methods§
Sourcefn decode_png<'alloc>(
&mut self,
alloc: &'alloc Allocator<'_>,
data: &[u8],
) -> Option<DecodedImage<'alloc>>
fn decode_png<'alloc>( &mut self, alloc: &'alloc Allocator<'_>, data: &[u8], ) -> Option<DecodedImage<'alloc>>
Decode a PNG into 8-bit RGBA pixels.
The returned image’s byte buffer must be allocated by the provided allocator.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl DecodePng for RustPngDecoder
Available on crate feature
png only.