Struct CompressedImage

Struct Documentation

struct CompressedImage

A compressed image.

Public Functions

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

Encoded the CompressedImage 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 image.

std::string frame_id

Frame of reference for the image. The origin of the frame is the optical center of the camera. +x points to the right in the image, +y points down, and +z points into the plane of the image.

std::vector<std::byte> data

Compressed image data.

std::string format

Image format.

Supported values: jpeg, png, webp, avif

Public Static Functions

static Schema schema()

Get the CompressedImage schema.

The schema data returned is statically allocated.