static void CALLBACK_CALL_TYPE qpiw_flush_fn( png_structp png_ptr ) { QPNGImageWriter* qpiw = (QPNGImageWriter*)png_get_io_ptr( png_ptr ); QIODevice* out = qpiw->device(); out->flush(); }
static void CALLBACK_CALL_TYPE qpiw_write_fn(png_structp png_ptr, png_bytep data, png_size_t length) { QPNGImageWriter* qpiw = (QPNGImageWriter*)png_get_io_ptr(png_ptr); QIODevice* out = qpiw->device(); uint nr = out->write((char*)data, length); if (nr != length) { png_error(png_ptr, "Write Error"); return; } }