Struct image::codecs::hdr::HdrDecoder
source · pub struct HdrDecoder<R> {
r: R,
width: u32,
height: u32,
meta: HdrMetadata,
}
Expand description
An Radiance HDR decoder
Fields§
§r: R
§width: u32
§height: u32
§meta: HdrMetadata
Implementations§
source§impl<R: BufRead> HdrDecoder<R>
impl<R: BufRead> HdrDecoder<R>
sourcepub fn new(reader: R) -> ImageResult<HdrDecoder<R>>
pub fn new(reader: R) -> ImageResult<HdrDecoder<R>>
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) -> ImageResult<HdrDecoder<R>>
pub fn with_strictness(reader: R, strict: bool) -> ImageResult<HdrDecoder<R>>
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) -> ImageResult<Vec<Rgbe8Pixel>>
pub fn read_image_native(self) -> ImageResult<Vec<Rgbe8Pixel>>
Consumes decoder and returns a vector of RGBE8 pixels
sourcepub fn read_image_transform<T: Send, F: Send + Sync + Fn(Rgbe8Pixel) -> T>(
self,
f: F,
output_slice: &mut [T],
) -> ImageResult<()>
pub fn read_image_transform<T: Send, F: Send + Sync + Fn(Rgbe8Pixel) -> T>( self, f: F, output_slice: &mut [T], ) -> ImageResult<()>
Consumes decoder and returns a vector of transformed pixels
sourcepub fn read_image_ldr(self) -> ImageResult<Vec<Rgb<u8>>>
pub fn read_image_ldr(self) -> ImageResult<Vec<Rgb<u8>>>
Consumes decoder and returns a vector of Rgb<u8>
pixels.
scale = 1, gamma = 2.2
sourcepub fn read_image_hdr(self) -> ImageResult<Vec<Rgb<f32>>>
pub fn read_image_hdr(self) -> ImageResult<Vec<Rgb<f32>>>
Consumes decoder and returns a vector of Rgb<f32>
pixels.
Trait Implementations§
source§impl<R: Debug> Debug for HdrDecoder<R>
impl<R: Debug> Debug for HdrDecoder<R>
source§impl<R: Read> IntoIterator for HdrDecoder<R>
impl<R: Read> IntoIterator for HdrDecoder<R>
source§type Item = Result<Rgbe8Pixel, ImageError>
type Item = Result<Rgbe8Pixel, ImageError>
The type of the elements being iterated over.
source§type IntoIter = HdrImageDecoderIterator<R>
type IntoIter = HdrImageDecoderIterator<R>
Which kind of iterator are we turning this into?
Auto Trait Implementations§
impl<R> Freeze for HdrDecoder<R>where
R: Freeze,
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<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> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more