Struct lodepng::ffi::State
[-]
[+]
[src]
pub struct State {
pub decoder: DecoderSettings,
pub encoder: EncoderSettings,
pub info_raw: ColorMode,
pub info_png: Info,
// some fields omitted
}The settings, state and information for extended encoding and decoding
Fields
decoder | |
encoder | |
info_raw | specifies the format in which you would like to get the raw pixel buffer |
info_png | info of the PNG image obtained after decoding |
Methods
impl State
fn new() -> State
fn decode(&mut self, input: &[u8]) -> Result<Image, Error>
Load PNG from buffer using State's settings
self.info_raw.colortype = LCT_RGBA; match try!(state.decode(slice)) { Image::RGBA(with_alpha) => do_stuff(with_alpha), _ => panic!("¯\\_(ツ)_/¯") }
fn inspect(&mut self, input: &[u8]) -> Result<(usize, usize), Error>
Returns (width, height)