[−][src]Struct lodepng::Encoder
Make an image with custom settings
Implementations
impl Encoder
[src]
pub fn new() -> Self
[src]
pub fn set_auto_convert(&mut self, mode: bool)
[src]
If true, convert to output format
pub fn set_filter_strategy(
&mut self,
mode: FilterStrategy,
palette_filter_zero: bool
)
[src]
&mut self,
mode: FilterStrategy,
palette_filter_zero: bool
)
palette_filter_zero controls filtering for low-bitdepth images
pub fn set_text_compression(&mut self, compr: bool)
[src]
gzip text metadata
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
)
Compress using another zlib implementation. It's gzip header + deflate + adler32 checksum.
The callback returns 0 on success.
The callback MUST allocate memory using libc::malloc
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
)
Compress using another deflate implementation. It's just deflate, without headers or checksum.
The callback returns 0 on success.
The callback MUST allocate memory using libc::malloc
pub fn info_raw(&self) -> &ColorMode
[src]
pub fn info_raw_mut(&mut self) -> &mut ColorMode
[src]
Color mode of the source bytes to be encoded
pub fn info_png(&self) -> &Info
[src]
pub fn info_png_mut(&mut self) -> &mut Info
[src]
Color mode of the file to be created
pub fn encode<PixelType: Pod>(
&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>
Takes any pixel type, but for safety the type has to be marked as "plain old data"
pub fn encode_file<PixelType: Pod, 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>
Takes any pixel type, but for safety the type has to be marked as "plain old data"
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Encoder
impl !Send for Encoder
impl !Sync for Encoder
impl Unpin for Encoder
impl UnwindSafe for Encoder
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,
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.
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>,