FrameUnreliability
pub struct FrameUnreliability(u32);
Why a frame is not a measurement: the reasons behind
thermal_data_reliable, one bit each. Added in 12.0.45.
The rule is exact: thermal_data_reliable is true exactly when
this is FrameUnreliability::NONE. Several reasons can hold at
once, and every one that holds is set. Read them to treat them
differently, for example to show the temperatures of a frame
withheld only because the detector is still settling:
# fn show(_: &optris_sdk::OwnedFrame) {}
# fn f(frame: &optris_sdk::OwnedFrame) -> optris_sdk::Result<()> {
use optris_sdk::FrameUnreliability;
let why = frame.unreliability()?;
if why == FrameUnreliability::NONE || why == FrameUnreliability::DETECTOR_SETTLING {
show(frame);
}
# Ok(())
# }
FrameUnreliability::UNKNOWN is not a reason: the source cannot
say which reasons held, for example a recording or a still written
by SDK 12.0.44 or earlier. thermal_data_reliable is still the
frame's own answer then. A repeated frame carries the reasons of the
frame whose pixels it repeats as well as its own.
FrameUnreliability — methods
pub const fn bits(self) -> u32
The bits, as the C ABI spells them.
pub const fn from_bits(bits: u32) -> Self
The set these bits name. Bits this SDK does not know are kept, so a value read from a newer SDK's file is not silently narrowed.
pub const fn contains(self, other: Self) -> bool
Whether every reason in other is in this set.
pub const fn is_none(self) -> bool
Whether the frame is a measurement: no reason at all, and not
FrameUnreliability::UNKNOWN.