Trait exr::block::reader::ChunksReader[][src]

pub trait ChunksReader: Sized + Iterator<Item = Result<Chunk>> + ExactSizeIterator {
    fn meta_data(&self) -> &MetaData;
fn expected_chunk_count(&self) -> usize; fn headers(&self) -> &[Header]

Notable traits for &'_ mut [u8]

impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
{ ... }
fn read_next_chunk(&mut self) -> Option<Result<Chunk>> { ... }
fn on_progress<F>(self, on_progress: F) -> OnProgressChunksReader<Self, F>

Notable traits for OnProgressChunksReader<R, F>

impl<R, F> Iterator for OnProgressChunksReader<R, F> where
    R: ChunksReader,
    F: FnMut(f64), 
type Item = Result<Chunk>;

    where
        F: FnMut(f64)
, { ... }
fn decompress_parallel(
        self,
        pedantic: bool,
        insert_block: impl FnMut(&MetaData, UncompressedBlock) -> UnitResult
    ) -> UnitResult { ... }
fn parallel_decompressor(
        self,
        pedantic: bool
    ) -> Result<ParallelBlockDecompressor<Self>, Self> { ... }
fn decompress_sequential(
        self,
        pedantic: bool,
        insert_block: impl FnMut(&MetaData, UncompressedBlock) -> UnitResult
    ) -> UnitResult { ... }
fn sequential_decompressor(
        self,
        pedantic: bool
    ) -> SequentialBlockDecompressor<Self> { ... } }
Expand description

Decode chunks in the file. The decoded chunks can be decompressed by calling decompress_parallel, decompress_sequential, or sequential_decompressor. Call on_progress to have a callback with each block. Also contains the image meta data.

Required methods

fn meta_data(&self) -> &MetaData[src]

The decoded exr meta data from the file.

fn expected_chunk_count(&self) -> usize[src]

The number of chunks that this reader will return in total. Can be less than the total number of chunks in the file, if some chunks are skipped.

Provided methods

fn headers(&self) -> &[Header]

Notable traits for &'_ mut [u8]

impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
[src]

The decoded exr headers from the file.

fn read_next_chunk(&mut self) -> Option<Result<Chunk>>[src]

Read the next compressed chunk from the file. Equivalent to .next(), as this also is an iterator. Returns None if all chunks have been read.

fn on_progress<F>(self, on_progress: F) -> OnProgressChunksReader<Self, F>

Notable traits for OnProgressChunksReader<R, F>

impl<R, F> Iterator for OnProgressChunksReader<R, F> where
    R: ChunksReader,
    F: FnMut(f64), 
type Item = Result<Chunk>;
where
    F: FnMut(f64), 
[src]

Create a new reader that calls the provided progress callback for each chunk that is read from the file. If the file can be successfully decoded, the progress will always at least once include 0.0 at the start and 1.0 at the end.

fn decompress_parallel(
    self,
    pedantic: bool,
    insert_block: impl FnMut(&MetaData, UncompressedBlock) -> UnitResult
) -> UnitResult
[src]

Decompress all blocks in the file, using multiple cpu cores, and call the supplied closure for each block. The order of the blocks is not deterministic. You can also use parallel_decompressor to obtain an iterator instead.

fn parallel_decompressor(
    self,
    pedantic: bool
) -> Result<ParallelBlockDecompressor<Self>, Self>
[src]

Return an iterator that decompresses the chunks with multiple threads. The order of the blocks is not deterministic. Use ParallelBlockDecompressor::new if you want to use your own thread pool. By default, this uses as many threads as there are CPUs. Returns the self if there is no need for parallel decompression.

fn decompress_sequential(
    self,
    pedantic: bool,
    insert_block: impl FnMut(&MetaData, UncompressedBlock) -> UnitResult
) -> UnitResult
[src]

Return an iterator that decompresses the chunks in this thread. You can alternatively use sequential_decompressor if you prefer an external iterator.

fn sequential_decompressor(
    self,
    pedantic: bool
) -> SequentialBlockDecompressor<Self>
[src]

Prepare reading the chunks sequentially, only a single thread, but with less memory overhead.

Implementors