pub struct Density { /* private fields */ }Expand description
Implementations§
Source§impl Density
impl Density
Sourcepub fn dot_size(&self) -> Size
pub fn dot_size(&self) -> Size
Buffer dimensions in dots, as Dots::dot_size.
Sourcepub fn resize(&mut self, cells: Size)
pub fn resize(&mut self, cells: Size)
Resize to cells and zero. Reuses the buffer unless it must grow.
Sourcepub fn decay(&mut self, k: f32)
pub fn decay(&mut self, k: f32)
Multiply every value by k, clamped to [0, 1] (NaN leaves the buffer as is):
an exponential fade, k = exp(−dt / τ) per step.
Sourcepub fn deposit(&mut self, x: f64, y: f64, w: f32)
pub fn deposit(&mut self, x: f64, y: f64, w: f32)
Add w at the dot nearest to (x, y) (dot units). Non-finite coordinates or
weights and off-buffer dots are ignored.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Density
impl Freeze for Density
impl Move for Density
impl RefUnwindSafe for Density
impl Send for Density
impl Sync for Density
impl Unpin for Density
impl UnsafeUnpin for Density
impl UnwindSafe for Density
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