Skip to content

feat: Add multithreaded Real-Time Filter Preview#122

Open
PLakhmale wants to merge 2 commits intosumit3203:masterfrom
PLakhmale:master
Open

feat: Add multithreaded Real-Time Filter Preview#122
PLakhmale wants to merge 2 commits intosumit3203:masterfrom
PLakhmale:master

Conversation

@PLakhmale
Copy link
Copy Markdown

Summary

This PR engineers a new threaded infrastructure to support real-time filter previews within the FilterPanel. Previously, modifying a JSpinner or threshold slider forced the user to manually trigger the filter cycle. This introduces a non-blocking UI implementation that applies filters live as the user types or adjusts parameters.

Architecture & Implementation

To prevent the rapid mutation of JSpinner components from freezing the Swing Event Dispatch Thread (EDT) or exhausting system compute resources, I implemented the following architecture:

  • PreviewManager Engine: A centralized thread controller extending SwingWorker<Void, Void>. Backgrounds all heavy 2D convolution matrix runs off the EDT.
  • Event Debouncing: Injected a standard javax.swing.Timer (250ms) into the ChangeListener infrastructure. Rapid spinner clicks do not trigger a filter pass until the user pauses holding the UI component.
  • Non-destructive Cloning: Hardpatched the Gauss2D_Filter_ pipeline to skip physical disk I/O when the filterPath parameter is explicitly null, utilizing ImageProcessor.duplicate() to run math entirely in memory for instant feedback.

GSoC 2026 Context

I engineered this specifically to address the GSoC 2026 Ideas List requirements for the "Real-Time Preview" project track. This PR serves as a functional, structurally complete prototype of my proposed architecture.

If accepted for the summer, my battle-plan is to scale this PreviewManager to seamlessly support multi-slice 3D ImageStacks and systematically patch the applyFilter logic across the remaining 14 filters to handle non-destructive memory-only modes.

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.

1 participant