]> git.cworth.org Git - apitrace/blobdiff - image/image_raw.cpp
image: Add floating point support.
[apitrace] / image / image_raw.cpp
index 93946be947659d44d8e5c7146ab5a2c63aad9ddc..9e8fbfd36f8c32da11b083a527476ae2e8154606 100644 (file)
@@ -41,10 +41,12 @@ namespace image {
 void
 Image::writeRAW(std::ostream &os) const
 {
+    assert(channelType == TYPE_UNORM8);
+
     const unsigned char *row;
 
     for (row = start(); row != end(); row += stride()) {
-        os.write((const char *)row, width*channels);
+        os.write((const char *)row, width*channels*bytesPerPixel);
     }
 }