pub struct StabilityMask { /* private fields */ }Expand description
Temporal stability mask: passes through only newly-appeared, now-static overlays (item tooltips, dialogs); moving gameplay and the permanent scene render black. Kept blocks are byte-identical to the input. Tick it fast (5–10 Hz): the frame-diff gate downstream keeps detector cost unchanged while nothing changes.
Implementations§
Source§impl StabilityMask
impl StabilityMask
pub fn new() -> Self
Sourcepub fn block_size(self, px: u32) -> Self
pub fn block_size(self, px: u32) -> Self
Analysis block size in pixels (default 16).
Sourcepub fn stable_ticks(self, k: u32) -> Self
pub fn stable_ticks(self, k: u32) -> Self
K: consecutive stable ticks before a block counts as settled (default 6). Holdover (2K) and the long-run threshold (3K) derive from this unless set explicitly.
Sourcepub fn stable_for(self, rate: Rate, duration: Duration) -> Self
pub fn stable_for(self, rate: Rate, duration: Duration) -> Self
Duration form of Self::stable_ticks; converted via the watcher’s
rate (tick-based internals keep paused-time tests deterministic).
Sourcepub fn baseline_ticks(self, t: u32) -> Self
pub fn baseline_ticks(self, t: u32) -> Self
T: baseline EMA horizon in ticks (default 100). The EMA only runs while a block is idle and unfrozen; scene changes re-seed instantly.
Sourcepub fn baseline(self, rate: Rate, duration: Duration) -> Self
pub fn baseline(self, rate: Rate, duration: Duration) -> Self
Duration form of Self::baseline_ticks.
Sourcepub fn dilate(self, rings: u32) -> Self
pub fn dilate(self, rings: u32) -> Self
Keep-mask dilation rings applied after the component pass (default 1) — keeps glyphs off the fill boundary.
Sourcepub fn signature_tolerance(self, tol: u8) -> Self
pub fn signature_tolerance(self, tol: u8) -> Self
Per-component movement tolerance on the signature vote (default 10).
Sourcepub fn baseline_threshold(self, thr: u8) -> Self
pub fn baseline_threshold(self, thr: u8) -> Self
Per-sub-mean novelty threshold on the baseline vote (default 18).
Sourcepub fn contrast_threshold(self, thr: u8) -> Self
pub fn contrast_threshold(self, thr: u8) -> Self
Contrast-byte novelty threshold (default 14) — the dark-on-dark discriminator: a flat panel over textured scene is novel even at identical mean luma.
Sourcepub fn scene_threshold(self, frac: f32) -> Self
pub fn scene_threshold(self, frac: f32) -> Self
Fraction of the frame that must perturb in one tick to count as a scene transition (default 0.65). Settling blocks then adopt the new scene instead of becoming “kept”.
Sourcepub fn fill_components(self, on: bool) -> Self
pub fn fill_components(self, on: bool) -> Self
Component pass (default on): drop kept components smaller than
Self::min_component, fill each survivor’s bounding box. Off =
v1-style morphological close.
Sourcepub fn min_component(self, blocks: usize) -> Self
pub fn min_component(self, blocks: usize) -> Self
Minimum kept-component size in blocks (default 4); smaller components are treated as speckle and dropped.
Sourcepub fn holdover_ticks(self, h: u32) -> Self
pub fn holdover_ticks(self, h: u32) -> Self
H: ticks a kept block keeps rendering after its content starts changing (default 2×stable_ticks) — the anti-patchwork hysteresis.
Sourcepub fn debug_sink(self, sink: impl DebugSink) -> Self
pub fn debug_sink(self, sink: impl DebugSink) -> Self
Attach a debug tap (e.g. PngDump) receiving
per-tick Input/Baseline/Overlay/State/Output frames. Composable —
multiple sinks allowed. Stage frames are only materialized when at
least one sink is attached.