Struct Chunk

pub struct Chunk { pub layer_index: usize, pub compressed_block: CompressedBlock }

A generic block of pixel information.

Contains pixel data and an index to the corresponding header. All pixel data in a file is split into a list of chunks. Also contains positioning information that locates this data block in the referenced layer. The byte data is in little-endian format, as these bytes will be written into the file directly.

Fields

layer_index: usize

The index of the layer that the block belongs to. This is required as the pixel data can appear in any order in a file.

compressed_block: CompressedBlock

The compressed pixel contents. This data is compressed and in little-endian format.

Implementations

impl Chunk

fn write(&self, write: &mut impl Write, header_count: usize) -> UnitResult

Without validation, write this instance to the byte stream.

fn read(read: &mut impl Read, meta_data: &MetaData) -> Result<Self>

Read the value without validating.

Trait Implementations

impl Clone for Chunk

fn clone(&self) -> Self

impl Debug for Chunk

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

Auto Trait Implementations

impl Freeze for Chunk

impl RefUnwindSafe for Chunk

impl Send for Chunk

impl Sync for Chunk

impl Unpin for Chunk

impl UnsafeUnpin for Chunk

impl UnwindSafe for Chunk

Blanket Implementations

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

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

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

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

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

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

impl<T> From<T> for Chunk

impl<T> Pointable for Chunk

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

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

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

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

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