[][src]Trait rin::graphics::image::ImageDecoder

pub trait ImageDecoder {
    type Reader: Read;
    fn dimensions(&self) -> (u64, u64);
fn colortype(&self) -> ColorType;
fn into_reader(self) -> Result<Self::Reader, ImageError>; fn row_bytes(&self) -> u64 { ... }
fn total_bytes(&self) -> u64 { ... }
fn scanline_bytes(&self) -> u64 { ... }
fn read_image(self) -> Result<Vec<u8>, ImageError> { ... }
fn read_image_with_progress<F>(
        self,
        progress_callback: F
    ) -> Result<Vec<u8>, ImageError>
    where
        F: Fn(Progress)
, { ... } }

The trait that all decoders implement

Associated Types

The type of reader produced by into_reader.

Required Methods

Returns a tuple containing the width and height of the image

Returns the color type of the image e.g. RGB(8) (8bit RGB)

Returns a reader that can be used to obtain the bytes of the image. For the best performance, always try to read at least scanline_bytes from the reader at a time. Reading fewer bytes will cause the reader to perform internal buffering.

Provided Methods

Returns the number of bytes in a single row of the image. All decoders will pad image rows to a byte boundary.

Returns the total number of bytes in the image.

Returns the minimum number of bytes that can be efficiently read from this decoder. This may be as few as 1 or as many as total_bytes().

Returns all the bytes in the image.

Same as read_image but periodically calls the provided callback to give updates on loading progress.

Implementors

impl<R> ImageDecoder for BMPDecoder<R> where
    R: Read + Seek
[src]

impl<R> ImageDecoder for DXTDecoder<R> where
    R: Read
[src]

impl<R> ImageDecoder for Decoder<R> where
    R: Read
[src]

impl<R> ImageDecoder for ICODecoder<R> where
    R: Read + Seek
[src]

impl<R> ImageDecoder for JPEGDecoder<R> where
    R: Read
[src]

impl<R> ImageDecoder for PNGDecoder<R> where
    R: Read
[src]

impl<R> ImageDecoder for PNMDecoder<R> where
    R: Read
[src]

impl<R> ImageDecoder for TGADecoder<R> where
    R: Read + Seek
[src]

impl<R> ImageDecoder for TIFFDecoder<R> where
    R: Read + Seek
[src]

impl<R> ImageDecoder for WebpDecoder<R> where
    R: Read
[src]