Struct lodepng::ffi::State[][src]

#[repr(C)]
pub struct State { pub decoder: DecoderSettings, pub encoder: EncoderSettings, pub info_raw: ColorMode, pub info_png: Info, pub error: Error, }

The settings, state and information for extended encoding and decoding

Fields

specifies the format in which you would like to get the raw pixel buffer

info of the PNG image obtained after decoding

Methods

impl State
[src]

whether to convert the PNG to the color type you want. Default: yes

if false but remember_unknown_chunks is true, they're stored in the unknown chunks.

store all bytes from unknown chunks in the Info (off by default, useful for a png editor)

Decompress ICC profile from iCCP chunk

Load PNG from buffer using State's settings


state.info_raw_mut().colortype = ColorType::RGBA;
match state.decode(&slice) {
    Ok(Image::RGBA(with_alpha)) => do_stuff(with_alpha),
    _ => panic!("¯\\_(ツ)_/¯")
}

Returns (width, height)

Trait Implementations

impl Clone for State
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Default for State
[src]

Returns the "default value" for a type. Read more

Auto Trait Implementations

impl !Send for State

impl !Sync for State