pub struct Image { /* private fields */ }Implementations§
Source§impl Image
impl Image
pub fn new(width: u32, height: u32, channels: u32, pixels: Box<[u8]>) -> Self
Sourcepub fn load<P: AsRef<Path>>(path: P, desired_channels: i32) -> Result<Self>
pub fn load<P: AsRef<Path>>(path: P, desired_channels: i32) -> Result<Self>
Loads an image from a path
Sourcepub fn load_from_memory(buf: &[u8], desired_channels: i32) -> Result<Self>
pub fn load_from_memory(buf: &[u8], desired_channels: i32) -> Result<Self>
Loads an image from memory, such as a memory mapped file
pub fn width(&self) -> u32
pub fn height(&self) -> u32
pub fn channels(&self) -> u32
pub fn pixels(&self) -> &[u8] ⓘ
pub fn pixels_mut(&mut self) -> &mut [u8] ⓘ
Auto Trait Implementations§
impl Freeze for Image
impl RefUnwindSafe for Image
impl Send for Image
impl Sync for Image
impl Unpin for Image
impl UnwindSafe for Image
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