MCPcopy Create free account
hub / github.com/DFHack/dfhack / zlib_compress

Function zlib_compress

depends/lodepng/lodepng.cpp:2293–2302  ·  view source on GitHub ↗

compress using the default or custom zlib function */

Source from the content-addressed store, hash-verified

2291
2292/* compress using the default or custom zlib function */
2293static unsigned zlib_compress(unsigned char** out, size_t* outsize, const unsigned char* in,
2294 size_t insize, const LodePNGCompressSettings* settings) {
2295 if(settings->custom_zlib) {
2296 unsigned error = settings->custom_zlib(out, outsize, in, insize, settings);
2297 /*the custom zlib is allowed to have its own error codes, however, we translate it to code 111*/
2298 return error ? 111 : 0;
2299 } else {
2300 return lodepng_zlib_compress(out, outsize, in, insize, settings);
2301 }
2302}
2303
2304#endif /*LODEPNG_COMPILE_ENCODER*/
2305

Callers 6

addChunk_IDATFunction · 0.85
addChunk_zTXtFunction · 0.85
addChunk_iTXtFunction · 0.85
addChunk_iCCPFunction · 0.85
filterFunction · 0.85
compressFunction · 0.85

Calls 1

lodepng_zlib_compressFunction · 0.85

Tested by

no test coverage detected