Struct exr::block::writer::ChunkWriter[][src]

#[must_use]
pub struct ChunkWriter<W> { /* fields omitted */ }
Expand description

Can consume compressed pixel chunks, writing them a file. Use sequential_blocks_compressor or parallel_blocks_compressor to compress your data, or use compress_all_blocks_sequential or compress_all_blocks_parallel. Use on_progress to obtain a new writer that triggers a callback for each block.

Trait Implementations

impl<W> ChunksWriter for ChunkWriter<W> where
    W: Write + Seek
[src]

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

The total number of chunks that the complete file will contain.

fn write_chunk(
    &mut self,
    index_in_header_increasing_y: usize,
    chunk: Chunk
) -> UnitResult
[src]

Any more calls will result in an error and have no effect. If writing results in an error, the file and the writer may remain in an invalid state and should not be used further. Errors when the chunk at this index was already written.

fn on_progress<F>(
    &mut self,
    on_progress: F
) -> OnProgressChunkWriter<'_, Self, F> where
    F: FnMut(f64), 
[src]

Obtain a new writer that calls the specified closure for each block that is written to this writer.

fn sequential_blocks_compressor<'w>(
    &'w mut self,
    meta: &'w MetaData
) -> SequentialBlocksCompressor<'w, Self>
[src]

Obtain a new writer that can compress blocks to chunks, which are then passed to this writer.

fn parallel_blocks_compressor<'w>(
    &'w mut self,
    meta: &'w MetaData
) -> Option<ParallelBlocksCompressor<'w, Self>>
[src]

Obtain a new writer that can compress blocks to chunks on multiple threads, which are then passed to this writer. Returns none if the sequential compressor should be used instead (thread pool creation failure or too large performance overhead). Read more

fn compress_all_blocks_sequential(
    self,
    meta: &MetaData,
    blocks: impl Iterator<Item = (usize, UncompressedBlock)>
) -> UnitResult
[src]

Compresses all blocks to the file. The index of the block must be in increasing line order within the header. Obtain iterator with MetaData::collect_ordered_blocks(...) or similar methods. Read more

fn compress_all_blocks_parallel(
    self,
    meta: &MetaData,
    blocks: impl Iterator<Item = (usize, UncompressedBlock)>
) -> UnitResult
[src]

Compresses all blocks to the file. The index of the block must be in increasing line order within the header. Obtain iterator with MetaData::collect_ordered_blocks(...) or similar methods. Read more

impl<W: Debug> Debug for ChunkWriter<W>[src]

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

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl<W> RefUnwindSafe for ChunkWriter<W> where
    W: RefUnwindSafe

impl<W> Send for ChunkWriter<W> where
    W: Send

impl<W> Sync for ChunkWriter<W> where
    W: Sync

impl<W> Unpin for ChunkWriter<W> where
    W: Unpin

impl<W> UnwindSafe for ChunkWriter<W> where
    W: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.