68 std::ostream* strmPtr =
reinterpret_cast<std::ostream*
>(
69 png_get_io_ptr(pngPtr)
73 strmPtr->write(
reinterpret_cast<const char *
>(
data),
length);
88 PNG_LIBPNG_VER_STRING, NULL, NULL, NULL
130 png_infop infoPtr = handle.
pngInfoP;
133 warn(
"Frame buffer dump aborted: Unable to create"
134 "Png Write Struct\n");
139 warn(
"Frame buffer dump aborted: Unable to create"
140 "Png Info Struct\n");
148 png_set_write_fn(pngPtr, (png_voidp)&png,
writePng, NULL);
150 png_set_IHDR(pngPtr, infoPtr,
width, height, 8,
153 PNG_COMPRESSION_TYPE_DEFAULT,
154 PNG_FILTER_TYPE_DEFAULT);
156 png_write_info(pngPtr, infoPtr);
160 for (
unsigned y=0; y < height; ++y) {
161 for (
unsigned x=0;
x <
width; ++
x) {
165 png_write_row(pngPtr,
166 reinterpret_cast<png_bytep
>(rowPacked.data())
171 png_write_end(pngPtr, NULL);