X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=image%2Fimage_raw.cpp;h=9e8fbfd36f8c32da11b083a527476ae2e8154606;hb=3c772b3743c54cd950545e74f5f334b67e65696f;hp=93946be947659d44d8e5c7146ab5a2c63aad9ddc;hpb=08473e50e90059e75d6e7bce7e12be8bf6dd028b;p=apitrace diff --git a/image/image_raw.cpp b/image/image_raw.cpp index 93946be..9e8fbfd 100644 --- a/image/image_raw.cpp +++ b/image/image_raw.cpp @@ -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); } }