pub trait Draw {
// Required method
fn add_path<T: IntoBezPathTolerance>(&mut self, path: T) -> &mut Self;
// Provided methods
fn cubic_bezier(
&mut self,
x1: impl Into<f64>,
y1: impl Into<f64>,
x2: impl Into<f64>,
y2: impl Into<f64>,
x3: impl Into<f64>,
y3: impl Into<f64>,
x4: impl Into<f64>,
y4: impl Into<f64>
) -> &mut Self { ... }
fn quadratic_bezier(
&mut self,
x1: impl Into<f64>,
y1: impl Into<f64>,
x2: impl Into<f64>,
y2: impl Into<f64>,
x3: impl Into<f64>,
y3: impl Into<f64>
) -> &mut Self { ... }
fn arc(
&mut self,
x: impl Into<f64>,
y: impl Into<f64>,
rx: impl Into<f64>,
ry: impl Into<f64>,
start: f64,
sweep: f64,
x_rot: f64
) -> &mut Self { ... }
fn circle(
&mut self,
x: impl Into<f64>,
y: impl Into<f64>,
r: impl Into<f64>
) -> &mut Self { ... }
fn ellipse(
&mut self,
x: impl Into<f64>,
y: impl Into<f64>,
rx: impl Into<f64>,
ry: impl Into<f64>,
x_rot: f64
) -> &mut Self { ... }
fn line(
&mut self,
x1: impl Into<f64>,
y1: impl Into<f64>,
x2: impl Into<f64>,
y2: impl Into<f64>
) -> &mut Self { ... }
fn polyline(
&mut self,
points: impl IntoIterator<Item = impl Into<Point>>,
close: bool
) -> &mut Self { ... }
fn rect(
&mut self,
x: impl Into<f64>,
y: impl Into<f64>,
w: impl Into<f64>,
h: impl Into<f64>
) -> &mut Self { ... }
fn rounded_rect(
&mut self,
x: impl Into<f64>,
y: impl Into<f64>,
w: impl Into<f64>,
h: impl Into<f64>,
tl: impl Into<f64>,
tr: impl Into<f64>,
br: impl Into<f64>,
bl: impl Into<f64>
) -> &mut Self { ... }
fn catmull_rom(
&mut self,
points: impl IntoIterator<Item = impl Into<Point>>,
tension: f64
) -> &mut Self { ... }
fn svg_path(&mut self, path: &str) -> Result<&mut Self, SvgParseError> { ... }
}
Required Methods§
fn add_path<T: IntoBezPathTolerance>(&mut self, path: T) -> &mut Self
Provided Methods§
sourcefn cubic_bezier(
&mut self,
x1: impl Into<f64>,
y1: impl Into<f64>,
x2: impl Into<f64>,
y2: impl Into<f64>,
x3: impl Into<f64>,
y3: impl Into<f64>,
x4: impl Into<f64>,
y4: impl Into<f64>
) -> &mut Self
fn cubic_bezier( &mut self, x1: impl Into<f64>, y1: impl Into<f64>, x2: impl Into<f64>, y2: impl Into<f64>, x3: impl Into<f64>, y3: impl Into<f64>, x4: impl Into<f64>, y4: impl Into<f64> ) -> &mut Self
Draw a cubic Bézier curve from (x1
, y1
) to (x4
, y4
) with control points at (x2
,
y2
) and (x3
, y3
).
sourcefn quadratic_bezier(
&mut self,
x1: impl Into<f64>,
y1: impl Into<f64>,
x2: impl Into<f64>,
y2: impl Into<f64>,
x3: impl Into<f64>,
y3: impl Into<f64>
) -> &mut Self
fn quadratic_bezier( &mut self, x1: impl Into<f64>, y1: impl Into<f64>, x2: impl Into<f64>, y2: impl Into<f64>, x3: impl Into<f64>, y3: impl Into<f64> ) -> &mut Self
Draw a quadratic Bézier curve from (x1
, y1
) to (x3
, y3
) with control point at (x2
,
y2
).
sourcefn arc(
&mut self,
x: impl Into<f64>,
y: impl Into<f64>,
rx: impl Into<f64>,
ry: impl Into<f64>,
start: f64,
sweep: f64,
x_rot: f64
) -> &mut Self
fn arc( &mut self, x: impl Into<f64>, y: impl Into<f64>, rx: impl Into<f64>, ry: impl Into<f64>, start: f64, sweep: f64, x_rot: f64 ) -> &mut Self
Draw an elliptical arc centered on (x
, y
) with radii rx
and ry
. The arc starts at
start
and sweeps sweep
radians. x_rot
is the rotation of the ellipse in radians.
sourcefn circle(
&mut self,
x: impl Into<f64>,
y: impl Into<f64>,
r: impl Into<f64>
) -> &mut Self
fn circle( &mut self, x: impl Into<f64>, y: impl Into<f64>, r: impl Into<f64> ) -> &mut Self
Draw a circle centered on (x
, y
) with radius r
.
sourcefn ellipse(
&mut self,
x: impl Into<f64>,
y: impl Into<f64>,
rx: impl Into<f64>,
ry: impl Into<f64>,
x_rot: f64
) -> &mut Self
fn ellipse( &mut self, x: impl Into<f64>, y: impl Into<f64>, rx: impl Into<f64>, ry: impl Into<f64>, x_rot: f64 ) -> &mut Self
Draw an ellipse centered on (x
, y
) with radii rx
and ry
. x_rot
is the rotation of
the ellipse in radians.
sourcefn line(
&mut self,
x1: impl Into<f64>,
y1: impl Into<f64>,
x2: impl Into<f64>,
y2: impl Into<f64>
) -> &mut Self
fn line( &mut self, x1: impl Into<f64>, y1: impl Into<f64>, x2: impl Into<f64>, y2: impl Into<f64> ) -> &mut Self
Draw a line from (x1
, y1
) to (x2
, y2
).
sourcefn polyline(
&mut self,
points: impl IntoIterator<Item = impl Into<Point>>,
close: bool
) -> &mut Self
fn polyline( &mut self, points: impl IntoIterator<Item = impl Into<Point>>, close: bool ) -> &mut Self
Draw a polyline from a sequence of points, optionally closing it.
sourcefn rect(
&mut self,
x: impl Into<f64>,
y: impl Into<f64>,
w: impl Into<f64>,
h: impl Into<f64>
) -> &mut Self
fn rect( &mut self, x: impl Into<f64>, y: impl Into<f64>, w: impl Into<f64>, h: impl Into<f64> ) -> &mut Self
Draw a rectangle centered on (x
, y
) with width w
and height h
.
sourcefn rounded_rect(
&mut self,
x: impl Into<f64>,
y: impl Into<f64>,
w: impl Into<f64>,
h: impl Into<f64>,
tl: impl Into<f64>,
tr: impl Into<f64>,
br: impl Into<f64>,
bl: impl Into<f64>
) -> &mut Self
fn rounded_rect( &mut self, x: impl Into<f64>, y: impl Into<f64>, w: impl Into<f64>, h: impl Into<f64>, tl: impl Into<f64>, tr: impl Into<f64>, br: impl Into<f64>, bl: impl Into<f64> ) -> &mut Self
Draw a rounded rectangle centered on (x
, y
) with width w
and height h
. The corners
are rounded with radii tl
, tr
, br
, bl
.
sourcefn catmull_rom(
&mut self,
points: impl IntoIterator<Item = impl Into<Point>>,
tension: f64
) -> &mut Self
fn catmull_rom( &mut self, points: impl IntoIterator<Item = impl Into<Point>>, tension: f64 ) -> &mut Self
Draw a Catmull-Rom spline from a sequence of points and a tension parameter.
See crate::CatmullRom
for more information.