X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=image%2Fimage_raw.cpp;h=93946be947659d44d8e5c7146ab5a2c63aad9ddc;hb=08473e50e90059e75d6e7bce7e12be8bf6dd028b;hp=dd45d104768a80ec8c722ec8169c133dc0854a70;hpb=90808c138de511a81b6b85d22a9400007d91336b;p=apitrace diff --git a/image/image_raw.cpp b/image/image_raw.cpp index dd45d10..93946be 100644 --- a/image/image_raw.cpp +++ b/image/image_raw.cpp @@ -30,13 +30,17 @@ #include #include +#include + #include "image.hpp" namespace image { + void -Image::writeRAW(std::ostream &os) const { +Image::writeRAW(std::ostream &os) const +{ const unsigned char *row; for (row = start(); row != end(); row += stride()) { @@ -44,4 +48,17 @@ Image::writeRAW(std::ostream &os) const { } } + +bool +Image::writeRAW(const char *filename) const +{ + std::ofstream os(filename, std::ofstream::binary); + if (!os) { + return false; + } + writeRAW(os); + return true; +} + + } /* namespace image */