My own library to read/write pgm/ppm files. More...
To write a file, the caller specifies the dimensions and a callback.
Caller provides the stream to be read, and two callbacks.
My own library to read/write pgm/ppm files.
See internet searches for libnetpbm and the PGM/PPM file formats.
The authority: http://netpbm.sourceforge.net/doc/pgm.html
WHY did I write my own? Partly because it is simple, and partly because I wanted to base it on std::iostreams so I could break any dependency on files. For instance, gzipped files, or in-memory data, etc.