Struct WebPConfig

Source
#[repr(C)]
pub struct WebPConfig {
Show 29 fields pub lossless: c_int, pub quality: c_float, pub method: c_int, pub image_hint: WebPImageHint, pub target_size: c_int, pub target_PSNR: c_float, pub segments: c_int, pub sns_strength: c_int, pub filter_strength: c_int, pub filter_sharpness: c_int, pub filter_type: c_int, pub autofilter: c_int, pub alpha_compression: c_int, pub alpha_filtering: c_int, pub alpha_quality: c_int, pub pass: c_int, pub show_compressed: c_int, pub preprocessing: c_int, pub partitions: c_int, pub partition_limit: c_int, pub emulate_jpeg_size: c_int, pub thread_level: c_int, pub low_memory: c_int, pub near_lossless: c_int, pub exact: c_int, pub use_delta_palette: c_int, pub use_sharp_yuv: c_int, pub qmin: c_int, pub qmax: c_int,
}
Expand description

Compression parameters.

Fields§

§lossless: c_int

Lossless encoding (0=lossy(default), 1=lossless).

§quality: c_float

between 0 and 100. For lossy, 0 gives the smallest size and 100 the largest. For lossless, this parameter is the amount of effort put into the compression: 0 is the fastest but gives larger files compared to the slowest, but best, 100.

§method: c_int

quality/speed trade-off (0=fast, 6=slower-better)

§image_hint: WebPImageHint

Hint for image type (lossless only for now).

§target_size: c_int

if non-zero, set the desired target size in bytes. Takes precedence over the compression parameter.

§target_PSNR: c_float

if non-zero, specifies the minimal distortion to try to achieve. Takes precedence over target_size.

§segments: c_int

maximum number of segments to use, in [1..4]

§sns_strength: c_int

Spatial Noise Shaping. 0=off, 100=maximum.

§filter_strength: c_int

range: [0 = off .. 100 = strongest]

§filter_sharpness: c_int

range: [0 = off .. 7 = least sharp]

§filter_type: c_int

filtering type: 0 = simple, 1 = strong (only used if filter_strength > 0 or autofilter > 0)

§autofilter: c_int

Auto adjust filter’s strength [0 = off, 1 = on]

§alpha_compression: c_int

Algorithm for encoding the alpha plane (0 = none, 1 = compressed with WebP lossless). Default is 1.

§alpha_filtering: c_int

Predictive filtering method for alpha plane. 0: none, 1: fast, 2: best. Default if 1.

§alpha_quality: c_int

Between 0 (smallest size) and 100 (lossless). Default is 100.

§pass: c_int

number of entropy-analysis passes (in [1..10]).

§show_compressed: c_int

if true, export the compressed picture back. In-loop filtering is not applied.

§preprocessing: c_int

preprocessing filter: 0=none, 1=segment-smooth, 2=pseudo-random dithering

§partitions: c_int

log2(number of token partitions) in [0..3]. Default is set to 0 for easier progressive decoding.

§partition_limit: c_int

quality degradation allowed to fit the 512k limit on prediction modes coding (0: no degradation, 100: maximum possible degradation).

§emulate_jpeg_size: c_int

If true, compression parameters will be remapped to better match the expected output size from JPEG compression. Generally, the output size will be similar but the degradation will be lower.

§thread_level: c_int

If non-zero, try and use multi-threaded encoding.

§low_memory: c_int

If set, reduce memory usage (but increase CPU use).

§near_lossless: c_int
Available on crate feature 0_5 only.

Near lossless encoding [0 = max loss .. 100 = off (default)].

§exact: c_int
Available on crate feature 0_5 only.

if non-zero, preserve the exact RGB values under transparent area. Otherwise, discard this invisible RGB information for better compression. The default value is 0.

§use_delta_palette: c_int
Available on crate feature 0_6 only.

reserved

§use_sharp_yuv: c_int
Available on crate feature 0_6 only.

if needed, use sharp (and slow) RGB->YUV conversion

§qmin: c_int
Available on crate feature 1_2 only.

minimum permissible quality factor

§qmax: c_int
Available on crate feature 1_2 only.

maximum permissible quality factor

Trait Implementations§

Source§

impl Clone for WebPConfig

Source§

fn clone(&self) -> WebPConfig

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 WebPConfig

Source§

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

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

impl Copy for WebPConfig

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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,

Source§

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>,

Source§

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>,

Source§

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.