[−][src]Struct lodepng::ffi::State
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]
pub fn new() -> Self
[src]
pub fn set_auto_convert(&mut self, mode: bool)
[src]
pub fn set_filter_strategy(
&mut self,
mode: FilterStrategy,
palette_filter_zero: bool
)
[src]
&mut self,
mode: FilterStrategy,
palette_filter_zero: bool
)
pub 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
)
See `Encoder'
pub 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
)
See `Encoder'
pub fn info_raw(&self) -> &ColorMode
[src]
pub fn info_raw_mut(&mut self) -> &mut ColorMode
[src]
pub fn info_png(&self) -> &Info
[src]
pub fn info_png_mut(&mut self) -> &mut Info
[src]
pub fn color_convert(&mut self, true_or_false: bool)
[src]
whether to convert the PNG to the color type you want. Default: yes
pub 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.
pub 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)
pub fn get_icc(&self) -> Result<Vec<u8>, Error>
[src]
Decompress ICC profile from iCCP chunk
pub fn decode<Bytes: AsRef<[u8]>>(
&mut self,
input: Bytes
) -> Result<Image, Error>
[src]
&mut self,
input: Bytes
) -> Result<Image, Error>
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!("¯\\_(ツ)_/¯") }
pub fn decode_file<P: AsRef<Path>>(
&mut self,
filepath: P
) -> Result<Image, Error>
[src]
&mut self,
filepath: P
) -> Result<Image, Error>
pub fn inspect(&mut self, input: &[u8]) -> Result<(usize, usize), Error>
[src]
Updates info_png
. Returns (width, height)
pub fn encode<PixelType: Copy + 'static>(
&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>
pub fn encode_file<PixelType: Copy + 'static, 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 Default for State
[src]
impl Clone for State
[src]
fn clone(&self) -> State
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for State
[src]
Auto Trait Implementations
impl !Send for State
impl Unpin for State
impl !Sync for State
impl UnwindSafe for State
impl RefUnwindSafe for State
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,