pub struct Image<'a> { /* private fields */ }
Expand description
An RGBA Image in row-major order from top to bottom.
Implementations§
source§impl<'a> Image<'a>
impl<'a> Image<'a>
sourcepub const fn new(rgba: &'a [u8], width: u32, height: u32) -> Self
pub const fn new(rgba: &'a [u8], width: u32, height: u32) -> Self
Creates a new Image using RGBA data, in row-major order from top to bottom, and with specified width and height.
sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self>
Available on crate features image-ico
or image-png
only.
pub fn from_bytes(bytes: &[u8]) -> Result<Self>
image-ico
or image-png
only.Creates a new image using the provided bytes.
Only ico
and png
are supported (based on activated feature flag).
sourcepub fn from_path<P: AsRef<Path>>(path: P) -> Result<Self>
Available on crate features image-ico
or image-png
only.
pub fn from_path<P: AsRef<Path>>(path: P) -> Result<Self>
image-ico
or image-png
only.Creates a new image using the provided path.
Only ico
and png
are supported (based on activated feature flag).
Trait Implementations§
source§impl Resource for Image<'static>
impl Resource for Image<'static>
Auto Trait Implementations§
impl<'a> Freeze for Image<'a>
impl<'a> RefUnwindSafe for Image<'a>
impl<'a> Send for Image<'a>
impl<'a> Sync for Image<'a>
impl<'a> Unpin for Image<'a>
impl<'a> UnwindSafe for Image<'a>
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