Expand description
Drop shadow filter implementation.
This implements the feDropShadow primitive from SVG Filter Effects 2. The drop shadow effect is a shorthand for a commonly used sequence of filter operations:
- Extract alpha channel
- Offset the alpha
- Blur the offset alpha
- Composite shadow color with blurred alpha
- Composite shadow with original graphic
@see https://drafts.fxtf.org/filter-effects-2/#feDropShadowElement
Functions§
- apply_
drop_ 🔒shadow - Apply drop shadow effect.
- compose_
src_ 🔒over - Composite two pixels using Porter-Duff “source over” operator.
- norm_
to_ 🔒u8 - Convert a normalized f32 (0.0-1.0) to u8 color component (0-255).
- src_
over_ 🔒channel - Blend a single channel using Porter-Duff “source over” operator.
- u8_
to_ 🔒norm - Convert a u8 color component (0-255) to normalized f32 (0.0-1.0).
- write_
colored_ 🔒shadow - Apply the shadow color and optionally composite with the original.