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
decoder: DecoderSettings
encoder: EncoderSettings
info_raw: ColorMode
specifies the format in which you would like to get the raw pixel buffer
info_png: Info
info of the PNG image obtained after decoding
error: Error
Methods
impl State
[src]
fn new() -> Self
[src]
fn set_auto_convert(&mut self, mode: bool)
[src]
fn set_filter_strategy(
&mut self,
mode: FilterStrategy,
palette_filter_zero: bool
)
[src]
&mut self,
mode: FilterStrategy,
palette_filter_zero: bool
)
unsafe fn set_custom_zlib(
&mut self,
callback: custom_compress_callback,
context: *const c_void
)
[src]
&mut self,
callback: custom_compress_callback,
context: *const c_void
)
unsafe fn set_custom_deflate(
&mut self,
callback: custom_compress_callback,
context: *const c_void
)
[src]
&mut self,
callback: custom_compress_callback,
context: *const c_void
)
fn info_raw(&self) -> &ColorMode
[src]
fn info_raw_mut(&mut self) -> &mut ColorMode
[src]
fn info_png(&self) -> &Info
[src]
fn info_png_mut(&mut self) -> &mut Info
[src]
fn color_convert(&mut self, true_or_false: bool)
[src]
whether to convert the PNG to the color type you want. Default: yes
fn read_text_chunks(&mut self, true_or_false: bool)
[src]
if false but remember_unknown_chunks is true, they're stored in the unknown chunks.
fn remember_unknown_chunks(&mut self, true_or_false: bool)
[src]
store all bytes from unknown chunks in the Info
(off by default, useful for a png editor)
fn get_icc(&self) -> Result<Vec<u8>, Error>
[src]
Decompress ICC profile from iCCP chunk
fn decode<Bytes: AsRef<[u8]>>(&mut self, input: Bytes) -> Result<Image, Error>
[src]
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!("¯\\_(ツ)_/¯") }
fn decode_file<P: AsRef<Path>>(&mut self, filepath: P) -> Result<Image, Error>
[src]
fn inspect(&mut self, input: &[u8]) -> Result<(usize, usize), Error>
[src]
Returns (width, height)
fn encode<PixelType: Copy>(
&mut self,
image: &[PixelType],
w: usize,
h: usize
) -> Result<Vec<u8>, Error>
[src]
&mut self,
image: &[PixelType],
w: usize,
h: usize
) -> Result<Vec<u8>, Error>
fn encode_file<PixelType: Copy, P: AsRef<Path>>(
&mut self,
filepath: P,
image: &[PixelType],
w: usize,
h: usize
) -> Result<(), Error>
[src]
&mut self,
filepath: P,
image: &[PixelType],
w: usize,
h: usize
) -> Result<(), Error>
Trait Implementations
impl Clone for State
[src]
fn clone(&self) -> State
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more