Enum png::FilterType
source · #[repr(u8)]pub enum FilterType {
NoFilter = 0,
Sub = 1,
Up = 2,
Avg = 3,
Paeth = 4,
}
Expand description
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.
Variants§
Implementations§
source§impl FilterType
impl FilterType
sourcepub fn from_u8(n: u8) -> Option<FilterType>
pub fn from_u8(n: u8) -> Option<FilterType>
u8 -> Self. Temporary solution until Rust provides a canonical one.
Trait Implementations§
source§impl Clone for FilterType
impl Clone for FilterType
source§fn clone(&self) -> FilterType
fn clone(&self) -> FilterType
Returns a copy 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 FilterType
impl Debug for FilterType
source§impl Default for FilterType
impl Default for FilterType
source§impl PartialEq for FilterType
impl PartialEq for FilterType
source§fn eq(&self, other: &FilterType) -> bool
fn eq(&self, other: &FilterType) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for FilterType
impl Eq for FilterType
impl StructuralPartialEq for FilterType
Auto Trait Implementations§
impl Freeze for FilterType
impl RefUnwindSafe for FilterType
impl Send for FilterType
impl Sync for FilterType
impl Unpin for FilterType
impl UnwindSafe for FilterType
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