OptrisOptrisDocumentation

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

optris::sdk::CustomPalette

A palette an application supplies itself.

The colours are the palette. There is no registry, no name to register under and nothing to keep alive: a source is handed a table and colorizes with it until it is handed another one or told to go back to a built-in. Two sources can use two different custom palettes at once, because neither is process-wide state.

That also settles what happens to a saved configuration. The table is written into the file, not a reference to one, so a program that reads the file back has the colours whether or not it has ever heard of the palette. A name the reader cannot resolve is a failure mode this cannot have.

Declared here rather than in palette.h, where the rest of the palette API lives, because ImagerConfig holds one and palette.h already depends on this header for Palette.

Public attributes

name

std::string name

What to call it -- a legend caption, a picker entry, and what identifies it in a saved configuration. Must not be empty.

Not parsed and not matched against anything. Two custom palettes may share a name without consequence.

colors

std::vector< Rgb24 > colors

The colours, coldest first. Exactly kPaletteColorCount entries.