Celeritas  0.5.0-86+4a8eea4
Classes | Public Member Functions | List of all members
celeritas::ImageWriter Class Reference

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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ImageWriter()

celeritas::ImageWriter::ImageWriter ( std::string const &  filename,
Size2  height_width 
)
inline

Construct with a filename and dimensions.

Dimensions are row-major like other C++ arrays.


The documentation for this class was generated from the following files: