Skip to content
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

Implement rudimentary gaussian blur #82

Merged
merged 5 commits into from
Sep 10, 2021
Merged

Conversation

weisJ
Copy link
Contributor

@weisJ weisJ commented Aug 26, 2021

This implements a rudimentary gaussian blur filter.

Because filters like mask need to facilitate painting to an off-screen buffer,
we extract the logic for this into a separate class outside of Mask.
Then the size of the buffer is first adjusted to suit the installed filters.
After applying the filters the mask is painted as usual.
Notably this implementation currently doesn't support any filter specific
attributes such as 'in', 'feOffset', 'feMergeMode' etc.

This implementation is capable of rendering the logo from #44, though it isn't particularly fast.

This PR includes the commit from #81, as it was necessary for the logo in #44 to load correctly.

weisJ added 5 commits August 26, 2021 14:32
Replace the regex based path parser with a simpler version.
Because filters like mask need to facilitate painting to an off-screen buffer,
we extract the logic for this into a separate class outside of Mask.
Then the size of the buffer is first adjusted to suit the installed filters.
After applying the filters the mask is painted as usual.
Notably this implementation currently doesn't support any filter specific
attributes such as 'in', 'feOffset', 'feMergeMode' etc.
This doesn't yet do the recommended optimization for standard deviations larger
than 2, replacing the gaussian kernel by successive box blurs.
If the diagram is painted to a JComponent make it available s.t. it can be used
as the ImageObserver, when painting images. Otherwise they may not be fully loaded
when painting.
This avoids unnecessary calculations when presenting the svg in a GUI.
We only do this if we are painting to a component as it wastes memory otherwise.
@blackears blackears merged commit 03c610d into blackears:master Sep 10, 2021
@blackears
Copy link
Owner

Thanks for your contributions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants