#[repr(C)]
pub struct EncoderSettings { pub zlibsettings: CompressSettings, pub auto_convert: bool, pub filter_palette_zero: bool, pub filter_strategy: FilterStrategy, pub force_palette: bool, pub add_id: bool, pub text_compression: bool, /* private fields */ }

Fields§

§zlibsettings: CompressSettings

settings for the zlib encoder, such as window size, …

§auto_convert: bool

how to automatically choose output PNG color type, if at all

§filter_palette_zero: bool

If true, follows the official PNG heuristic: if the PNG uses a palette or lower than 8 bit depth, set all filters to zero. Otherwise use the filter_strategy. Note that to completely follow the official PNG heuristic, filter_palette_zero must be true and filter_strategy must be FilterStrategy::MINSUM

§filter_strategy: FilterStrategy

Which filter strategy to use when not using zeroes due to filter_palette_zero. Set filter_palette_zero to 0 to ensure always using your chosen strategy. Default: FilterStrategy::MINSUM

§force_palette: bool

force creating a PLTE chunk if colortype is 2 or 6 (= a suggested palette). If colortype is 3, PLTE is always created

§add_id: bool

add LodePNG identifier and version as a text chunk, for debugging

§text_compression: bool

encode text chunks as zTXt chunks instead of tEXt chunks, and use compression in iTXt chunks

Implementations§

source§

impl EncoderSettings

source

pub fn new() -> Self

source

pub fn set_level(&mut self, level: u8)

Zlib compression level 0=none, 9=best

Trait Implementations§

source§

impl Clone for EncoderSettings

source§

fn clone(&self) -> EncoderSettings

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for EncoderSettings

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for EncoderSettings

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Send for EncoderSettings

source§

impl Sync for EncoderSettings

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.