pub struct Image {
pub bytes: Vec<u8>,
pub width: u16,
pub height: u16,
}Expand description
Image, data stored in CPU memory
Fields§
§bytes: Vec<u8>§width: u16§height: u16Implementations§
Source§impl Image
impl Image
pub fn from_file_with_format(bytes: &[u8], format: Option<ImageFormat>) -> Image
pub fn empty() -> Image
pub fn gen_image_color(width: u16, height: u16, color: Color) -> Image
pub fn update(&mut self, colors: &[Color])
pub fn width(&self) -> usize
pub fn height(&self) -> usize
pub fn get_image_data(&self) -> &[[u8; 4]]
pub fn get_image_data_mut(&mut self) -> &mut [[u8; 4]]
pub fn set_pixel(&mut self, x: u32, y: u32, color: Color)
pub fn get_pixel(&self, x: u32, y: u32) -> Color
pub fn export_png(&self, path: &str)
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