Give the image overlay an optional shadow or glow

A blurred copy of the overlay's own alpha is drawn in a colour beneath it:
moved by an offset for a shadow, centred for a glow, with a size, a spread
and an opacity. The mask is integer-only so a seed still reproduces it, and
reaches past the canvas so an image lying off it still casts onto it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Si
2026-09-24 00:56:27 +02:00
co-authored by Claude Opus 5.5
parent 7d122ddd6c
commit 9fb4428a3b
3 changed files with 198 additions and 4 deletions
+4 -2
View File
@@ -11,7 +11,8 @@ namespace effector {
// Lays one picture from disk over its input: a logo, a texture, a frame. The
// overlay is fitted to the canvas in the chosen way, placed from the top left
// or from the centre, nudged by an offset and mixed in by its opacity. Like the
// or from the centre, nudged by an offset and mixed in by its opacity, with a
// soft shadow or glow cut from its own outline beneath it if asked. Like the
// blur it needs no source images of its own, so it can lead a chain; given
// sources it fills the canvas from a randomly chosen one first.
class OverlayEffect : public Effect {
@@ -20,7 +21,8 @@ public:
std::string title() const override { return "Image overlay"; }
std::string description() const override {
return "Lays a single image from disk over its input, fitted to the canvas, centred or "
"not, nudged by an offset and mixed in by its opacity.";
"not, nudged by an offset and mixed in by its opacity, optionally with a shadow or "
"a glow around it.";
}
const std::vector<ParamSpec>& params() const override;
bool needsSources() const override { return false; }