Function ouster::sdk::io::write_png

Function Documentation

void ouster::sdk::io::write_png(const std::string &filename, Eigen::TensorMap<const core::rgb_img_t<uint8_t>> image, const PngWriteOptions &options = PngWriteOptions{})

Write an 8 bit per channel image to a PNG file.

Parameters:
  • filename[in] the PNG file to write; overwritten if it exists.

  • image[in] the image, with shape (height, width, channels) where channels is 1 (gray), 2 (gray, alpha), 3 (RGB) or 4 (RGBA).

  • options[in] how to write the file.

Throws:
  • std::invalid_argument – if the dimensions or channel count are invalid.

  • std::runtime_error – if the file can’t be written.