OptrisOptrisDocumentation

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

optris_sdk_color_window

A temperature band drawn in colour over a grayscale base -- an isotherm.

For showing where something is in range without losing the rest of the scene. Display only: it changes no measurement.

Bands composite in ascending id, so a later id draws over an earlier one where they overlap. At most OPTRIS_SDK_MAX_COLOR_WINDOWS at once.

Public attributes

struct_size

uint32_t struct_size

Set to sizeof(optris_sdk_color_window).

min_c

float min_c

The band, in the SDK's temperature unit (Celsius unless optris_sdk_set_temperature_unit() chose Fahrenheit). max_c must be greater than min_c.

max_c

float max_c

Top of the band, and also the end of the colour ramp: the palette is stretched across min_c..max_c, so widening the band admits more pixels and flattens the gradient across the ones that were already in it.

Both ends are inclusive -- a pixel takes part when min_c <= t <= max_c. A max_c below min_c colours nothing rather than inverting the ramp. A band narrower than 0.01 K (0.018 F) is widened to that before the ramp is built, so min_c == max_c gives one flat colour instead of a division by zero.

palette

optris_sdk_palette palette

The colour map for the band, used when colors is NULL.

opacity

float opacity

How strongly it is drawn, 0 to 1.

motion_only

int32_t motion_only

Non-zero to colour only where motion was detected.

Needs at least one motion zone; with none there is no mask and such a band draws nothing. On a live camera the mask is one frame old, because it is computed from the frame the pipeline has already drawn.

colors

const optris_sdk_rgb24 * colors

The band's own colour ramp, coldest first, overriding palette. Read only when colors_from is OPTRIS_SDK_COLOR_WINDOW_COLORS_TABLE.

Any length from 1 to OPTRIS_SDK_PALETTE_COLOR_COUNT; it is resampled across the band. One entry is a solid colour -- the marker band that reads as a flag rather than a gradient. A table handed over end-for-end is a reversed ramp, which is how a cold band is made to read as cold.

Only read during the call; the SDK copies it.

Appended after motion_only, so a caller compiled against an older header simply does not carry it and gets palette as before.

color_count

size_t color_count

How many entries colors has.

On the way out of optris_sdk_imager_read_color_windows() this is how long the band's table is even though colors is NULL, so a caller can tell a ramped band from a palette one without a second call. Read it with optris_sdk_imager_read_color_window_colors().

colors_from

optris_sdk_color_window_colors colors_from

Where the band takes its colours from.

This field exists because the struct did not round-trip. A band read back carries colors == NULL -- the SDK cannot hand out a pointer into its own memory that would outlive the call -- and color_count set to the table's length. Written back unchanged, the old write path saw a NULL colors, took that for "use the palette", and discarded the ramp without a word. Reading a band, nudging its max_c and writing it back is the most ordinary thing an editor does, and it silently destroyed the colours.

Every case is now named. A zeroed struct means OPTRIS_SDK_COLOR_WINDOW_COLORS_PALETTE, which is what it always meant, so this field defaults to the harmless answer.

Appended after color_count; an older caller's struct stops before it and is read as OPTRIS_SDK_COLOR_WINDOW_COLORS_PALETTE.