RegionState
public readonly struct RegionState
A dense per-frame view of one region, for a display that repaints faster than it wants to walk the model.
RegionState: properties
public int ActiveRuleCount { get; init; }
How many of its rules are alarming.
public AlarmState Alarm { get; init; }
The worst alarm state across this region's rules and its children's.
public uint FrameSequence { get; init; }
Which captured frame these statistics were measured on.
The same number FrameMetadata.Sequence carries for the thermal frame of that moment, so the two can be compared -- which is the point. The SDK delivers a frame to your stream before it runs the measuring pass, so a consumer holding frame N can read a region store that still holds N-1, or N+k once it has fallen behind, which is worse because it looks current. Comparing this against the frame in your hand makes a stale read visible instead of silent.
Meaningless unless RegionState.HasFrame is true.
public TimeSpan FrameTimestamp { get; init; }
When that frame was captured, measured from the camera's start.
The same reading FrameMetadata.Timestamp carries: a monotonic stopwatch, not a date. Order states by RegionState.FrameSequence and measure intervals with this. Meaningless unless RegionState.HasFrame is true.
public bool HasFrame { get; init; }
Whether RegionState.FrameSequence and RegionState.FrameTimestamp name the frame these statistics were measured on.
Read this first. Sequence 0 is a real frame -- the first of the stream -- so no value of RegionState.FrameSequence can mean "nobody said". Same rule, and the same reason, as ImageFrame.HasFrameMetadata.
False before the camera's first measuring pass.
public ulong Id { get; init; }
The region this describes.
public RegionStats Stats { get; init; }
Its measurement for the most recent frame.
public int WarningRuleCount { get; init; }
How many of its rules are in the warning band.