Struct scribl_curves::StrokeSeq[][src]

pub struct StrokeSeq { /* fields omitted */ }

A StrokeSeq is a sequence of strokes, each of which is a continuous curve. Each stroke can have its own style (thickness, color, effects). The strokes in a StrokeSeq are non-decreasing in time: one stroke ends before another begins.

Implementations

impl StrokeSeq[src]

pub fn new() -> StrokeSeq[src]

pub fn is_empty(&self) -> bool[src]

pub fn first_time(&self) -> Time[src]

Returns time at which the first segment in the first stroke was drawn. Panics if this sequence is empty.

pub fn last_time(&self) -> Time[src]

Returns time at which the last segment in the last stroke was drawn. Panics if this sequence is empty.

pub fn append_stroke(
    &mut self,
    stroke: StrokeInProgress,
    style: StrokeStyle,
    distance_threshold: f64,
    angle_threshold: f64
)
[src]

Appends a StrokeInProgress to this stroke sequence.

distance_threshold and angle_threshold are parameters that control the simplification and smoothing that we apply to the incoming points.

Panics

Panics if stroke starts before the last existing stroke ends.

pub fn strokes<'a>(&'a self) -> impl Iterator<Item = StrokeRef<'a>> + 'a[src]

Returns an iterator over all the strokes in this sequence.

pub fn render(&self, ctx: &mut impl RenderContext, time: Time)[src]

Renders the part of this stroke sequence that is visible at time time.

Trait Implementations

impl Clone for StrokeSeq[src]

impl Debug for StrokeSeq[src]

impl Default for StrokeSeq[src]

impl<'a> Deserialize<'a> for StrokeSeq[src]

impl From<StrokeSeq> for StrokeSeq[src]

impl Serialize for StrokeSeq[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> RoundFrom<T> for T

impl<T, U> RoundInto<U> for T where
    U: RoundFrom<T>, 

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.