pub struct Stroke {
pub typ: String,
pub meta: HashMap<String, Value>,
pub x: Vec<f64>,
pub y: Vec<f64>,
pub timestamp: Vec<u64>,
pub pressure: Vec<f64>,
}Fields§
§typ: String§meta: HashMap<String, Value>§x: Vec<f64>§y: Vec<f64>§timestamp: Vec<u64>§pressure: Vec<f64>Implementations§
Source§impl Stroke
impl Stroke
pub fn new( x: Vec<f64>, y: Vec<f64>, timestamp: Vec<u64>, pressure: Vec<f64>, ) -> Stroke
pub fn x(&self) -> &Vec<f64>
pub fn y(&self) -> &Vec<f64>
pub fn timestamp(&self) -> &Vec<u64>
pub fn pressure(&self) -> &Vec<f64>
pub fn x_min(&self) -> f64
pub fn x_max(&self) -> f64
pub fn y_min(&self) -> f64
pub fn y_max(&self) -> f64
pub fn timestamp_min(&self) -> u64
pub fn timestamp_max(&self) -> u64
pub fn pressure_min(&self) -> f64
pub fn pressure_max(&self) -> f64
pub fn len(&self) -> usize
Sourcepub fn offset(&mut self, x_offset: Option<f64>, y_offset: Option<f64>)
pub fn offset(&mut self, x_offset: Option<f64>, y_offset: Option<f64>)
Offset the x/y coordinates by a given offset
Sourcepub fn scale(&mut self, x_factor: Option<f64>, y_factor: Option<f64>)
pub fn scale(&mut self, x_factor: Option<f64>, y_factor: Option<f64>)
Scale the x/y coordinates by a given factor
Sourcepub fn remove_duplicate_dots(&mut self)
pub fn remove_duplicate_dots(&mut self)
Removes successive dots with same coordinates
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Stroke
impl<'de> Deserialize<'de> for Stroke
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Stroke
Auto Trait Implementations§
impl Freeze for Stroke
impl RefUnwindSafe for Stroke
impl Send for Stroke
impl Sync 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