OptrisOptrisDocumentation

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

optris::sdk::Canvas

A view-space scene, and where each camera sits in it.

Public attributes

width

uint32_t width = 0

Extent in canvas pixels. Zero on either axis means "follow the camera": the canvas takes the frame's own size. Together with an empty placements that makes the default Canvas a pass-through, so a canvas existing changes nothing until something is placed.

height

uint32_t height = 0

placements

std::vector< Placement > placements

One entry per camera. The SDK's Imager drives one camera and so uses the first; N cameras is more entries and a compositor that iterates, which is why this is a list and not a single field. See the note on merging at the top of this file for what N cameras still needs beyond more entries.

void_color

std::array< float, 4 > void_color = {0.0F, 0.0F, 0.0F, 1.0F}

What a canvas pixel with no camera behind it looks like, RGBA in 0..1. Voids are expected (rotate a rectangle inside a rectangle and there are corners left over), so they have a defined appearance rather than whatever was in the buffer. Opaque black by default; set alpha to 0 for a canvas composited over something else.

Public static functions

Of

static auto Of(uint32_t width, uint32_t height) -> Canvas

A canvas of a fixed extent, with nothing placed on it yet.

Public functions

PlacementOf

auto PlacementOf(size_t index=0) const -> Placement

The placement of camera index, or the identity if there is none; an unplaced camera sits exactly where it always did.

ExtentWidth

auto ExtentWidth(uint32_t frame_width) const -> uint32_t

The canvas extent, resolving a zero axis against the frame.

ExtentHeight

auto ExtentHeight(uint32_t frame_height) const -> uint32_t

SpaceHeight

auto SpaceHeight(uint32_t frame_width, uint32_t frame_height) const -> float

The y extent of canvas space: height / width, matching RegionSpaceHeight().

IsPassThrough

auto IsPassThrough(uint32_t frame_width, uint32_t frame_height) const -> bool

True when this canvas would deliver the frame unchanged: same extent, identity placement. The pass-through case is checked rather than computed, so an application can leave a Canvas set permanently and pay nothing for it until it places something.