| 99 | } |
| 100 | |
| 101 | void writeDataCallback(png_structp png_ptr, png_bytep data, png_size_t length) |
| 102 | { |
| 103 | vector<uint8_t>& outputBuffer = *(reinterpret_cast<vector<uint8_t>*>(png_get_io_ptr(png_ptr))); |
| 104 | int prevBufSize = outputBuffer.size(); |
| 105 | outputBuffer.resize(outputBuffer.size() + length); |
| 106 | memcpy(&outputBuffer[prevBufSize], data, length); |
| 107 | } |
| 108 | |
| 109 | } |