[][src]Trait embedded_graphics::image::ImageFile

pub trait ImageFile<'a>: Dimensions + Sized {
    fn new(filedata: &'a [u8]) -> Result<Self, ()>;
fn width(&self) -> u32;
fn height(&self) -> u32; }

Image trait

Required methods

fn new(filedata: &'a [u8]) -> Result<Self, ()>

Create a new image with given input file

The input file is expected to be of a particular format (BMP, TGA, etc) and contain file metadata like width/height and pixel data. Because parsing may fail, this returns a Result<Self, ()>.

fn width(&self) -> u32

Get the width in pixels of an image

fn height(&self) -> u32

Get the height in pixels of an image

Loading content...


impl<'a, C> ImageFile<'a> for ImageBmp<'a, C> where
    C: PixelColor

fn new(image_data: &'a [u8]) -> Result<Self, ()>[src]

Create a new BMP from a byte slice

Loading content...