Struct WriteImageWithOptions

pub struct WriteImageWithOptions<'img, Layers, OnProgress> { /* private fields */ }

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

Implementations

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

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.

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.

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.

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.

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.

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.

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

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

fn clone(&self) -> Self

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

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

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

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

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

Auto Trait Implementations

impl<'img, Layers, OnProgress> Freeze for WriteImageWithOptions<'img, Layers, OnProgress> where &'img Image<Layers>: Freeze, OnProgress: Freeze,

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

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

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

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

impl<'img, Layers, OnProgress> UnsafeUnpin for WriteImageWithOptions<'img, Layers, OnProgress> where &'img Image<Layers>: UnsafeUnpin, OnProgress: UnsafeUnpin,

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

Blanket Implementations

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for WriteImageWithOptions<'img, Layers, OnProgress> where ST: ?Sized, DT: ?Sized,

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for WriteImageWithOptions<'img, Layers, OnProgress> where ST: ?Sized, DT: ?Sized,

impl<T> Any for WriteImageWithOptions<'img, Layers, OnProgress> where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for WriteImageWithOptions<'img, Layers, OnProgress> where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for WriteImageWithOptions<'img, Layers, OnProgress> where T: ?Sized,

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

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

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

impl<T> From<T> for WriteImageWithOptions<'img, Layers, OnProgress>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> Pointable for WriteImageWithOptions<'img, Layers, OnProgress>

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 WriteImageWithOptions<'img, Layers, OnProgress> where T: ?Sized,

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

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

impl<T, U> Into<U> for WriteImageWithOptions<'img, Layers, OnProgress> 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 WriteImageWithOptions<'img, Layers, OnProgress> where U: Into<T>,

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

impl<T, U> TryInto<U> for WriteImageWithOptions<'img, Layers, OnProgress> where U: TryFrom<T>,

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