Skip to main content

StabilityMask

Struct StabilityMask 

Source
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

Source

pub fn new() -> Self

Source

pub fn block_size(self, px: u32) -> Self

Analysis block size in pixels (default 16).

Source

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.

Source

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).

Source

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.

Source

pub fn baseline(self, rate: Rate, duration: Duration) -> Self

Duration form of Self::baseline_ticks.

Source

pub fn dilate(self, rings: u32) -> Self

Keep-mask dilation rings applied after the component pass (default 1) — keeps glyphs off the fill boundary.

Source

pub fn signature_tolerance(self, tol: u8) -> Self

Per-component movement tolerance on the signature vote (default 10).

Source

pub fn baseline_threshold(self, thr: u8) -> Self

Per-sub-mean novelty threshold on the baseline vote (default 18).

Source

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.

Source

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”.

Source

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.

Source

pub fn min_component(self, blocks: usize) -> Self

Minimum kept-component size in blocks (default 4); smaller components are treated as speckle and dropped.

Source

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.

Source

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.

Trait Implementations§

Source§

impl Default for StabilityMask

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Preprocessor for StabilityMask

Source§

fn process(&mut self, view: &FrameView<'_>) -> Result<Arc<Frame>, DetectorError>

Source§

fn set_label(&mut self, label: &str)

Called once at subscribe time with the watcher’s name, so stages with debug output can label their artifacts. Default: ignore.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more