Struct exr::image::write::WriteImageWithOptions
source · 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>
impl<'img, L, F> WriteImageWithOptions<'img, L, F>
sourcepub fn infer_meta_data(&self) -> Headers
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.
sourcepub fn non_parallel(self) -> Self
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.
sourcepub fn skip_compatibility_checks(self) -> Self
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.
sourcepub fn on_progress<OnProgress>(
self,
on_progress: OnProgress,
) -> WriteImageWithOptions<'img, L, OnProgress>
pub fn on_progress<OnProgress>( self, on_progress: OnProgress, ) -> WriteImageWithOptions<'img, L, OnProgress>
Specify a function to be called regularly throughout the writing process. Replaces all previously specified progress functions in this reader.
sourcepub fn to_file(self, path: impl AsRef<Path>) -> UnitResult
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.
sourcepub fn to_unbuffered(self, unbuffered: impl Write + Seek) -> UnitResult
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
.
sourcepub fn to_buffered(self, write: impl Write + Seek) -> UnitResult
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>
impl<'img, Layers: Clone, OnProgress: Clone> Clone for WriteImageWithOptions<'img, Layers, OnProgress>
source§fn clone(&self) -> WriteImageWithOptions<'img, Layers, OnProgress>
fn clone(&self) -> WriteImageWithOptions<'img, Layers, OnProgress>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<'img, Layers: Debug, OnProgress: Debug> Debug for WriteImageWithOptions<'img, Layers, OnProgress>
impl<'img, Layers: Debug, OnProgress: Debug> Debug for WriteImageWithOptions<'img, Layers, OnProgress>
source§impl<'img, Layers: PartialEq, OnProgress: PartialEq> PartialEq for WriteImageWithOptions<'img, Layers, OnProgress>
impl<'img, Layers: PartialEq, OnProgress: PartialEq> PartialEq for WriteImageWithOptions<'img, Layers, OnProgress>
source§fn eq(&self, other: &WriteImageWithOptions<'img, Layers, OnProgress>) -> bool
fn eq(&self, other: &WriteImageWithOptions<'img, Layers, OnProgress>) -> bool
self
and other
values to be equal, and is used by ==
.impl<'img, Layers, OnProgress> StructuralPartialEq for WriteImageWithOptions<'img, Layers, OnProgress>
Auto Trait Implementations§
impl<'img, Layers, OnProgress> Freeze for WriteImageWithOptions<'img, Layers, OnProgress>where
OnProgress: Freeze,
impl<'img, Layers, OnProgress> RefUnwindSafe for WriteImageWithOptions<'img, Layers, OnProgress>where
OnProgress: RefUnwindSafe,
Layers: RefUnwindSafe,
impl<'img, Layers, OnProgress> Send for WriteImageWithOptions<'img, Layers, OnProgress>
impl<'img, Layers, OnProgress> Sync for WriteImageWithOptions<'img, Layers, OnProgress>
impl<'img, Layers, OnProgress> Unpin for WriteImageWithOptions<'img, Layers, OnProgress>where
OnProgress: Unpin,
impl<'img, Layers, OnProgress> UnwindSafe for WriteImageWithOptions<'img, Layers, OnProgress>where
OnProgress: UnwindSafe,
Layers: RefUnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)