OptrisOptrisDocumentation

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

optris_sdk_rgb24

One entry of a palette's colour table.

Exactly three bytes, in red-green-blue order, so an array of these is byte-for-byte an RGB8 image one pixel high -- which is what a gradient strip or a legend is. See the note on struct_size in section 5 of the conventions above: this is an element type, not a settings struct, and it carries no size field.

Public attributes

r

uint8_t r

Red, 0..255. The palette's own byte, handed over unchanged: no colour management is applied on the way out and no alpha is premultiplied into it.

g

uint8_t g

Green, 0..255. The three channels are separate bytes with no packing and no padding, so sizeof(optris_sdk_rgb24) is 3 and an array of them can be handed to anything expecting tight RGB8.

b

uint8_t b

Blue, 0..255.

Mind the order against the picture. A palette entry is R-G-B, while a colorized pixel in an optris_sdk_image is B-G-R-A, so blitting this table straight into a BGRA surface draws the gradient with red and blue swapped -- a legend that looks plausible and is wrong.