pub struct RawImage {
pub width: u32,
pub height: u32,
pub cpp: u32,
pub data: PixelData,
pub float_max: Option<f32>,
}Expand description
A decoded image buffer: width x height pixels of cpp interleaved samples.
Fields§
§width: u32Width in pixels.
height: u32Height in pixels.
cpp: u32Components (samples) per pixel: 1 for CFA/mono, 3 for linear RGB / Foveon, 4 for some.
data: PixelDataRow-major samples, width * height * cpp in total.
float_max: Option<f32>Largest non-negative, non-NaN sample of float data, when the decoder measured it while decoding (saves a pass over the buffer when converting to integers).
Implementations§
Source§impl RawImage
impl RawImage
Sourcepub fn new_u16(
width: u32,
height: u32,
cpp: u32,
limits: &Limits,
) -> Result<Self>
pub fn new_u16( width: u32, height: u32, cpp: u32, limits: &Limits, ) -> Result<Self>
Allocate a zeroed u16 image, enforcing limits.
Sourcepub fn new_f32(
width: u32,
height: u32,
cpp: u32,
limits: &Limits,
) -> Result<Self>
pub fn new_f32( width: u32, height: u32, cpp: u32, limits: &Limits, ) -> Result<Self>
Allocate a zeroed f32 image, enforcing limits.
Sourcepub fn u16(&self) -> &[u16]
pub fn u16(&self) -> &[u16]
u16 samples. Panics if this is a float image (a decoder bug, not bad input).
Sourcepub fn u16_mut(&mut self) -> &mut [u16]
pub fn u16_mut(&mut self) -> &mut [u16]
Mutable u16 samples. Panics if this is a float image (a decoder bug, not bad input).
Trait Implementations§
impl StructuralPartialEq for RawImage
Auto Trait Implementations§
impl Freeze for RawImage
impl RefUnwindSafe for RawImage
impl Send for RawImage
impl Sync for RawImage
impl Unpin for RawImage
impl UnsafeUnpin for RawImage
impl UnwindSafe for RawImage
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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