Enum PngCompression
pub enum PngCompression
The type and strength of applied compression.
This is a simple, high-level interface that will automatically choose the appropriate DEFLATE compression mode and PNG filter.
If you need more control over the encoding parameters, you can set the [DeflateCompression] and [Filter] manually.
Variants
-
NoCompression No compression whatsoever. Fastest, but results in large files.
-
Fastest Extremely fast but light compression.
Note: When used in streaming mode, this compression level can actually result in files larger than would be produced by
NoCompressionon incompressible data because it doesn't do any buffering of the output stream to detect whether the data is being compressed or not.-
Fast Extremely fast compression with a decent compression ratio.
Significantly outperforms libpng and other popular encoders by using a specialized DEFLATE implementation tuned for PNG, while still providing better compression ratio than the fastest modes of other encoders.
Like
Compression::Fastthis can currently produce files larger thanNoCompressionin streaming mode when given incompressible data. This may change in the future.-
Balanced Balances encoding speed and compression ratio
-
High Spend much more time to produce a slightly smaller file than with
Balanced.
Trait Implementations
impl Clone for PngCompression
fn clone(&self) -> PngCompression
impl Copy for PngCompression
impl Debug for PngCompression
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Default for PngCompression
fn default() -> PngCompression
Auto Trait Implementations
impl Freeze for PngCompression
impl RefUnwindSafe for PngCompression
impl Send for PngCompression
impl Sync for PngCompression
impl Unpin for PngCompression
impl UnsafeUnpin for PngCompression
impl UnwindSafe for PngCompression
Blanket Implementations
impl<T> Any for PngCompression
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for PngCompression
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for PngCompression
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for PngCompression
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> From<T> for PngCompression
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for PngCompression
where
T: Clone,
type Owned = T;fn to_owned(&self) -> Tfn clone_into(&self, target: &mut T)
impl<T, U> Into<U> for PngCompression
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for PngCompression
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for PngCompression
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>