pub struct Glow { /* private fields */ }Expand description
A long-exposure f32 buffer at Pixels resolution, w × 2·h (CORE-R85): points
splat weight into it by their Dots position, decay
fades it, and scenes tone-map it themselves through values and
Tone::level. A soft glow under a point cloud or an event display, at an eighth of a
Density’s memory (one value per pixel instead of per dot).
Implementations§
Source§impl Glow
impl Glow
Sourcepub fn pixel_size(&self) -> Size
pub fn pixel_size(&self) -> Size
Buffer dimensions in pixels, as Pixels::pixel_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 splat(&mut self, x: f64, y: f64, kernel: &[(i32, i32, f32)], scale: f32)
pub fn splat(&mut self, x: f64, y: f64, kernel: &[(i32, i32, f32)], scale: f32)
Add scale · w to pixel (px + dx, py + dy) for each (dx, dy, w) of kernel,
where (px, py) is the pixel holding dot (x, y) (dot units, rounded to the
nearest dot; a pixel is 2 × 2 dots). Non-finite coordinates or weights and
off-buffer pixels are ignored.
Sourcepub fn splat_bilinear(&mut self, x: f64, y: f64, w: f32)
pub fn splat_bilinear(&mut self, x: f64, y: f64, w: f32)
Add w at continuous pixel position (x, y) (integers are pixel centres; the
centre of the pixel holding dot (dx, dy) is ((dx − 0.5)/2, (dy − 0.5)/2)),
split bilinearly over the four nearest pixels (CORE-R92). Motion below a pixel stays
smooth and a moving source leaves no nearest-pixel stair steps; the in-bounds share
of w is conserved. Non-finite input and off-buffer pixels are ignored.