This class implements a simple history for previous pixel transitions (a sliding window of pixel tran...
Definition TransitionHistory.h:32
static constexpr int defaultDeltaThreshold()
Returns the default intensity threshold between two successive pixels to count as a transition from b...
Definition TransitionHistory.h:107
static bool isTransitionToBlack(const uint8_t *pixel, TransitionHistory &history, const int deltaThreshold=defaultDeltaThreshold())
Checks whether the given pixel is a transition-to-black pixel (whether the direct left neighbor is a ...
int history1() const
Returns the history with window size 1.
int history2() const
Returns the history with window size 2.
static bool isTransitionToWhite(const uint8_t *pixel, TransitionHistory &history, const int deltaThreshold=defaultDeltaThreshold())
Checks whether the given pixel is a transition-to-white pixel (whether the direct left neighbor is a ...
void push(const int newDelta)
Adds a new intensity difference (delta) as the most recent history entry.
void reset()
Resets the history object to its initial state (all deltas set to zero).
int history3() const
Returns the history with window size 3.
TransitionHistory()=default
Creates a new history object.