]> git.cworth.org Git - apitrace/blobdiff - image/image.hpp
d3dretrace: Fix MinGW build.
[apitrace] / image / image.hpp
index 7dd18c1225e821a0286ea11e0a73989be57acc51..cfdf875f3228a95bc95bc1b74c32c76ef893400a 100644 (file)
@@ -31,7 +31,7 @@
 #define _IMAGE_HPP_
 
 
-#include <fstream>
+#include <iostream>
 
 
 namespace image {
@@ -81,35 +81,32 @@ public:
         return flipped ? -(signed)(width*channels) : width*channels;
     }
 
-    bool writeBMP(const char *filename) const;
+    bool
+    writeBMP(const char *filename) const;
 
-    void writePNM(std::ostream &os, const char *comment = NULL) const;
+    void
+    writePNM(std::ostream &os, const char *comment = NULL) const;
 
-    inline bool writePNM(const char *filename, const char *comment = NULL) const {
-        std::ofstream os(filename, std::ofstream::binary);
-        if (!os) {
-            return false;
-        }
-        writePNM(os, comment);
-        return true;
-    }
+    bool
+    writePNM(const char *filename, const char *comment = NULL) const;
 
     bool
     writePNG(std::ostream &os) const;
 
-    inline bool
-    writePNG(const char *filename) const {
-        std::ofstream os(filename, std::ofstream::binary);
-        if (!os) {
-            return false;
-        }
-        return writePNG(os);
-    }
+    bool
+    writePNG(const char *filename) const;
 
-    double compare(Image &ref);
+    void
+    writeRAW(std::ostream &os) const;
+
+    bool
+    writeRAW(const char *filename) const;
 };
 
 
+Image *
+readPNG(std::istream &is);
+
 Image *
 readPNG(const char *filename);