Expand description
Box shadow via separable 1-D Gaussian blur with a kernel cache. Box-shadow via separable 1-D Gaussian blur with a cached kernel.
A drop shadow is rendered by:
- Painting the shadow rectangle at
(rect + offset)in the shadow colour. - Extracting the alpha channel of that rectangle.
- Applying a separable horizontal + vertical Gaussian blur to the alpha.
- Compositing the blurred shadow alpha under the framebuffer content.
All operations are pure Rust — no SIMD, no FFT, no external crates.
Structs§
- Gaussian
Cache - A cache that stores pre-computed Gaussian kernels keyed by blur-radius bits.
Functions§
- box_
shadow - Render a drop (or inset) box shadow for a rectangle
rectintofb. - gaussian_
blur_ alpha - Apply a separable Gaussian blur to the alpha channel of a rectangular
region within
alpha(a flatwidth × heightf32 buffer). - gaussian_
kernel - Compute a normalised 1-D Gaussian kernel with
sigma = blur_radius / 2.