pub struct ImageHandle {
pub width: u32,
pub height: u32,
pub pixels: Vec<u8>,
}Expand description
A decoded image ready for rendering.
Full decode and cache support will be implemented in Phase 2. Phase 1
supports PNG decoding via tiny-skia.
Fields§
§width: u32Image width in pixels.
height: u32Image height in pixels.
pixels: Vec<u8>Raw RGBA pixel data, row-major, 4 bytes per pixel.
Implementations§
Source§impl ImageHandle
impl ImageHandle
Sourcepub fn from_png_bytes(bytes: &[u8]) -> Option<Self>
pub fn from_png_bytes(bytes: &[u8]) -> Option<Self>
Decode a PNG image from raw bytes.
Returns None if the bytes are not valid PNG data.
Trait Implementations§
Source§impl Clone for ImageHandle
impl Clone for ImageHandle
Source§fn clone(&self) -> ImageHandle
fn clone(&self) -> ImageHandle
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ImageHandle
impl RefUnwindSafe for ImageHandle
impl Send for ImageHandle
impl Sync for ImageHandle
impl Unpin for ImageHandle
impl UnsafeUnpin for ImageHandle
impl UnwindSafe for ImageHandle
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