-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the Gaussian function to blur a pixmap #58
base: main
Are you sure you want to change the base?
Conversation
61764af
to
94f960d
Compare
The idea behind #34 is to implement drop shadow, one of the most popular visual effects in modern window systems and compositing window managers. The effect should be applied at the window management level, not to background images, meaning the background image should not be blurred. The graphical effect of a visually elevated shape with a shadow underneath the window frame should occur transparently. |
Because I'm still unsure where to place the blur operation, whether to implement the blur in '_twin_widget_queue_paint()', as this function handles the rendering order of each widget object. It would need to read the corresponding pixel block currently on the screen during rendering to blur the current background. Or should I implement this operation when each widget's TwinEventPaint occurs? So I first try to implement this function on the background to see its effect. |
Alternatively, you can write an image viewer with drop shadow functionality to evaluate performance and visual effects in the initial stage. Once you have a better understanding of the window manager events and their flow, we can proceed with integrating it into the window system. See MDN: drop-shadow |
For performance evaluation, you may consider the code mentioned in #55 (comment) . |
94f960d
to
5dda144
Compare
I haven't applied stack blur to the drop shadow yet, because I don't know how to access the current screen's topmost pixel map. I want to apply the stack blur to a specific region of the topmost pixel map that overlaps with the shadow and then use this as the new shadow. The topmost pixel map is efficiently updated by refreshing only the damaged areas. |
a78fc51
to
3433384
Compare
Compilation error/warning reported by Clang:
|
Add the stack blur function to blur the pixmap that is test on the test window. Add the shadow pixel map under the window which has shadow feature.
3433384
to
dcbefd0
Compare
I am unsure how to validate this. Could you provide the relevant procedures or methods along with the expected behavior? |
Use Pascal's Triangle to approximate a 5x5 Gaussian Kernel, and apply Gaussian blur on the
twin_pixmap_t
to implement the blurring technique.See: #34