pub struct HdrDecoder<R> { /* private fields */ }
Expand description
An Radiance HDR decoder
Implementations§
source§impl<R> HdrDecoder<R>where
R: BufRead,
impl<R> HdrDecoder<R>where
R: BufRead,
sourcepub fn new(reader: R) -> Result<HdrDecoder<R>, ImageError>
pub fn new(reader: R) -> Result<HdrDecoder<R>, ImageError>
Reads Radiance HDR image header from stream r
if the header is valid, creates HdrDecoder
strict mode is enabled
sourcepub fn with_strictness(
reader: R,
strict: bool
) -> Result<HdrDecoder<R>, ImageError>
pub fn with_strictness( reader: R, strict: bool ) -> Result<HdrDecoder<R>, ImageError>
Reads Radiance HDR image header from stream reader
,
if the header is valid, creates HdrDecoder
.
strict enables strict mode
Warning! Reading wrong file in non-strict mode could consume file size worth of memory in the process.
sourcepub fn metadata(&self) -> HdrMetadata
pub fn metadata(&self) -> HdrMetadata
Returns file metadata. Refer to HDRMetadata
for details.
sourcepub fn read_image_native(self) -> Result<Vec<Rgbe8Pixel>, ImageError>
pub fn read_image_native(self) -> Result<Vec<Rgbe8Pixel>, ImageError>
Consumes decoder and returns a vector of RGBE8 pixels
sourcepub fn read_image_transform<T, F>(
self,
f: F,
output_slice: &mut [T]
) -> Result<(), ImageError>
pub fn read_image_transform<T, F>( self, f: F, output_slice: &mut [T] ) -> Result<(), ImageError>
Consumes decoder and returns a vector of transformed pixels
sourcepub fn read_image_ldr(self) -> Result<Vec<Rgb<u8>>, ImageError>
pub fn read_image_ldr(self) -> Result<Vec<Rgb<u8>>, ImageError>
Consumes decoder and returns a vector of Rgb
sourcepub fn read_image_hdr(self) -> Result<Vec<Rgb<f32>>, ImageError>
pub fn read_image_hdr(self) -> Result<Vec<Rgb<f32>>, ImageError>
Consumes decoder and returns a vector of Rgb
Trait Implementations§
source§impl<R> Debug for HdrDecoder<R>where
R: Debug,
impl<R> Debug for HdrDecoder<R>where
R: Debug,
source§impl<R> IntoIterator for HdrDecoder<R>where
R: BufRead,
impl<R> IntoIterator for HdrDecoder<R>where
R: BufRead,
§type Item = Result<Rgbe8Pixel, ImageError>
type Item = Result<Rgbe8Pixel, ImageError>
The type of the elements being iterated over.
§type IntoIter = HdrImageDecoderIterator<R>
type IntoIter = HdrImageDecoderIterator<R>
Which kind of iterator are we turning this into?
source§fn into_iter(self) -> <HdrDecoder<R> as IntoIterator>::IntoIter
fn into_iter(self) -> <HdrDecoder<R> as IntoIterator>::IntoIter
Creates an iterator from a value. Read more
Auto Trait Implementations§
impl<R> RefUnwindSafe for HdrDecoder<R>where
R: RefUnwindSafe,
impl<R> Send for HdrDecoder<R>where
R: Send,
impl<R> Sync for HdrDecoder<R>where
R: Sync,
impl<R> Unpin for HdrDecoder<R>where
R: Unpin,
impl<R> UnwindSafe for HdrDecoder<R>where
R: UnwindSafe,
Blanket Implementations§
source§impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
source§fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
Convert the source color to the destination color using the specified
method
source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
Convert the source color to the destination color using the bradford
method by default
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
Mutably borrows from an owned value. Read more
source§impl<T, U> ConvertInto<U> for Twhere
U: ConvertFrom<T>,
impl<T, U> ConvertInto<U> for Twhere
U: ConvertFrom<T>,
source§fn convert_into(self) -> U
fn convert_into(self) -> U
Convert into T with values clamped to the color defined bounds Read more
source§fn convert_unclamped_into(self) -> U
fn convert_unclamped_into(self) -> U
Convert into T. The resulting color might be invalid in its color space Read more
source§fn try_convert_into(self) -> Result<U, OutOfBounds<U>>
fn try_convert_into(self) -> Result<U, OutOfBounds<U>>
Convert into T, returning ok if the color is inside of its defined range,
otherwise an
OutOfBounds
error is returned which contains the unclamped color. Read more