Enum Filter

#[non_exhaustive]
pub enum Filter

The byte level filter applied to scanlines to prepare them for compression.

Compression in general benefits from repetitive data. The filter is a content-aware method of compressing the range of occurring byte values to help the compression algorithm. Note that this does not operate on pixels but on raw bytes of a scanline.

Details on how each filter works can be found in the PNG Book.

The default filter is Adaptive, which uses heuristics to select the best filter for every row.

Variants

NoFilter
Sub
Up
Avg
Paeth
Adaptive
MinEntropy

Trait Implementations

impl Clone for Filter

fn clone(&self) -> Self

impl Copy for Filter

impl Debug for Filter

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

impl Default for Filter

fn default() -> Self

impl Eq for Filter

impl PartialEq for Filter

fn eq(&self, other: &Self) -> bool

impl StructuralPartialEq for Filter

Auto Trait Implementations

impl Freeze for Filter

impl RefUnwindSafe for Filter

impl Send for Filter

impl Sync for Filter

impl Unpin for Filter

impl UnsafeUnpin for Filter

impl UnwindSafe for Filter

Blanket Implementations

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

fn type_id(&self) -> TypeId

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

fn borrow(&self) -> &T

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

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

impl<T> CloneToUninit for Filter where T: Clone,

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

impl<T> From<T> for Filter

fn from(t: T) -> T

Returns the argument unchanged.

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

type Owned = T;
fn to_owned(&self) -> T
fn clone_into(&self, target: &mut T)

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

fn into(self) -> U

Calls U::from(self).

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

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

type Error = never;
fn try_from(value: U) -> Result<T, never>

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

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