MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
MayaFlux::Kinesis::Discrete::IntervalScanner Class Reference

The two threshold run detector as a stateful object. More...

#include <IntervalScan.hpp>

Collaboration diagram for MayaFlux::Kinesis::Discrete::IntervalScanner:

Public Types

using Interval = std::pair<size_t, size_t>

Public Member Functions

const IntervalScanConfig & config () const noexcept
std::vector< Interval > flush ()
 End the stream: close the open run and release the pending interval.
 IntervalScanner (const IntervalScanConfig &config)
 Construct a scanner.
std::optional< size_t > open_start () const noexcept
 Start of the run in progress after the last score, if one is open.
std::optional< Interval > pending () const noexcept
 The closed interval still waiting for its padded end: its padded start and its end before trailing padding.
std::vector< Interval > push (std::span< const double > scores, std::span< const double > gate={})
 Continue the stream with more scores.
void reset () noexcept
 Start a new stream without releasing anything.

Private Member Functions

void close_run (uint32_t start, uint32_t end, std::vector< Interval > &out)
void reset_gap_state () noexcept
void update_total () noexcept

Private Attributes

uint32_t m_best_dur {}
uint32_t m_best_end {}
IntervalScanConfig m_config
bool m_has_best {}
bool m_has_start {}
uint32_t m_next_start {}
uint32_t m_pend_end {}
uint32_t m_pend_start {}
bool m_pend_valid {}
uint32_t m_prev_end {}
uint32_t m_run_limit {}
uint64_t m_seen {}
uint32_t m_start {}
uint32_t m_temp_end {}
uint32_t m_total {}
bool m_triggered {}

Detailed Description

The two threshold run detector as a stateful object.

Every score depends on the state the previous one left, so scores are read in order, and that state persists between calls: successive push calls continue one stream. The newest interval stays pending until its successor closes, because its padded end depends on the gap that follows; flush releases it and ends the stream. Scores are compared as 32 bit floats, so the intervals match those of the GPU IntervalExtractor for the same scores and settings.

Definition at line 75 of file IntervalScan.hpp.


The documentation for this class was generated from the following files: