Commit Graph
3 Commits
Author SHA1 Message Date
me0nline f20a6129f6 perf(overlay): replace O(N) Python pixel loop with numpy vectorised premultiply
_premultiply_bgra() was iterating over every RGBA pixel in a pure-Python
for-loop at 60 FPS (144x110 sprite = ~950k iterations/sec).  This was the
primary cause of UI hangs.

New implementation uses numpy:
  - np.frombuffer + reshape to view raw bytes as (H*W, 4) uint8 array
  - Fancy-index column reorder [2,1,0,3] for R,G,B,A -> B,G,R,A in one op
  - float32 alpha / 255 premultiplication via broadcasting
  - tobytes() to emit the final DIB data

Roughly 100x faster than the previous loop, freeing the main thread to
sustain 60 FPS without freezing.
2026-09-08 23:17:10 +02:00
me0nline 4eeb96d5b6 fix(overlay): declare complete 64-bit ctypes prototypes for GDI/User32 2026-09-08 23:05:49 +02:00
me0nline 9bade210f5 feat(overlay): add Win32 32-bit ARGB layered window overlay 2026-09-08 23:05:04 +02:00