Struct farbfeld::Decoder
[−]
[src]
pub struct Decoder<R> { /* fields omitted */ }
A farbfeld decoder
Methods
impl<R: Read + Seek> Decoder<R>
[src]
fn new(r: R) -> Result<Decoder<R>>
Create a new decoder from r
and parse the header.
Failures
Returns Error::FormatError if the magic number does not match farbfeld
fn dimensions(&self) -> (u32, u32)
Returns the (width, height)
of the image.
fn row_len(&self) -> usize
Returns the length in bytes for a row.
fn read_row(&mut self, row: u32, buf: &mut [u8]) -> Result<usize>
Read a single row from the image and return the bytes read.
Failures
Returns a Error::ImageEnd
if the row
is greater as the height
fn read_image(&mut self) -> Result<Vec<u8>>
Read whole image into a Vec<u8>
.