pub struct Canvas { /* private fields */ }Expand description
Pixels being drawn, premultiplied, in floats.
Implementations§
Source§impl Canvas
impl Canvas
pub fn width(&self) -> u32
pub fn height(&self) -> u32
Sourcepub fn fill(&mut self, contours: &[Vec<Vec2>], color: Color)
pub fn fill(&mut self, contours: &[Vec<Vec2>], color: Color)
The inside of contours (closed polylines; an open one is closed)
painted color.
Sourcepub fn stroke(&mut self, polylines: &[Vec<Vec2>], width: f32, color: Color)
pub fn stroke(&mut self, polylines: &[Vec<Vec2>], width: f32, color: Color)
polylines drawn width wide in color, round-joined and capped.
Sourcepub fn image(&mut self, image: &Image, dst: Rect, tint: Option<Color>)
pub fn image(&mut self, image: &Image, dst: Rect, tint: Option<Color>)
image sampled (nearest) into dst, its colors multiplied by
tint if given.
Sourcepub fn mask(&mut self, mask: &Mask, dst: Rect, color: Color)
pub fn mask(&mut self, mask: &Mask, dst: Rect, color: Color)
mask in box dst (pixels), its set pixels color.
Sourcepub fn into_image(self) -> Image
pub fn into_image(self) -> Image
The drawing, straight alpha.
Trait Implementations§
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