Celeritas
0.5.0-86+4a8eea4
|
Write a 2D array of colors as a PNG file. More...
#include <ImageWriter.hh>
Classes | |
struct | Impl |
Public Types | |
Type aliases | |
using | SpanColor = Span< Color > |
Public Member Functions | |
ImageWriter (std::string const &filename, Size2 height_width) | |
Construct with a filename and dimensions. More... | |
~ImageWriter () | |
Close on destruction. | |
void | operator() (Span< Color const >) |
Write a row. | |
void | close () |
Close the file early so that exceptions can be caught. | |
operator bool () const | |
Whether the output is available for writing. | |
Write a 2D array of colors as a PNG file.
Each row is written progressively. All rows must be written. Currently alpha values are ignored due to my poor understanding of libpng.
|
inline |
Construct with a filename and dimensions.
Dimensions are row-major like other C++ arrays.