Struct imagefmt::Image
[−]
[src]
pub struct Image { pub w: usize, pub h: usize, pub fmt: ColFmt, pub pixels: Vec<u8>, }
Image struct returned from the read functions.
Fields
w: usize
h: usize
fmt: ColFmt
pixels: Vec<u8>
Methods
impl Image
[src]
fn write<P>(&self, filepath: P, tgt_type: ColType) -> Result<()> where P: AsRef<Path>
Writes an image and converts it to requested color type.
fn convert(&self, tgt_fmt: ColFmt) -> Result<Image, &str>
Converts the image into a new allocation.