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

Function decode

depends/lodepng/lodepng.cpp:6352–6365  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6350#ifdef LODEPNG_COMPILE_DECODER
6351
6352unsigned decode(std::vector<unsigned char>& out, unsigned& w, unsigned& h, const unsigned char* in,
6353 size_t insize, LodePNGColorType colortype, unsigned bitdepth) {
6354 unsigned char* buffer = 0;
6355 unsigned error = lodepng_decode_memory(&buffer, &w, &h, in, insize, colortype, bitdepth);
6356 if(buffer && !error) {
6357 State state;
6358 state.info_raw.colortype = colortype;
6359 state.info_raw.bitdepth = bitdepth;
6360 size_t buffersize = lodepng_get_raw_size(w, h, &state.info_raw);
6361 out.insert(out.end(), &buffer[0], &buffer[buffersize]);
6362 }
6363 lodepng_free(buffer);
6364 return error;
6365}
6366
6367unsigned decode(std::vector<unsigned char>& out, unsigned& w, unsigned& h,
6368 const std::vector<unsigned char>& in, LodePNGColorType colortype, unsigned bitdepth) {

Callers

nothing calls this directly

Calls 9

lodepng_decode_memoryFunction · 0.85
lodepng_get_raw_sizeFunction · 0.85
lodepng_freeFunction · 0.85
lodepng_decodeFunction · 0.85
load_fileFunction · 0.70
insertMethod · 0.45
endMethod · 0.45
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected