pub struct ModelerParams {
pub wobble_smoother_timeout: f64,
pub wobble_smoother_speed_floor: f64,
pub wobble_smoother_speed_ceiling: f64,
pub position_modeler_spring_mass_constant: f64,
pub position_modeler_drag_constant: f64,
pub sampling_min_output_rate: f64,
pub sampling_end_of_stroke_stopping_distance: f64,
pub sampling_end_of_stroke_max_iterations: usize,
pub sampling_max_outputs_per_call: usize,
pub stylus_state_modeler_max_input_samples: usize,
}
Expand description
all parameters for the modeler
Fields§
§wobble_smoother_timeout: f64
these parameters are used to apply smoothing to the input to reduce wobble in the prediction
The length of the window over which the moving average of speed and position is calculated
Check if this can’t be done with the rust time types as this probably comes from a conversion to float (DURATION)
A good starting point is Should be positive
wobble_smoother_speed_floor: f64
The range of speed considered for wobble smoothing. At ModelerParams::wobble_smoother_speed_floor the maximum amount of smoothing is applied. At ModelerParams::wobble_smoother_speed_ceiling, no smoothing is applied
Good starting points are 2 - 3 % of the expected speed of the inputs Should be positive and the speed floor smaller than the ceiling
wobble_smoother_speed_ceiling: f64
§position_modeler_spring_mass_constant: f64
The mass of the “weight” being pulled along the path, multiplied by the spring constant.
Should be positive
position_modeler_drag_constant: f64
The ratio of the pen’s velocity that is subtracted from the pen’s acceleration per unit time, to simulate drag.
Should be positive
sampling_min_output_rate: f64
The minimum number of modeled inputs to output per unit time. If inputs are received at a lower rate, they will be upsampled to produce output of atleast ModelerParams::sampling_min_output_rate. If inputs are received at a higher rate, the output rate will match the input rate.
Should be positive
sampling_end_of_stroke_stopping_distance: f64
This determines the stop condition for the end-of-stroke modeling If the position is within this distance of the final raw input, or if the last update iteration moved less than this distance, it stops iterating.
this should be a small distance, good heuristic is 2-3 orders of magnitude smaller than the expected distance between input points
Should be positive
sampling_end_of_stroke_max_iterations: usize
The maximum number of iterations to perform at the end of the stroke,
if it does not stop due to the constraint of the sampling_end_of_stroke_stopping_distance
Should be positive and is capped at 1000 (to limit the memory requirements)
sampling_max_outputs_per_call: usize
Maximum number of outputs to generate per call to Update or Predict. related to issues if input events are received with too long of a delay See what’s done in the rnote call and on this end to limit things like this
Should be strictly positive
stylus_state_modeler_max_input_samples: usize
the maximum number of raw inputs to look at when searching for the nearest states when interpolating
Should be strictly positive
Implementations§
source§impl ModelerParams
impl ModelerParams
sourcepub fn suggested() -> Self
pub fn suggested() -> Self
ModelerParams::wobble_smoother_timeout : 0.04,
ModelerParams::wobble_smoother_speed_floor : 1.31,
ModelerParams::wobble_smoother_speed_ceiling : 1.44,
ModelerParams::position_modeler_spring_mass_constant : 11.0 / 32400.0,
ModelerParams::position_modeler_drag_constant : 72.0,
ModelerParams::sampling_min_output_rate : 180.0,
ModelerParams::sampling_end_of_stroke_stopping_distance : 0.001,
ModelerParams::sampling_end_of_stroke_max_iterations : 20,
ModelerParams::sampling_max_outputs_per_call : 20,
ModelerParams::stylus_state_modeler_max_input_samples : 10,
Trait Implementations§
source§impl Clone for ModelerParams
impl Clone for ModelerParams
source§fn clone(&self) -> ModelerParams
fn clone(&self) -> ModelerParams
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ModelerParams
impl Debug for ModelerParams
source§impl PartialEq for ModelerParams
impl PartialEq for ModelerParams
source§impl PartialOrd for ModelerParams
impl PartialOrd for ModelerParams
impl Copy for ModelerParams
impl StructuralPartialEq for ModelerParams
Auto Trait Implementations§
impl Freeze for ModelerParams
impl RefUnwindSafe for ModelerParams
impl Send for ModelerParams
impl Sync for ModelerParams
impl Unpin for ModelerParams
impl UnwindSafe for ModelerParams
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)