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: BlockIndexLocation of the data inside the image.
data: ByteVecUncompressed 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<'_>)) -> SelfCreate 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