Class ZPngLidarScanEncoder

Inheritance Relationships

Base Type

Class Documentation

class ZPngLidarScanEncoder : public ouster::sdk::osf::LidarScanEncoder

Zlib-compressed PNG encoder for lidar scan fields.

This is a more performant variant of `PngLidarScanEncoder.

Public Functions

inline ZPngLidarScanEncoder(int compression_amount)

Construct a ZPngLidarScanEncoder with a specified compression level.

Parameters:

compression_amount[in] – Compression level passed to zlib (0 = none, 9 = max).

virtual ScanChannelData encode_field(const ouster::sdk::core::Field &field, const std::vector<int> &px_offset = {}) const override

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.