Struct PointsAnnotation

Struct Documentation

struct PointsAnnotation

An array of points on a 2D image.

Public Types

enum class PointsAnnotationType : uint8_t

Type of points annotation.

Values:

enumerator UNKNOWN

Unknown points annotation type.

enumerator POINTS

Individual points: 0, 1, 2, …

enumerator LINE_LOOP

Closed polygon: 0-1, 1-2, …, (n-1)-n, n-0.

enumerator LINE_STRIP

Connected line segments: 0-1, 1-2, …, (n-1)-n.

enumerator LINE_LIST

Individual line segments: 0-1, 2-3, 4-5, …

Public Functions

FoxgloveError encode(uint8_t *ptr, size_t len, size_t *encoded_len)

Encoded the PointsAnnotation as protobuf to the provided buffer.

On success, writes the serialized length to *encoded_len. If the provided buffer has insufficient capacity, writes the required capacity to *encoded_len and returns FoxgloveError::BufferTooShort. If the message cannot be encoded, writes the reason to stderr and returns FoxgloveError::EncodeError.

Parameters:
  • ptr – the destination buffer. must point to at least len valid bytes.

  • len – the length of the destination buffer.

  • encoded_len – where the serialized length or required capacity will be written to.

Public Members

std::optional<Timestamp> timestamp

Timestamp of annotation.

PointsAnnotationType type

Type of points annotation to draw.

std::vector<Point2> points

Points in 2D image coordinates (pixels).

These coordinates use the top-left corner of the top-left pixel of the image as the origin.

std::optional<Color> outline_color

Outline color.

std::vector<Color> outline_colors

Per-point colors, if type is POINTS, or per-segment stroke colors, if type is LINE_LIST, LINE_STRIP or LINE_LOOP.

std::optional<Color> fill_color

Fill color.

double thickness = 0

Stroke thickness in pixels.

Public Static Functions

static Schema schema()

Get the PointsAnnotation schema.

The schema data returned is statically allocated.