pub struct EncoderConfig {
pub compression_level: u32,
pub filter_strategy: FilterStrategy,
pub interlace: bool,
pub gamma: Option<f64>,
pub optimize_palette: bool,
}Expand description
PNG encoder configuration.
Fields§
§compression_level: u32Compression level (0-9).
filter_strategy: FilterStrategyFilter strategy.
interlace: boolEnable Adam7 interlacing.
gamma: Option<f64>Gamma value (optional).
optimize_palette: boolOptimize palette for indexed images.
Implementations§
Source§impl EncoderConfig
impl EncoderConfig
Sourcepub const fn with_compression(self, level: u32) -> Self
pub const fn with_compression(self, level: u32) -> Self
Set compression level (0-9).
Sourcepub const fn with_filter_strategy(self, strategy: FilterStrategy) -> Self
pub const fn with_filter_strategy(self, strategy: FilterStrategy) -> Self
Set filter strategy.
Sourcepub const fn with_interlace(self, interlace: bool) -> Self
pub const fn with_interlace(self, interlace: bool) -> Self
Enable interlacing.
Sourcepub const fn with_gamma(self, gamma: f64) -> Self
pub const fn with_gamma(self, gamma: f64) -> Self
Set gamma value.
Sourcepub const fn with_palette_optimization(self, optimize: bool) -> Self
pub const fn with_palette_optimization(self, optimize: bool) -> Self
Enable palette optimization.
Trait Implementations§
Source§impl Clone for EncoderConfig
impl Clone for EncoderConfig
Source§fn clone(&self) -> EncoderConfig
fn clone(&self) -> EncoderConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EncoderConfig
impl Debug for EncoderConfig
Auto Trait Implementations§
impl Freeze for EncoderConfig
impl RefUnwindSafe for EncoderConfig
impl Send for EncoderConfig
impl Sync for EncoderConfig
impl Unpin for EncoderConfig
impl UnsafeUnpin for EncoderConfig
impl UnwindSafe for EncoderConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more