pub struct HdrEncoder<W: Write> {
w: W,
}
Expand description
Radiance HDR encoder
Fields§
§w: W
Implementations§
Source§impl<W: Write> HdrEncoder<W>
impl<W: Write> HdrEncoder<W>
Sourcepub fn new(w: W) -> HdrEncoder<W>
pub fn new(w: W) -> HdrEncoder<W>
Creates encoder
Sourcepub fn encode(
self,
rgb: &[Rgb<f32>],
width: usize,
height: usize,
) -> ImageResult<()>
pub fn encode( self, rgb: &[Rgb<f32>], width: usize, height: usize, ) -> ImageResult<()>
Encodes the image rgb
that has dimensions width
and height
Sourcefn encode_pixels(
self,
flattened_rgbe_pixels: impl ExactSizeIterator<Item = Rgbe8Pixel>,
width: usize,
height: usize,
) -> ImageResult<()>
fn encode_pixels( self, flattened_rgbe_pixels: impl ExactSizeIterator<Item = Rgbe8Pixel>, width: usize, height: usize, ) -> ImageResult<()>
Encodes the image flattened_rgbe_pixels
that has dimensions width
and height
.
The callback must return the color for the given flattened index of the pixel (row major).
Trait Implementations§
Source§impl<W: Write> ImageEncoder for HdrEncoder<W>
impl<W: Write> ImageEncoder for HdrEncoder<W>
Source§fn write_image(
self,
unaligned_bytes: &[u8],
width: u32,
height: u32,
color_type: ExtendedColorType,
) -> ImageResult<()>
fn write_image( self, unaligned_bytes: &[u8], width: u32, height: u32, color_type: ExtendedColorType, ) -> ImageResult<()>
Writes all the bytes in an image to the encoder. Read more
Source§fn set_icc_profile(
&mut self,
icc_profile: Vec<u8>,
) -> Result<(), UnsupportedError>
fn set_icc_profile( &mut self, icc_profile: Vec<u8>, ) -> Result<(), UnsupportedError>
Set the ICC profile to use for the image. Read more
Auto Trait Implementations§
impl<W> Freeze for HdrEncoder<W>where
W: Freeze,
impl<W> RefUnwindSafe for HdrEncoder<W>where
W: RefUnwindSafe,
impl<W> Send for HdrEncoder<W>where
W: Send,
impl<W> Sync for HdrEncoder<W>where
W: Sync,
impl<W> Unpin for HdrEncoder<W>where
W: Unpin,
impl<W> UnwindSafe for HdrEncoder<W>where
W: 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