Class FrameEncoder

Inheritance Relationships

Derived Types

Class Documentation

class FrameEncoder

Interface for encoding frame fields.

This interface defines a method to encode a field of a frame, optionally destaggering it based on pixel offsets. It serves every frame kind written to an OSF, lidar and camera alike.

Subclassed by ouster::sdk::osf::PngFrameEncoder, ouster::sdk::osf::ZPngFrameEncoder

Public Functions

virtual ~FrameEncoder() = default
virtual FrameChannelData encode_field(const ouster::sdk::core::Field &field, const std::vector<int> &px_offset = {}) const = 0

This method encodes a field, if px_offset is provided it is destaggered before encoding.

Parameters:
  • field[in] The field to encode (e.g., RANGE, SIGNAL).

  • px_offset[in] Optional pixel offsets for destaggering the data.

Throws:

std::runtime_error – If encoding fails (e.g., invalid field shape, unsupported field type, or backend encoding errors).

Returns:

Encoded binary data representing the field.