pub trait ImageDecoderRect: ImageDecoder {
    // Required method
    fn read_rect(
        &mut self,
        x: u32,
        y: u32,
        width: u32,
        height: u32,
        buf: &mut [u8],
        row_pitch: usize
    ) -> ImageResult<()>;
}
Expand description

Specialized image decoding not be supported by all formats

Required Methods§

source

fn read_rect( &mut self, x: u32, y: u32, width: u32, height: u32, buf: &mut [u8], row_pitch: usize ) -> ImageResult<()>

Decode a rectangular section of the image.

This function takes a slice of bytes and writes the pixel data of the image into it. The rectangle is specified by the x and y coordinates of the top left corner, the width and height of the rectangle, and the row pitch of the buffer. The row pitch is the number of bytes between the start of one row and the start of the next row. The row pitch must be at least as large as the width of the rectangle in bytes.

Implementors§

source§

impl<R: BufRead + Seek> ImageDecoderRect for BmpDecoder<R>

Available on crate feature bmp only.
source§

impl<R: Read + Seek> ImageDecoderRect for FarbfeldDecoder<R>

Available on crate feature ff only.