Trait composable::views::Output

source ·
pub trait Output: Sized {
    // Required methods
    fn begin(&mut self, x: f32, y: f32, rgba: [u8; 4], transform: &Transform);
    fn line_to(&mut self, x: f32, y: f32);
    fn quadratic_bezier_to(&mut self, x1: f32, y1: f32, x: f32, y: f32);
    fn cubic_bezier_to(
        &mut self,
        x1: f32,
        y1: f32,
        x2: f32,
        y2: f32,
        x: f32,
        y: f32,
    );
    fn close(&mut self);
}
Available on crate features unstable and views only.
Expand description

A surface, or file format, that views may be rendered to.

Required Methods§

source

fn begin(&mut self, x: f32, y: f32, rgba: [u8; 4], transform: &Transform)

Begins a new path.

The path should be continued with a series of line_to, quadratic_bezier_to, and/or cubic_bezier_to calls and ended with a call to close.

source

fn line_to(&mut self, x: f32, y: f32)

Adds a line to the current path.

source

fn quadratic_bezier_to(&mut self, x1: f32, y1: f32, x: f32, y: f32)

Adds a quadratic Bézier to the current path.

(x1, y1) represents the Bézier control point.

source

fn cubic_bezier_to( &mut self, x1: f32, y1: f32, x2: f32, y2: f32, x: f32, y: f32, )

Adds a cubic Bézier to the current path.

(x1, y1) and (x2, y2) represent the Bézier control points.

source

fn close(&mut self)

Closes the current path.

Once this method has been called there is no current path until begin is called again.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl Output for composable::views::gpu::Output

source§

impl Output for composable::views::svg::Output