pub struct Canvas { /* private fields */ }Implementations§
Source§impl Canvas
impl Canvas
pub fn new(width: usize, height: usize) -> Self
pub fn width(&self) -> usize
pub fn height(&self) -> usize
pub fn pixel(&self, x: usize, y: usize) -> Option<Color>
pub fn rect(&mut self, x: i64, y: i64, w: i64, h: i64, c: Color)
pub fn text_width(text: &str, scale: usize) -> i64
pub fn text(&mut self, x: i64, y: i64, text: &str, scale: usize, c: Color)
pub fn write_png<W: Write>(&self, out: W) -> Result<()>
pub fn png(&self) -> Result<Vec<u8>>
pub fn save(&self, path: &Path) -> Result<()>
Auto Trait Implementations§
impl Freeze for Canvas
impl RefUnwindSafe for Canvas
impl Send for Canvas
impl Sync for Canvas
impl Unpin for Canvas
impl UnsafeUnpin for Canvas
impl UnwindSafe for Canvas
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