carnelian::render::generic

Trait PathBuilder

Source
pub trait PathBuilder<B: Backend> {
    // Required methods
    fn move_to(&mut self, point: Point) -> &mut Self;
    fn line_to(&mut self, point: Point) -> &mut Self;
    fn quad_to(&mut self, p1: Point, p2: Point) -> &mut Self;
    fn cubic_to(&mut self, p1: Point, p2: Point, p3: Point) -> &mut Self;
    fn rat_quad_to(&mut self, p1: Point, p2: Point, w: f32) -> &mut Self;
    fn rat_cubic_to(
        &mut self,
        p1: Point,
        p2: Point,
        p3: Point,
        w1: f32,
        w2: f32,
    ) -> &mut Self;
    fn build(self) -> B::Path;
}
Expand description

Builds one closed path.

Required Methods§

Source

fn move_to(&mut self, point: Point) -> &mut Self

Move end-point to.

Source

fn line_to(&mut self, point: Point) -> &mut Self

Create line from end-point to point and update end-point.

Source

fn quad_to(&mut self, p1: Point, p2: Point) -> &mut Self

Create quadratic Bézier from end-point to p2 with p1 as control point.

Source

fn cubic_to(&mut self, p1: Point, p2: Point, p3: Point) -> &mut Self

Create cubic Bézier from end-point to p3 with p1 and p2 as control points.

Source

fn rat_quad_to(&mut self, p1: Point, p2: Point, w: f32) -> &mut Self

Create rational quadratic Bézier from end-point to p2 with p1 as control point and w as its weight.

Source

fn rat_cubic_to( &mut self, p1: Point, p2: Point, p3: Point, w1: f32, w2: f32, ) -> &mut Self

Create rational cubic Bézier from end-point to p3 with p1 and p2 as control points, and w1 and w2 their weights.

Source

fn build(self) -> B::Path

Closes the path with a line if not yet closed and builds the path.

Consumes the builder; another one can be requested from the Context.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§