fix: brighten capture flash overlay

This commit is contained in:
2026-11-13 00:36:25 +01:00
parent 4fb2ad7757
commit c28428a2f3

View File

@@ -53,7 +53,7 @@ impl Sequence {
countdown: (3 - elapsed as i32).clamp(1, 3), countdown: (3 - elapsed as i32).clamp(1, 3),
// The monitor lights the room: hold white illumination until // The monitor lights the room: hold white illumination until
// the clean frame is captured and queued after the countdown. // the clean frame is captured and queued after the countdown.
flash_opacity: 0.75, flash_opacity: 0.95,
awaiting_release: false, awaiting_release: false,
} }
} }
@@ -230,19 +230,19 @@ mod tests {
assert!(!sequence.tick(true, true, start)); assert!(!sequence.tick(true, true, start));
assert!(!sequence.tracking()); assert!(!sequence.tracking());
assert_eq!(sequence.presentation(start).countdown, 3); assert_eq!(sequence.presentation(start).countdown, 3);
assert_eq!(sequence.presentation(start).flash_opacity, 0.75); assert_eq!(sequence.presentation(start).flash_opacity, 0.95);
assert_eq!( assert_eq!(
sequence sequence
.presentation(start + Duration::from_millis(200)) .presentation(start + Duration::from_millis(200))
.flash_opacity, .flash_opacity,
0.75 0.95
); );
for (ms, number) in [(999, 3), (1000, 2), (1999, 2), (2000, 1), (2999, 1)] { for (ms, number) in [(999, 3), (1000, 2), (1999, 2), (2000, 1), (2999, 1)] {
let now = start + Duration::from_millis(ms); let now = start + Duration::from_millis(ms);
// Lowering the hand must not cancel an already-started countdown. // Lowering the hand must not cancel an already-started countdown.
assert!(!sequence.tick(false, false, now)); assert!(!sequence.tick(false, false, now));
assert_eq!(sequence.presentation(now).countdown, number); assert_eq!(sequence.presentation(now).countdown, number);
assert_eq!(sequence.presentation(now).flash_opacity, 0.75); assert_eq!(sequence.presentation(now).flash_opacity, 0.95);
} }
assert!(sequence.tick(true, true, start + Duration::from_secs(3))); assert!(sequence.tick(true, true, start + Duration::from_secs(3)));
assert!( assert!(