Struct TextPrimitive

Struct Documentation

struct TextPrimitive

A primitive representing a text label.

Public Functions

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

Encoded the TextPrimitive 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<Pose> pose

Position of the center of the text box and orientation of the text. Identity orientation means the text is oriented in the xy-plane and flows from -x to +x.

bool billboard = false

Whether the text should respect pose.orientation (false) or always face the camera (true)

double font_size = 0

Font size (height of one line of text)

bool scale_invariant = false

Indicates whether font_size is a fixed size in screen pixels (true), or specified in world coordinates and scales with distance from the camera (false)

std::optional<Color> color

Color of the text.

std::string text

Text.

Public Static Functions

static Schema schema()

Get the TextPrimitive schema.

The schema data returned is statically allocated.