OptrisOptrisDocumentation

Documentation/OTC SDK/Optris.Sdk — C# API referencev12.0

Canvas

public sealed class Canvas : IDisposable

A view space, the placements in it, and the colour of the rest.

A camera's frame is placed into a canvas by a Placement (rotation, zoom, pan), so the picture can be turned and moved without a single measured temperature changing. Compositing is allowed to resample, because it is display; measurement never touches the composite.

Canvas: constructors

public Canvas(uint width, uint height)

A canvas of that size.

  • width: Output width in pixels. Zero means "follow the camera", which is the default and a pass-through.
  • height: Output height in pixels.

Canvas: properties

public int PlacementCount { get; }

How many placements this canvas holds.

public ValueTuple<uint, uint> Size { get; }

The size this canvas was asked for.

(0, 0) means "follow the camera". Canvas.Extent(…) is the resolved answer; it substitutes the frame's size for a zero.

public ValueTuple<float, float, float, float> VoidColor { get; set; }

The colour of space no placement covers.

Canvas: methods

public void AddPlacement(Placement placement)

Append a placement.

public void Dispose()

Release the canvas.

public ValueTuple<uint, uint> Extent(uint frameWidth, uint frameHeight)

The size the placed frames actually occupy.

public Placement GetPlacement(int index)

The placement at index, as a copy.

Reading past the end does not throw: it answers the identity, because an unplaced camera sits exactly where it always did. That asymmetry with Canvas.SetPlacement(…) is the ABI's and is deliberate.

public bool IsPassThrough(uint frameWidth, uint frameHeight)

Whether this canvas would leave the frame untouched.

True for an empty canvas, which is the documented default: nothing changes before a canvas is placed. Also true for a single identity placement of a frame exactly the canvas's size, where compositing would copy every pixel to itself. False for a zoom, and false for an identity on a canvas of a different size.

public void SetPlacement(int index, Placement placement)

Replace the placement at index.

  • Throws SdkObjectNotFoundException: Past the end. Unlike Canvas.GetPlacement(…) this refuses, because writing past the end would silently drop the edit: a caller that meant to move a camera would see no error and no movement.
public float SpaceHeight(uint frameWidth, uint frameHeight)

The canvas's height in view-space units.