X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=image%2Fimage_raw.cpp;h=9e8fbfd36f8c32da11b083a527476ae2e8154606;hb=dfd413a5f54bd450850b5e84886949bcdf85b1e7;hp=93946be947659d44d8e5c7146ab5a2c63aad9ddc;hpb=59889aafe642e52742524da2c202a1003643fa94;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); } }