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: usizeThe 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: CompressedBlockThe 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) -> UnitResultWithout 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,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for Chunk
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for Chunk
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for Chunk
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> From<T> for Chunk
fn from(t: T) -> TReturns the argument unchanged.
impl<T> Pointable for Chunk
const ALIGN: usize = _;type Init = T;unsafe fn init(init: <T as Pointable>::Init) -> usizeunsafe fn deref<'a>(ptr: usize) -> &'a Tunsafe fn deref_mut<'a>(ptr: usize) -> &'a mut Tunsafe fn drop(ptr: usize)
impl<T> Read<Exclusive, BecauseExclusive> for Chunk
where
T: ?Sized,
impl<T> ToOwned for Chunk
where
T: Clone,
type Owned = T;fn to_owned(&self) -> Tfn clone_into(&self, target: &mut T)
impl<T, U> Into<U> for Chunk
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 Chunk
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for Chunk
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>