pub struct Stroke { /* private fields */ }Expand description
A finished stroke: the input, the brush, and the geometry generated from the two.
Geometry is organised as one render group per brush coat, each holding one
or more meshes. Ink splits a coat into several meshes when it has more
vertices than a single 16-bit index buffer can address, so a renderer should
loop over mesh_count rather than assume there is one.
Implementations§
Source§impl Stroke
impl Stroke
Sourcepub fn new(brush: &Brush, inputs: &StrokeInputBatch) -> Self
pub fn new(brush: &Brush, inputs: &StrokeInputBatch) -> Self
Generates a stroke from a brush and a complete run of input.
Sourcepub fn from_brush(brush: &Brush) -> Self
pub fn from_brush(brush: &Brush) -> Self
An empty stroke carrying just a brush.
Sourcepub fn input_duration(&self) -> Duration
pub fn input_duration(&self) -> Duration
Total time covered by the stroke’s input.
Sourcepub fn inputs(&self) -> StrokeInputBatch
pub fn inputs(&self) -> StrokeInputBatch
A copy of the input the stroke was generated from.
Sourcepub fn render_group_count(&self) -> u32
pub fn render_group_count(&self) -> u32
Number of render groups, one per brush coat.
Sourcepub fn mesh_count(&self, group_index: u32) -> u32
pub fn mesh_count(&self, group_index: u32) -> u32
Number of meshes in one render group.
Trait Implementations§
Auto Trait Implementations§
impl !Send for Stroke
impl !Sync for Stroke
impl Freeze for Stroke
impl RefUnwindSafe for Stroke
impl Unpin for Stroke
impl UnsafeUnpin for Stroke
impl UnwindSafe for Stroke
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