]> git.cworth.org Git - apitrace/blobdiff - image_pnm.cpp
Embedded the call no in PNM images as a comment.
[apitrace] / image_pnm.cpp
index 6625f3ddc6b9846c1876bab53fd8f0afb8000fdb..44ae624cfa425032364b6c81d6a0bcd856f2b684 100644 (file)
@@ -35,12 +35,16 @@ namespace Image {
 
 /**
  * http://en.wikipedia.org/wiki/Netpbm_format
+ * http://netpbm.sourceforge.net/doc/ppm.html
  */
 void
-Image::writePNM(std::ostream &os) const {
+Image::writePNM(std::ostream &os, const char *comment) const {
     assert(channels == 1 || channels >= 3);
 
     os << (channels == 1 ? "P5" : "P6") << "\n";
+    if (comment) {
+        os << "#" << comment << "\n";
+    }
     os << width << " " << height << "\n";
     os << "255" << "\n";