Implement drop shadows using blurring techniques
Opened this issue · 0 comments
Drop shadow is one of the most popular visual effects rendered in modern window systems and compositing window managers. Gaussian blur works by setting the value of each pixel in the active layer or selection to the average of all pixel values within a defined radius. A higher radius value will produce a greater amount of blur. This task aims to create the graphical effect of a visually elevated shape with a shadow underneath the window frame, managed by the built-in window management system. In other words, an additional operation redirects all windows to offscreen pixmaps and tracks when painting occurs on those offscreen pixmaps, adding the drop shadow effect.
(An experimental popup modifier theme that incorporates blurring, alpha blending, gradients, and a drop shadow, taken from PicoGUI.)
The stack blur algorithm was invented by Mario Klingemann. Compared to Mario's original source code, the lookup table in lasem has been removed as the benefit doesn't justify the memory usage in cases of large radii. See also:
- Implementing Mario’s Stack Blur 15 times in C++ / Hacker News
- The Dart library for blurring images with the Stack blur algorithm
- Add StackBlur for imgproc
Expected Outcome:
A polished drop shadow effect that enhances the window rendering of Mado, with minimal performance overhead and flexibility to customize the appearance.
Reference implementations: