Skip to main content

StabilityMask

Struct StabilityMask 

Source
pub struct StabilityMask { /* private fields */ }
Expand description

Temporal stability mask: keeps only blocks that are stable over recent ticks yet novel versus a longer-term baseline — isolating newly-appeared static overlays (tooltips) from moving gameplay and permanent HUD. Suppressed blocks render black; kept blocks pass through byte-identical. See the design spec for the algebra.

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

Consecutive stable ticks before a block counts as stable (default 6).

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

Baseline EMA horizon in ticks (default 100).

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 (default 1) — keeps glyphs off the fill boundary and closes holes inside kept clusters.

Source

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

Stability comparison tolerance on the 0-255 luma signature (default 4).

Source

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

Novelty threshold versus the baseline (default 25).

Source

pub fn debug_sink(self, sink: impl DebugSink) -> Self

Attach a debug tap (e.g. PngDump) receiving per-tick Input/Baseline/Overlay/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