Skip to main content

DecodedImage

Struct DecodedImage 

Source
pub struct DecodedImage<'alloc> {
    pub width: u32,
    pub height: u32,
    pub data: Bytes<'alloc>,
}
Available on crate feature kitty-graphics only.
Expand description

Result of decoding an image.

The data buffer must be allocated through the allocator provided to the decode callback. The library takes ownership and will free it with the same allocator.

Fields§

§width: u32

Image width in pixels.

§height: u32

Image height in pixels.

§data: Bytes<'alloc>

Byte buffer containing the decoded RGBA pixel data.

Trait Implementations§

Source§

impl<'alloc> Debug for DecodedImage<'alloc>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<DecodedImage<'_>> for SysImage

Source§

fn from(value: DecodedImage<'_>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<'alloc> !Send for DecodedImage<'alloc>

§

impl<'alloc> !Sync for DecodedImage<'alloc>

§

impl<'alloc> Freeze for DecodedImage<'alloc>

§

impl<'alloc> RefUnwindSafe for DecodedImage<'alloc>

§

impl<'alloc> Unpin for DecodedImage<'alloc>

§

impl<'alloc> UnsafeUnpin for DecodedImage<'alloc>

§

impl<'alloc> UnwindSafe for DecodedImage<'alloc>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.