-
Notifications
You must be signed in to change notification settings - Fork 13
brain_render_worker.py
Vicious Squid edited this page Apr 3, 2026
·
6 revisions
Not to be confused with brain_worker.py
An offscreen rendering engine running in its own QThread that paints the entire brain visualization to a QImage buffer. The main thread simply blits this cached image during paintEvent, dramatically improving UI responsiveness. The worker receives immutable state snapshots and handles all the complex drawing logic—connections with animated pulses, neurons with various shapes, localized labels, and visual effects for learning events.
- Immutable snapshot containing positions, states, colors, weights, and animation parameters
- Created on main thread via
create_render_state_from_widget()helper - Includes pre-calculated localized neuron labels to avoid i18n lookups during render
request_render(state) — throttled to 10 FPS (is all we need)
- Draws and animates neurons and connections
🦑 Raise digital squids whose brains grow & rewire themselves through Hebbian learning and Neurogenesis