OptrisOptrisDocumentation

Documentation/OTC SDK/OTC SDK — C++ API referencev12.0

optris::sdk::rec::RenderMeta

How the colorized picture was drawn.

It says what the colours meant, so a reader can reproduce the picture or put a legend beside it: the palette, the numeric range the palette was stretched over, and the auto-scale mode that chose that range.

Why the range is not derivable: Why the range is not derivable Under the sigma and percentile auto-scale modes the range is temporally filtered, so it is neither what the frame's own pixels imply nor what the application last asked for. Recording it is the only way a reader can say what the colours meant.

Two places carry this, and they mean different things: Two places carry this, and they mean different things A snapshot is one frame, so one of these describes it completely; it hangs off FileMetadata::render.

A recording is not one frame. The palette can be switched while it runs, and under the percentile and sigma modes the range is expected to move from frame to frame -- that is what those modes are. So a recording carries this in two places:

  • FileMetadata::render, the state as the file opened. Reachable without decoding the video, which is what a foreign reader gets.
  • Telemetry::render, per frame, written on exactly those frames where the file-level value would be wrong, and complete when it is written.

A reader's rule is therefore one line: use the frame's own block if it has one, otherwise the file's. No scanning back, no reconstruction from deltas, and no frame where the answer is a value that stood for something that varied.

This lives in types.h rather than beside the rest of the metadata schema so that Telemetry can carry one; metadata.h includes this header, so rec::RenderMeta is reachable from either.

Public attributes

palette

std::string palette

Palette name as GetPaletteName() spells it: "Iron", "IronHi", "Rainbow", "RainbowHi", "GrayBW", "GrayWB", "Medical", "AlarmBlue", "AlarmBlueHi", "AlarmGreen", "AlarmRed", "Jet", "Hot", "Plasma", "Arctic", "Lava" -- or "custom" when the application supplied its own colours.

One spelling, and which one: One spelling, and which one These are the stems of the palette files in packaging/palettes, the same names SDK 11 and PIX Connect wrote, and what FindPalette() takes back. Three other spellings of the same sixteen palettes exist in this codebase -- view::PaletteToString ("GrayscaleBW"), the Palette enumerators (kGrayscaleBW), and what the .NET Palette enum shows -- and none of them is what goes in a file. This doc comment used to give "GrayscaleBW" as an example of what GetPaletteName() returns, which it has never returned. view::PaletteFromString accepts the stems above as well, so a name copied out of otc-meta.json into a view preset resolves rather than falling back to Iron.

custom: custom The colours were the application's own. palette_name carries what the application called it, and is a label rather than a lookup key -- nothing resolves colours from it.

The colours themselves are in the file, once, in FileMetadata::palette_colors: 240 entries as "#rrggbb", coldest first, about 2.4 KB. Not here, and not in a per-frame block: a palette is 720 bytes raw and this struct is written beside every frame whose colours differ from the file's, so carrying it here would cost that on each of them.

They are the colours in force when the file opened, and they belong to the file-level block. A frame carrying a block of its own is a frame the file-level block was wrong for, and these colours are not its answer -- see palette_colors for what a reader can and cannot tell about a palette changed mid-recording, and why a Matroska header leaves no other option.

A recording written before this field existed carries no table at all. There, and for a file whose table will not parse, the old rule stands: draw with a palette of your own and say that you did rather than presenting the picture as the one the operator saw. The colour scale is exact in every case, so the numbers a legend shows are right either way.

palette_name

std::string palette_name

Display name of an application-supplied palette, when it had one. Empty for a built-in. Set exactly when palette is "custom", and it is a label rather than a lookup key: nothing in the SDK resolves colours from it.

range_min_c

std::optional< float > range_min_c

The colour scale the image was drawn with. These are the ends of the palette, not the scene's extremes -- under the percentile mode the scene runs past both.

In the SDK's temperature unit (Celsius unless SetTemperatureUnit() chose Fahrenheit) where the SDK hands this out as a reading: Imager::GetRenderState(), Imager::GetConfiguredRenderState(), Player::GetRecordedRender(), StillSource::GetRecordedRender() and the Telemetry of a replayed frame. In Celsius, by design, where it is the file's own record: FileMetadata::render, and what Recorder::WriteFrame() writes, which takes Celsius.

range_max_c

std::optional< float > range_max_c

auto_scale_mode

std::string auto_scale_mode

"percentile", "absolute", "sigma1" or "sigma3" -- how that range was chosen, or absent when a fixed range was in force.

overlays

std::optional< bool > overlays

Whether region and blob overlays were composited into the picture. A reader seeing a box can then tell it is an overlay rather than something in the scene.

thermal_data_reliable

std::optional< bool > thermal_data_reliable

False when the detector had not settled and the temperatures the colours were computed from were not yet trustworthy. See FrameMetadata::thermal_data_reliable.

Friends

operator==

auto operator==(const RenderMeta &lhs, const RenderMeta &rhs) -> bool

Whether two of these say the same thing about the colours.

This is what the recorder asks to decide whether a frame needs a block of its own, so it is the definition of "the file-level value would be wrong here" rather than an incidental helper.