]> git.cworth.org Git - apitrace/blobdiff - image.hpp
Word wrap the surfaces description.
[apitrace] / image.hpp
index 4d57de112f96c104f6ccd71a2b97c78b1cee0d04..f46fb31e69712f4cebe322dea04b71c13e48a686 100644 (file)
--- a/image.hpp
+++ b/image.hpp
@@ -59,9 +59,33 @@ public:
         delete [] pixels;
     }
 
+    inline unsigned char *start(void) {
+        return flipped ? pixels + (height - 1)*width*4 : pixels;
+    }
+
+    inline unsigned char *end(void) {
+        return flipped ? pixels - width*4 : pixels + height*width*4;
+    }
+
+    inline signed stride(void) const {
+        return flipped ? -width*4 : width*4;
+    }
+
     bool writeBMP(const char *filename) const;
+    bool writePNG(const char *filename) const;
+
+    double compare(Image &ref);
 };
 
+bool writePixelsToBuffer(unsigned char *pixels,
+                         unsigned w, unsigned h, unsigned numChannels,
+                         bool flipped,
+                         char **buffer,
+                         int *size);
+
+Image *
+readPNG(const char *filename);
+
 
 } /* namespace Image */