pub struct PngDecoder<S>where
S: Source,{ /* private fields */ }Expand description
Decodes a PNG stream.
Implementations§
Source§impl<S> PngDecoder<S>where
S: Source,
impl<S> PngDecoder<S>where
S: Source,
Sourcepub fn new(source: S, limits: Limits) -> Result<PngDecoder<S>, PixelsError>
pub fn new(source: S, limits: Limits) -> Result<PngDecoder<S>, PixelsError>
Parse the signature, IHDR and every chunk before the image data.
§Errors
Returns PixelsError::Malformed for a bad signature, header or
pre-IDAT chunk, or PixelsError::LimitExceeded if the dimensions
exceed limits.
Trait Implementations§
Source§impl<S> Debug for PngDecoder<S>
impl<S> Debug for PngDecoder<S>
Source§impl<S> Decoder for PngDecoder<S>
impl<S> Decoder for PngDecoder<S>
Source§fn orientation(&self) -> Orientation
fn orientation(&self) -> Orientation
From an eXIf chunk before the image data. One after it is not
seen: by then the pipeline has been built, and §5.6 puts eXIf first.
Source§fn icc_profile(&self) -> Option<&[u8]>
fn icc_profile(&self) -> Option<&[u8]>
From an iCCP chunk before the image data.
Source§fn descriptor(&self) -> ImageDescriptor
fn descriptor(&self) -> ImageDescriptor
The shape of the image, known after the header is parsed.
Source§fn capability(&self) -> DecodeCapability
fn capability(&self) -> DecodeCapability
What this decoder can produce without a full decode.
Source§fn read_row(&mut self, out: &mut [u8]) -> Result<(), PixelsError>
fn read_row(&mut self, out: &mut [u8]) -> Result<(), PixelsError>
Decode the next row, top to bottom, into
out. Read moreSource§fn animation(&self) -> Option<Animation>
fn animation(&self) -> Option<Animation>
The source’s animation, if it has more than one frame. Read more
Source§fn read_region(
&mut self,
region: Region,
out: &mut TileMut<'_>,
) -> Result<(), PixelsError>
fn read_region( &mut self, region: Region, out: &mut TileMut<'_>, ) -> Result<(), PixelsError>
Decode an arbitrary region into
out. Read moreSource§fn reduced_descriptor(&self, target: (u32, u32)) -> Option<ImageDescriptor>
fn reduced_descriptor(&self, target: (u32, u32)) -> Option<ImageDescriptor>
What this decoder would produce if asked for
target or larger, when
the format lets it reach that size more cheaply than a full decode. Read moreSource§fn reduce_to(&mut self, descriptor: ImageDescriptor) -> Result<(), PixelsError>
fn reduce_to(&mut self, descriptor: ImageDescriptor) -> Result<(), PixelsError>
Auto Trait Implementations§
impl<S> Freeze for PngDecoder<S>
impl<S> RefUnwindSafe for PngDecoder<S>
impl<S> Send for PngDecoder<S>
impl<S> Sync for PngDecoder<S>
impl<S> Unpin for PngDecoder<S>
impl<S> UnsafeUnpin for PngDecoder<S>
impl<S> UnwindSafe for PngDecoder<S>
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