optris::sdk::OperationMode
One way the camera can be operated: an optic, a temperature range, a resolution and a frame rate, together.
Its four limits are in the SDK's temperature unit (Celsius unless SetTemperatureUnit() chose Fahrenheit), so a mode read in either unit can be handed back to Imager::SetOperationMode() in that unit.
Public attributes
optics_fov
int optics_fov = 0
How this optic is characterised, as one whole number. Read optics_unit to know what the number means -- it is a field of view in degrees for most optics and a focal length in millimetres for the rest, and nothing about the value itself tells the two apart. 29 is a 29-degree lens or a 29 mm lens depending on that field alone.
The name is historical and stays for compatibility: this is the first field of the mode-matching key. Imager::SetOperationMode() and ImagerConfig::operation_mode look a mode up by this together with optics_text, the two temperature limits, the frame size and the frame rate, so a mode taken from DeviceInfo::operation_modes can be handed straight back.
optics_unit is not part of that key, which matters only if you assemble a mode by hand: two optics on one camera characterised in different units are told apart by their numbers and, where those collide, by optics_text.
optics_unit
OpticsUnit optics_unit = OpticsUnit::kUnknown
The unit optics_fov is in, from the camera's calibration.
Per mode rather than per camera, because one camera can carry two optics characterised differently -- a wide one in degrees and a long one in millimetres -- and each is its own set of modes.
A mode that came from a calibration always answers kDegrees or kMillimetres: a calibration file that names no unit resolves to degrees, which is what every optic predating the distinction is.
kUnknown means no calibration stood behind this mode -- one a caller assembled, one that crossed an interface older than this field, or a camera whose calibration file could not be found, in which case the SDK falls back to the video-format catalogue and has nothing to read a unit from. Not a synonym for degrees; see OpticsUnit.
optics_text
std::string optics_text
How the camera labels this optic beyond its number, UTF-8, often empty. It tells apart two optics that share a number -- which does happen, and is the only thing that separates them when it does -- and it appears in the calibration file name.
It is part of the match. Both Imager::SetOperationMode() and ImagerConfig::operation_mode compare it, and they have to: it is what separates two optics sharing a number, so excluding it would make them indistinguishable.
A mode read from DeviceInfo::operation_modes already carries this camera's own label and matches. One assembled by hand must carry the same label -- or leave optics_fov at 0 and this empty, which matches the first optic instead of a named one. An empty label against a labelled optic is refused, and the refusal names what was asked for.
temp_min
float temp_min = 0.0f
Bottom of the range this mode measures, in the SDK's temperature unit. An absolute temperature, not an offset from anything, and usually below zero.
The calibrated limit, always -- never the one in force. TemperatureRange::extended does not move it, and neither does anything else: this field is part of this mode's identity, and a mode's identity does not change under a switch that leaves it the same mode. The pair is the same pair DeviceInfo::available_ranges lists, and the pair every lookup matches on, so a record taken from DeviceInfo::operation_modes or from Imager::GetOperationMode() can be handed back whatever the extension is doing.
This changed in 12.0.1 and the old reading was a defect, not a feature being withdrawn. These two fields used to report the limits in force, so with the extension on they held the extended pair -- which extended_temp_min/extended_temp_max already carried -- and the calibrated pair appeared nowhere in the record. Every lookup matches the calibrated pair, so the SDK handed out modes it then refused: assigning Imager::GetOperationMode() back through Imager::SetOperationMode() raised "this camera has no such
operation mode", and after a mode switch with the extension on, no extendable mode could be selected again until the extension was switched off or the camera was reopened.
To get the limits in force, compose them -- which is what the SDK does internally:
const OperationMode mode = imager->GetOperationMode(); const TemperatureRange range = imager->GetTemperatureRange(); float lo = mode.temp_min; if (range.extended && mode.extendable && mode.extended_temp_min) lo = *mode.extended_temp_min; std::cout << "measuring from " << lo << " " << Temperatures::Symbol(GetTemperatureUnit()) << "\n";
extendable says whether the extension can do anything to this mode, extended_temp_min/extended_temp_max say how far, and TemperatureRange::extended says whether it is switched on. Nothing was lost; the duplication was.
temp_max
float temp_max = 0.0f
Top of that same range, in the SDK's temperature unit, under the same rule: the calibrated limit, not the one in force.
width
int width = 0
Frame width in pixels, as the sensor reads out. Sensor-native and unrotated: Imager::GetWidth() applies the configured orientation, and under a quarter turn it reports this mode's height.
height
int height = 0
Frame height in pixels, sensor-native, with the same caveat.
framerate
int framerate = 0
Frames per second this mode streams at, in whole Hz. A mode that trades frame rate for something else is a separate entry in the list, not a switch on this one.
extendable
bool extendable = false
Whether this mode's range can be stretched past temp_min and temp_max, at reduced accuracy, via TemperatureRange::extended. How far the stretch actually reaches is extended_temp_min and extended_temp_max, which are empty unless this is true.
high_precision_available
bool high_precision_available = false
Whether this mode's calibration offers the high-precision temperature table -- Decimal 2 in the calibration file, the camera's own statement that this range fits in the narrower span that table covers. A property of the mode itself: a mode that does not offer it cannot be made to, and switching modes is the only way to get it.
Rare. Of the 82 calibrated ranges across the 28 cameras Optris tests with, four say yes, and in every case it is the -20..100 C range.
Nothing to do with frame rate -- the frame rate is identical either way. TemperatureRange::high_precision says what the finer table does and does not change.
extended_temp_min
std::optional< float > extended_temp_min
The limits the extension would give, in the SDK's temperature unit, or empty when this mode is not extendable.
These come from the camera's own calibration -- the same table temp_min and temp_max are read from -- so they are the camera's numbers, not the SDK's. A mode picker needs them to say what "extendable" is worth; without them the only honest thing it can show is that an extension exists.
A range may extend at one end only, in which case that end's value equals the normal limit and the other end differs. Both are filled or neither is.
extended_temp_max
std::optional< float > extended_temp_max
The top of that extended range, in the same unit. Subtracting temp_max from it gives the headroom the extension is actually worth; a value equal to temp_max means this end does not move even though the mode extends at the other. Filled as a pair with extended_temp_min -- both carry a value or neither does.