Provides utilities for writing images to disk.
This file provides two sets of utilities: stand alone methods that can be invoked in any context and a System that can be connected into a diagram to automatically capture images during simulation at a fixed frequency.
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>
#include "drake/common/drake_copyable.h"
#include "drake/systems/framework/leaf_system.h"
#include "drake/systems/sensors/image.h"
Classes | |
class | ImageWriter |
A system for periodically writing images to the file system. More... | |
Namespaces | |
drake | |
drake::systems | |
drake::systems::sensors | |
Functions | |
Utility functions for writing common image types to disk. | |
Given a fully-specified path to the file to write and corresponding image data, these functions will attempt to write the image data to the file. The functions assume that the path is valid and writable. These functions will attempt to write the image to the given file path. The file format will be that indicated by the function name, but the extension will be whatever is provided as input. These function do not do validation on the provided file path (existence, writability, correspondence with image type, etc.) It relies on the caller to have done so. | |
void | SaveToPng (const ImageRgba8U &image, const std::string &file_path) |
Writes the color (8-bit, RGBA) image data to disk. More... | |
void | SaveToTiff (const ImageDepth32F &image, const std::string &file_path) |
Writes the depth (32-bit) image data to disk. More... | |