ColorScaleDynamics
public readonly record struct ColorScaleDynamics : IEquatable<ColorScaleDynamics>
How fast the auto-scaled colour range is allowed to move.
Auto-scaling recomputes the range from every frame, and an unfiltered range makes the picture breathe: a soldering iron leaving re-colours the wall behind it in one frame, and on a narrow scene the scale is the sensor noise, so a still wall shimmers. This is the damping that stops that.
In time, not in frames. A per-frame blend factor is a different time constant on every camera (the v11 constant closes 90% of a step in 1.76 s at 32 Hz, 0.71 s at 80 Hz and 0.06 s on a PI 1M), so a saved layout means something different depending on which camera opens it, and an operation-mode change silently retimes it. The SDK re-derives the per-frame blend from the interval it measures between frames.
Applies in every auto scaling mode: ColorScaling.Sigma1, ColorScaling.Sigma3 and ColorScaling.MinMax, which is the default and the one v11 damped.
Out-of-range values are clamped rather than refused: this decides a picture, and a refusal would leave the caller with whatever policy happened to be in force and no way to tell. Read it back to see what was kept.
ColorScaleDynamics.SettleBandKelvin, ColorScaleDynamics.MaxLagKelvin and ColorScaleDynamics.DeadbandKelvin are temperature differences in degrees of the SDK's temperature unit, whatever their names say: kelvin-sized in Celsius, Fahrenheit-sized when Sdk.TemperatureUnit chose Fahrenheit, never offset. What a handle reads back is in the unit in force.
ColorScaleDynamics: properties
public TimeSpan CloseTime { get; init; }
How long the scale takes to close 90% of the way onto a scene that has cooled or narrowed.
TimeSpan.Zero disables damping.
Carried as whole milliseconds: rounded, and never down to zero, since zero is the sentinel above. A time constant shorter than a millisecond is damping that closes within one frame, not damping switched off.
public float DampedFraction { get; init; }
The error, as a fraction of the scale in force, below which the scale is damped at the full ColorScaleDynamics.CloseTime / ColorScaleDynamics.OpenTime.
The bottom of the ramp whose top is ColorScaleDynamics.ImmediateFraction. Between the two the speed-up follows a smoothstep rather than a straight line, so there is no kink in the response at either end: a corner is visible as a jerk part-way through a transition.
public float DeadbandKelvin { get; init; }
How far the scene may sit from the scale before the scale moves at all: a difference in degrees of the SDK's temperature unit, kelvin-sized in Celsius and Fahrenheit-sized in Fahrenheit. Zero switches it off.
Below this the scale does not move, not slowly, not at all. A one-pole filter has no such floor: it answers a 0.01 K wobble with a 0.01 K move, so the range never stops twitching and neither does a slider bound to it. Noise should buy no motion whatever, which is a different statement from “slow motion”.
Absolute in degrees, deliberately, because it exists to sit above the detector's own noise and that noise does not shrink because the scene is wide. ColorScaleDynamics.ImmediateFraction and ColorScaleDynamics.DampedFraction are relative instead, because what counts as a big change is relative to the picture while what counts as noise is not.
Ignored, not damped. The threshold cannot tell noise from signal, so a genuine sustained shift smaller than this is never followed either, however long it is held: the scale is stationary, not creeping. Do not describe this to a user as smoothing; they will wait for a move that never comes. Set it to zero if following arbitrarily small changes matters more than a still picture.
It costs up to this much clipping while opening, and that is accepted: the alternative is what 12.0.0 did, where every noise peak opened the scale and the scale then crept back down, so the palette pumped once per peak. Those pixels are still measured; nothing here touches a reported temperature.
public static ColorScaleDynamics Default { get; }
The SDK's defaults: 1750 ms to close, 250 ms to open, a 0.2 K settle band, no lag bound, a 0.5 K deadband and the adaptive rate between 5% and 50% of the span.
1750 ms reproduces the v11 feel at 32 fps, which is the PI 640i's usual mode and the behaviour most operators have lived with.
The 0.2 and 0.5 here (and in ColorScaleDynamics.Unadapted) are compile-time numbers in Celsius-sized degrees. Assigned in Fahrenheit they are read as Fahrenheit degrees, about half the band. A Fahrenheit program that wants the SDK's defaults sets them itself (0.36 and 0.9), or starts from what the handle reads back.
ColorScaleDynamics.OpenTime was TimeSpan.Zero through 12.0.0. It is 250 ms from 12.1, which is the change an operator will actually see: instant opening tracked every sensor-noise peak and the scale then crept back down, so the palette pumped once per peak. A genuinely large excursion still opens on the frame it arrives, because ColorScaleDynamics.ImmediateFraction catches it. Use ColorScaleDynamics.Unadapted for the old feel.
public FirstFrameSeed FirstFrame { get; init; }
Whether the first frame eases out of the −20 °C … +20 °C seed band instead of adopting what it sees.
Leave it at FirstFrameSeed.Handle unless you mean to override the handle: a camera seeds, a player adopts. See FirstFrameSeed for why that difference exists.
public float ImmediateFraction { get; init; }
The error, as a fraction of the scale in force, at or above which the scale stops being damped and adopts the scene outright.
This is the half of the behaviour a single smoothing constant cannot express. One constant is either slow, so a real scene change crawls, or fast, so noise moves the picture. The rate is instead a function of how wrong the scale currently is.
A fraction of the span rather than a temperature, so the same setting behaves the same on a hand in front of a wall and on a furnace. Zero, or any value not above ColorScaleDynamics.DampedFraction, turns the adaptive rate off and leaves a plain one-pole filter.
public float MaxLagKelvin { get; init; }
A hard bound on how far the scale may sit from the scene during a transient: a difference in degrees of the SDK's temperature unit. Zero, the default, means no bound.
Non-zero snaps when it is hit, by construction, so it trades one visible step for a bounded lag. Leave it off unless a scene needs it.
public static ColorScaleDynamics Off { get; }
Damping switched off: every frame is coloured with its own range.
What a bit-exact fixture wants, and what every auto mode other than the sigma ones did before Zeroing both times switches off the deadband and the adaptive rate too: “undamped” means undamped.
public TimeSpan OpenTime { get; init; }
How long the scale takes to open, when something hotter or colder than it appears.
TimeSpan.Zero (the default, and the only behaviour v11 had) opens on the frame it appears, so nothing saturates while the operator is looking at it. This asymmetry is the load-bearing part of the filter.
Narrowed by the same rule as ColorScaleDynamics.CloseTime: rounded to whole milliseconds and never down to zero from a positive value.
public float SettleBandKelvin { get; init; }
Once the scale is within this of what the scene implies, adopt the scene and stop: a difference in degrees of the SDK's temperature unit, kelvin-sized in Celsius and Fahrenheit-sized in Fahrenheit.
An exponential tail never arrives. Without this the effective range keeps moving in its last digit for the rest of the session and a slider bound to it never settles. Zero switches it off.
public static ColorScaleDynamics Unadapted { get; }
The dynamics as they shipped through 12.0.0: a plain one-pole filter, instant opening, no deadband and no adaptive rate.
For anyone comparing two captures frame by frame, and for a fixture that asserts v11 numbers. Unlike ColorScaleDynamics.Off the scale is still damped while closing: this is the old filter, not no filter.
Provided so such a caller can say it means the unadapted filter rather than depend on what the defaults happen to be. A test asserting v11 numbers that gets them from a default is only telling the truth until the default changes, which is exactly what 12.1 did to eleven of them.