pub struct Bspline { /* private fields */ }Expand description
Bicubic spline interpolator.
Use init() or the point-by-point API (init_num, add_point, prepare)
to set up data, then get() or get_stateful() to evaluate.
Port of C++ agg::bspline.
Implementations§
Source§impl Bspline
impl Bspline
Sourcepub fn new_with_points(x: &[f64], y: &[f64]) -> Self
pub fn new_with_points(x: &[f64], y: &[f64]) -> Self
Create and initialize from arrays.
Sourcepub fn add_point(&mut self, x: f64, y: f64)
pub fn add_point(&mut self, x: f64, y: f64)
Add a data point (call after init_num, before prepare).
Sourcepub fn get_stateful(&self, x: f64) -> f64
pub fn get_stateful(&self, x: f64) -> f64
Evaluate the spline at x with cached index (faster for sequential access).
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Bspline
impl !RefUnwindSafe for Bspline
impl Send for Bspline
impl !Sync for Bspline
impl Unpin for Bspline
impl UnwindSafe for Bspline
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