Struct UncompressedBlock

pub struct UncompressedBlock { pub index: BlockIndex, pub data: ByteVec }

Contains a block of pixel data and where that data should be placed in the actual image.

The bytes must be encoded in native-endian format. The conversion to little-endian format happens when converting to chunks (potentially in parallel).

Fields

index: BlockIndex

Location of the data inside the image.

data: ByteVec

Uncompressed pixel values of the whole block. One or more scan lines may be stored together as a scan line block. This byte vector contains all pixel rows, one after another. For each line in the tile, for each channel, the row values are contiguous. Stores all samples of the first channel, then all samples of the second channel, and so on. This data is in native-endian format.

Implementations

impl UncompressedBlock

fn decompress_chunk(chunk: Chunk, meta_data: &MetaData, pedantic: bool) -> Result<Self>

Decompress the possibly compressed chunk and returns an UncompressedBlock.

fn compress_to_chunk(self, headers: &[Header]) -> Result<Chunk>

Consume this block by compressing it, returning a Chunk.

fn lines(&self, channels: &ChannelList) -> impl Iterator<Item = LineRef<'_>>

Iterate all the lines in this block. Each line contains the all samples for one of the channels.

fn collect_block_data_from_lines(channels: &ChannelList, block_index: BlockIndex, extract_line: impl FnMut(LineRefMut<'_>)) -> Vec<u8>

Create an uncompressed block byte vector by requesting one line of samples after another.

fn from_lines(channels: &ChannelList, block_index: BlockIndex, extract_line: impl FnMut(LineRefMut<'_>)) -> Self

Create an uncompressed block by requesting one line of samples after another.

Trait Implementations

impl Clone for UncompressedBlock

fn clone(&self) -> Self

impl Debug for UncompressedBlock

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

impl Eq for UncompressedBlock

impl PartialEq for UncompressedBlock

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

impl StructuralPartialEq for UncompressedBlock

Auto Trait Implementations

impl Freeze for UncompressedBlock

impl RefUnwindSafe for UncompressedBlock

impl Send for UncompressedBlock

impl Sync for UncompressedBlock

impl Unpin for UncompressedBlock

impl UnsafeUnpin for UncompressedBlock

impl UnwindSafe for UncompressedBlock

Blanket Implementations

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

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

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

fn type_id(&self) -> TypeId

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

fn borrow(&self) -> &T

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

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

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

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

impl<T> From<T> for UncompressedBlock

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> Pointable for UncompressedBlock

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 UncompressedBlock where T: ?Sized,

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

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

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

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

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

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