Struct lodepng::Decoder [−][src]
Read an image with custom settings
Implementations
impl Decoder
[src]
pub fn new() -> Self
[src]
pub fn info_raw(&self) -> &ColorMode
[src]
pub fn info_raw_mut(&mut self) -> &mut ColorMode
[src]
Preferred color mode for decoding
pub fn info_png(&self) -> &Info
[src]
Actual color mode of the decoded image or inspected file
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 Decoder'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>
Decode a file from disk using Decoder's settings
pub fn inspect(&mut self, input: &[u8]) -> Result<(usize, usize), Error>
[src]
Updates info_png
. Returns (width, height)
pub fn set_custom_zlib(
&mut self,
callback: custom_decompress_callback,
context: *const c_void
)
[src]
&mut self,
callback: custom_decompress_callback,
context: *const c_void
)
use custom zlib decoder instead of built in one
pub fn set_custom_inflate(
&mut self,
callback: custom_decompress_callback,
context: *const c_void
)
[src]
&mut self,
callback: custom_decompress_callback,
context: *const c_void
)
use custom deflate decoder instead of built in one.
If custom_zlib is used, custom_inflate is ignored since only the built in zlib function will call custom_inflate
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Decoder
[src]
impl !Send for Decoder
[src]
impl !Sync for Decoder
[src]
impl Unpin for Decoder
[src]
impl UnwindSafe for Decoder
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
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.
pub fn to_owned(&self) -> T
[src]
pub 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.
pub 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>,