Struct Encoding

pub struct Encoding { pub compression: Compression, pub blocks: Blocks, pub line_order: LineOrder }

How the pixels are split up and compressed.

Fields

compression: Compression

How the pixel data of all channels in this layer is compressed. May be Compression::Uncompressed. See layer.attributes for more attributes.

blocks: Blocks

Describes how the pixels of this layer are divided into smaller blocks. Either splits the image into its scan lines or splits the image into tiles of the specified size. A single block can be loaded without processing all bytes of a file.

line_order: LineOrder

In what order the tiles of this header occur in the file. Does not change any actual image orientation. See layer.attributes for more attributes.

Implementations

impl Encoding

const FAST_LOSSLESS: Self = _;

Run-length encoding with tiles of 64x64 pixels. This is the recommended default encoding. Almost as fast as uncompressed data, but optimizes single-colored areas such as mattes and masks.

const SMALL_FAST_LOSSLESS: Self = _;

PIZ compression with tiles of 256x256 pixels. Small images, not too slow.

const SMALL_LOSSLESS: Self = _;

ZIP compression with blocks of 16 lines. Slow, but produces small files without visible artefacts.

const UNCOMPRESSED: Self = _;

No compression. Massive space requirements. Fast, because it minimizes data shuffling and reallocation.

Trait Implementations

impl Clone for Encoding

fn clone(&self) -> Self

impl Copy for Encoding

impl Debug for Encoding

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

impl Default for Encoding

fn default() -> Self

impl PartialEq for Encoding

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

impl StructuralPartialEq for Encoding

Auto Trait Implementations

impl Freeze for Encoding

impl RefUnwindSafe for Encoding

impl Send for Encoding

impl Sync for Encoding

impl Unpin for Encoding

impl UnsafeUnpin for Encoding

impl UnwindSafe for Encoding

Blanket Implementations

impl<R, P> ReadPrimitive<R> for Encoding where R: Read + ReadEndian<P>, P: Default,

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for Encoding where ST: ?Sized, DT: ?Sized,

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for Encoding where ST: ?Sized, DT: ?Sized,

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

fn type_id(&self) -> TypeId

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

fn borrow(&self) -> &T

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

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

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

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

impl<T> From<T> for Encoding

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> Pointable for Encoding

const ALIGN: usize = _;
type Init = T;
unsafe fn init(init: <T as Pointable>::Init) -> usize
unsafe fn deref<'a>(ptr: usize) -> &'a T
unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
unsafe fn drop(ptr: usize)

impl<T> Read<Exclusive, BecauseExclusive> for Encoding where T: ?Sized,

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

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

impl<T, U> Into<U> for Encoding 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 Encoding where U: Into<T>,

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

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

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