Struct webp_animation::prelude::LossyEncodingConfig
source · [−]pub struct LossyEncodingConfig {Show 17 fields
pub target_size: usize,
pub target_psnr: f32,
pub segments: usize,
pub sns_strength: usize,
pub filter_strength: usize,
pub filter_sharpness: usize,
pub filter_type: usize,
pub autofilter: bool,
pub alpha_compression: bool,
pub alpha_filtering: usize,
pub alpha_quality: usize,
pub pass: usize,
pub show_compressed: bool,
pub preprocessing: bool,
pub partitions: usize,
pub partition_limit: isize,
pub use_sharp_yuv: bool,
}Expand description
Parameters related to lossy compression only
Fields
target_size: usizeif non-zero, set the desired target size in bytes. Takes precedence over the ‘compression’ parameter.
target_psnr: f32if non-zero, specifies the minimal distortion to try to achieve. Takes precedence over target_size.
segments: usizemaximum number of segments to use, in [1..4]
sns_strength: usizeSpatial Noise Shaping. 0=off, 100=maximum.
filter_strength: usizerange: [0 = off .. 100 = strongest]
filter_sharpness: usizerange: [0 = off .. 7 = least sharp]
filter_type: usizefiltering type: 0 = simple, 1 = strong (only used if filter_strength > 0 or autofilter > 0)
autofilter: boolAuto adjust filter’s strength [false = off, true = on]
alpha_compression: boolAlgorithm for encoding the alpha plane (false = none, true = compressed with WebP lossless). Default is true.
alpha_filtering: usizePredictive filtering method for alpha plane. 0: none, 1: fast, 2: best. Default if 1.
alpha_quality: usizeBetween 0 (smallest size) and 100 (lossless). Default is 100.
pass: usizenumber of entropy-analysis passes (in [1..10]).
show_compressed: boolif true, export the compressed picture back. In-loop filtering is not applied.
preprocessing: boolpreprocessing filter (0=none, 1=segment-smooth)
partitions: usizelog2(number of token partitions) in [0..3] Default is set to 0 for easier progressive decoding.
partition_limit: isizequality degradation allowed to fit the 512k limit on prediction modes coding (0: no degradation, 100: maximum possible degradation).
use_sharp_yuv: boolif needed, use sharp (and slow) RGB->YUV conversion
Implementations
sourceimpl LossyEncodingConfig
impl LossyEncodingConfig
pub fn new_from_default_preset() -> Self
pub fn new_from_picture_preset() -> Self
pub fn new_from_photo_preset() -> Self
pub fn new_from_drawing_preset() -> Self
pub fn new_from_icon_preset() -> Self
pub fn new_from_text_preset() -> Self
Trait Implementations
sourceimpl Clone for LossyEncodingConfig
impl Clone for LossyEncodingConfig
sourcefn clone(&self) -> LossyEncodingConfig
fn clone(&self) -> LossyEncodingConfig
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for LossyEncodingConfig
impl Debug for LossyEncodingConfig
Auto Trait Implementations
impl RefUnwindSafe for LossyEncodingConfig
impl Send for LossyEncodingConfig
impl Sync for LossyEncodingConfig
impl Unpin for LossyEncodingConfig
impl UnwindSafe for LossyEncodingConfig
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more