Struct exr::image::read::image::ReadImage [−][src]
pub struct ReadImage<OnProgress, ReadLayers> { /* fields omitted */ }
Expand description
Specify whether to read the image in parallel, whether to use pedantic error handling, and a callback for the reading progress.
Implementations
impl<F, L> ReadImage<F, L> where
F: FnMut(f64),
[src]
impl<F, L> ReadImage<F, L> where
F: FnMut(f64),
[src]pub fn new(read_layers: L, on_progress: F) -> Self
[src]
pub fn new(read_layers: L, on_progress: F) -> Self
[src]Uses relaxed error handling and parallel decompression.
pub fn pedantic(self) -> Self
[src]
pub fn pedantic(self) -> Self
[src]Specify that any missing or unusual information should result in an error.
Otherwise, exrs
will try to compute or ignore missing information.
If pedantic is true, then an error will be returned as soon as anything is missing in the file, or two values in the image contradict each other. If pedantic is false, then only fatal errors will be thrown. By default, reading an image is not pedantic, which means that slightly invalid files might still be readable. For example, if some attribute is missing but can be recomputed, this flag decides whether an error is thrown. Or if the pedantic flag is true and there are still bytes left after the decompression algorithm finished, an error is thrown, because this should not happen and something might be wrong with the file. Or if your application is a target of attacks, or if you want to emulate the original C++ library, you might want to switch to pedantic reading.
pub fn non_parallel(self) -> Self
[src]
pub fn non_parallel(self) -> Self
[src]Specify that multiple pixel blocks should never be decompressed using multiple threads at once. This might be slower but uses less memory and less synchronization.
pub fn on_progress(self, on_progress: F) -> Self where
F: FnMut(f64),
[src]
pub fn on_progress(self, on_progress: F) -> Self where
F: FnMut(f64),
[src]Specify a function to be called regularly throughout the loading process. Replaces all previously specified progress functions in this reader.
#[must_use]pub fn from_file<Layers>(self, path: impl AsRef<Path>) -> Result<Image<Layers>> where
L: ReadLayers<'s, Layers = Layers>,
[src]
#[must_use]pub fn from_file<Layers>(self, path: impl AsRef<Path>) -> Result<Image<Layers>> where
L: ReadLayers<'s, Layers = Layers>,
[src]Read the exr image from a file.
Use [ReadImage::read_from_unbuffered
] instead, if you do not have a file.
#[must_use]pub fn from_unbuffered<Layers>(
self,
unbuffered: impl Read + Seek
) -> Result<Image<Layers>> where
L: ReadLayers<'s, Layers = Layers>,
[src]
#[must_use]pub fn from_unbuffered<Layers>(
self,
unbuffered: impl Read + Seek
) -> Result<Image<Layers>> where
L: ReadLayers<'s, Layers = Layers>,
[src]Buffer the reader and then read the exr image from it.
Use [ReadImage::read_from_buffered
] instead, if your reader is an in-memory reader.
Use [ReadImage::read_from_file
] instead, if you have a file path.
#[must_use]pub fn from_buffered<Layers>(
self,
buffered: impl Read + Seek
) -> Result<Image<Layers>> where
L: ReadLayers<'s, Layers = Layers>,
[src]
#[must_use]pub fn from_buffered<Layers>(
self,
buffered: impl Read + Seek
) -> Result<Image<Layers>> where
L: ReadLayers<'s, Layers = Layers>,
[src]Read the exr image from a buffered reader.
Use [ReadImage::read_from_file
] instead, if you have a file path.
Use [ReadImage::read_from_unbuffered
] instead, if this is not an in-memory reader.
#[must_use]pub fn from_chunks<Layers>(
self,
chunks_reader: Reader<impl Read + Seek>
) -> Result<Image<Layers>> where
L: ReadLayers<'s, Layers = Layers>,
[src]
#[must_use]pub fn from_chunks<Layers>(
self,
chunks_reader: Reader<impl Read + Seek>
) -> Result<Image<Layers>> where
L: ReadLayers<'s, Layers = Layers>,
[src]Read the exr image from an initialized chunks reader
that has already extracted the meta data from the file.
Use [ReadImage::read_from_file
] instead, if you have a file path.
Use [ReadImage::read_from_buffered
] instead, if this is an in-memory reader.
Trait Implementations
Auto Trait Implementations
impl<OnProgress, ReadLayers> RefUnwindSafe for ReadImage<OnProgress, ReadLayers> where
OnProgress: RefUnwindSafe,
ReadLayers: RefUnwindSafe,
OnProgress: RefUnwindSafe,
ReadLayers: RefUnwindSafe,
impl<OnProgress, ReadLayers> Send for ReadImage<OnProgress, ReadLayers> where
OnProgress: Send,
ReadLayers: Send,
OnProgress: Send,
ReadLayers: Send,
impl<OnProgress, ReadLayers> Sync for ReadImage<OnProgress, ReadLayers> where
OnProgress: Sync,
ReadLayers: Sync,
OnProgress: Sync,
ReadLayers: Sync,
impl<OnProgress, ReadLayers> Unpin for ReadImage<OnProgress, ReadLayers> where
OnProgress: Unpin,
ReadLayers: Unpin,
OnProgress: Unpin,
ReadLayers: Unpin,
impl<OnProgress, ReadLayers> UnwindSafe for ReadImage<OnProgress, ReadLayers> where
OnProgress: UnwindSafe,
ReadLayers: UnwindSafe,
OnProgress: UnwindSafe,
ReadLayers: UnwindSafe,
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more