This repository was archived by the owner on Sep 11, 2024. It is now read-only.
Window blur#55
Draft
byteduck wants to merge 4 commits into
Draft
Conversation
Owner
Author
|
I made it so that if an area touching a blurred window needs to be redrawn, the entire blurred window is redrawn. Obviously, this is far from ideal. Really, we'd want to redraw as little as possible. I tried an approach with using a hidden buffer to store the unblurred contents behind the window so that partial redraws are possible without "double-blurring", but, I feel like that's a little memory intensive. What's the best tradeoff here - keeping a whole new buffer for each window, or incurring some extra performance cost? |
921327b to
273f039
Compare
Work in progress. Adds a new window hint to blur contents behind a window. It currently uses an approximated gaussian blur by applying 3 passes of a box blur. There are currently a few visual artifacts (such as when moving the cursor around a blurred window) due to the way partial redraws work.
The blur algorithm had an error in the indexing for the vertical component of the blur and an error in the sliding window logic.
273f039 to
b646857
Compare
1e13d14 to
6f9f442
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These changes allow windows to apply blur to whatever is behind them via a new window hint. There are currently visual artifacts (such as when moving the cursor by a blurred window) that need to be ironed out, due to the way partial redraws of the display work (essentially, when only part of a blurred window is redrawn, it samples the already-blurred area that's not being redrawn, resulting in a weird double-blur).
The blur is currently done by applying multiple passes of a box blur to approximate a gaussian blur, but if anyone has suggestions for a faster algorithm I'm all ears.
Here's what it currently looks like (The opacity of the terminal background is lower than it will be in the final version to show off the blur):
