pub struct Raster { /* private fields */ }
Implementations§
Source§impl Raster
impl Raster
Sourcepub fn draw_line(&mut self, p0: &Point, p1: &Point)
pub fn draw_line(&mut self, p0: &Point, p1: &Point)
Examples found in repository?
examples/draw_shape.rs (lines 25-34)
24fn draw_shape(r: &mut Raster, s: f32) {
25 r.draw_line(
26 &Point {
27 x: s * 10.0,
28 y: s * 10.5,
29 },
30 &Point {
31 x: s * 20.0,
32 y: s * 150.0,
33 },
34 );
35 r.draw_line(
36 &Point {
37 x: s * 20.0,
38 y: s * 150.0,
39 },
40 &Point {
41 x: s * 50.0,
42 y: s * 139.0,
43 },
44 );
45 r.draw_quad(
46 &Point {
47 x: s * 50.0,
48 y: s * 139.0,
49 },
50 &Point {
51 x: s * 100.0,
52 y: s * 60.0,
53 },
54 &Point {
55 x: s * 10.0,
56 y: s * 10.5,
57 },
58 );
59}
Sourcepub fn draw_quad(&mut self, p0: &Point, p1: &Point, p2: &Point)
pub fn draw_quad(&mut self, p0: &Point, p1: &Point, p2: &Point)
Examples found in repository?
examples/draw_shape.rs (lines 45-58)
24fn draw_shape(r: &mut Raster, s: f32) {
25 r.draw_line(
26 &Point {
27 x: s * 10.0,
28 y: s * 10.5,
29 },
30 &Point {
31 x: s * 20.0,
32 y: s * 150.0,
33 },
34 );
35 r.draw_line(
36 &Point {
37 x: s * 20.0,
38 y: s * 150.0,
39 },
40 &Point {
41 x: s * 50.0,
42 y: s * 139.0,
43 },
44 );
45 r.draw_quad(
46 &Point {
47 x: s * 50.0,
48 y: s * 139.0,
49 },
50 &Point {
51 x: s * 100.0,
52 y: s * 60.0,
53 },
54 &Point {
55 x: s * 10.0,
56 y: s * 10.5,
57 },
58 );
59}
Sourcepub fn get_bitmap(&self) -> Vec<u8> ⓘ
pub fn get_bitmap(&self) -> Vec<u8> ⓘ
Auto Trait Implementations§
impl Freeze for Raster
impl RefUnwindSafe for Raster
impl Send for Raster
impl Sync for Raster
impl Unpin for Raster
impl UnwindSafe for Raster
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