Add brightness option and run/dry wrapper scripts

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
April John 2026-10-16 14:38:55 +02:00
commit 0ff391bfa1

View file

@ -59,3 +59,12 @@ def test_udp_loopback():
tx = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
tx.sendto(t.BLACK_FRAME, rx.getsockname())
assert rx.recv(2048) == t.BLACK_FRAME
def test_brightness_scales_and_clamps():
px = np.array([[1.0, 0.5, 0.25, 1.0]] + [[0, 0, 0, 0]] * 15)
half = t.to_rgbw(px, "extract", 50)[0]
np.testing.assert_allclose(half, [0.375, 0.125, 0.0, 0.125])
assert t.to_rgbw(px, "extract", 0).max() == 0
np.testing.assert_allclose(t.to_rgbw(px, "extract", 500),
t.to_rgbw(px, "extract", 100))