pub struct WriteImageWithOptions<'img, Layers, OnProgress> {
    image: &'img Image<Layers>,
    on_progress: OnProgress,
    check_compatibility: bool,
    parallel: bool,
}
Expand description

A temporary writer which can be configured and used to write an image to a file.

Fields§

§image: &'img Image<Layers>§on_progress: OnProgress§check_compatibility: bool§parallel: bool

Implementations§

source§

impl<'img, L, F> WriteImageWithOptions<'img, L, F>where L: WritableLayers<'img>, F: FnMut(f64),

source

pub fn infer_meta_data(&self) -> Headers

Generate file meta data for this image. The meta data structure is close to the data in the file.

source

pub fn non_parallel(self) -> Self

Do not compress multiple pixel blocks on multiple threads at once. Might use less memory and synchronization, but will be slower in most situations.

source

pub fn skip_compatibility_checks(self) -> Self

Skip some checks that ensure a file can be opened by other exr software. For example, it is no longer checked that no two headers or two attributes have the same name, which might be an expensive check for images with an exorbitant number of headers.

If you write an uncompressed file and need maximum speed, it might save a millisecond to disable the checks, if you know that your file is not invalid any ways. I do not recommend this though, as the file might not be readably by any other exr library after that. You must care for not producing an invalid file yourself.

source

pub fn on_progress<OnProgress>( self, on_progress: OnProgress ) -> WriteImageWithOptions<'img, L, OnProgress>where OnProgress: FnMut(f64),

Specify a function to be called regularly throughout the writing process. Replaces all previously specified progress functions in this reader.

source

pub fn to_file(self, path: impl AsRef<Path>) -> UnitResult

Write the exr image to a file. Use to_unbuffered instead, if you do not have a file. If an error occurs, attempts to delete the partially written file.

source

pub fn to_unbuffered(self, unbuffered: impl Write + Seek) -> UnitResult

Buffer the writer and then write the exr image to it. Use to_buffered instead, if your writer is an in-memory buffer. Use to_file instead, if you have a file path. If your writer cannot seek, you can write to an in-memory vector of bytes first, using to_buffered.

source

pub fn to_buffered(self, write: impl Write + Seek) -> UnitResult

Write the exr image to a writer. Use to_file instead, if you have a file path. Use to_unbuffered instead, if this is not an in-memory writer. If your writer cannot seek, you can write to an in-memory vector of bytes first.

Trait Implementations§

source§

impl<'img, Layers: Clone, OnProgress: Clone> Clone for WriteImageWithOptions<'img, Layers, OnProgress>

source§

fn clone(&self) -> WriteImageWithOptions<'img, Layers, OnProgress>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'img, Layers: Debug, OnProgress: Debug> Debug for WriteImageWithOptions<'img, Layers, OnProgress>

source§

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

Formats the value using the given formatter. Read more
source§

impl<'img, Layers: PartialEq, OnProgress: PartialEq> PartialEq<WriteImageWithOptions<'img, Layers, OnProgress>> for WriteImageWithOptions<'img, Layers, OnProgress>

source§

fn eq(&self, other: &WriteImageWithOptions<'img, Layers, OnProgress>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'img, Layers, OnProgress> StructuralPartialEq for WriteImageWithOptions<'img, Layers, OnProgress>

Auto Trait Implementations§

§

impl<'img, Layers, OnProgress> RefUnwindSafe for WriteImageWithOptions<'img, Layers, OnProgress>where Layers: RefUnwindSafe, OnProgress: RefUnwindSafe,

§

impl<'img, Layers, OnProgress> Send for WriteImageWithOptions<'img, Layers, OnProgress>where Layers: Sync, OnProgress: Send,

§

impl<'img, Layers, OnProgress> Sync for WriteImageWithOptions<'img, Layers, OnProgress>where Layers: Sync, OnProgress: Sync,

§

impl<'img, Layers, OnProgress> Unpin for WriteImageWithOptions<'img, Layers, OnProgress>where OnProgress: Unpin,

§

impl<'img, Layers, OnProgress> UnwindSafe for WriteImageWithOptions<'img, Layers, OnProgress>where Layers: RefUnwindSafe, OnProgress: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

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

Performs the conversion.