#[non_exhaustive]pub struct DecodedImage {
pub width: u32,
pub height: u32,
pub format: PixelFormat,
pub data: Vec<u8>,
}Expand description
A decoded image with dimensions and pixel data.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.width: u32Image width in pixels
height: u32Image height in pixels
format: PixelFormatPixel format of the data
data: Vec<u8>Raw pixel data in the specified format
Implementations§
Source§impl DecodedImage
impl DecodedImage
Sourcepub fn dimensions(&self) -> (u32, u32)
pub fn dimensions(&self) -> (u32, u32)
Returns the image dimensions as a tuple (width, height).
Sourcepub fn bytes_per_pixel(&self) -> usize
pub fn bytes_per_pixel(&self) -> usize
Returns the number of bytes per pixel for this image’s format.
Trait Implementations§
Source§impl Clone for DecodedImage
impl Clone for DecodedImage
Source§fn clone(&self) -> DecodedImage
fn clone(&self) -> DecodedImage
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DecodedImage
impl RefUnwindSafe for DecodedImage
impl Send for DecodedImage
impl Sync for DecodedImage
impl Unpin for DecodedImage
impl UnwindSafe for DecodedImage
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