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

Function lodepng_decode_memory

depends/lodepng/lodepng.cpp:4988–5003  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4986}
4987
4988unsigned lodepng_decode_memory(unsigned char** out, unsigned* w, unsigned* h, const unsigned char* in,
4989 size_t insize, LodePNGColorType colortype, unsigned bitdepth) {
4990 unsigned error;
4991 LodePNGState state;
4992 lodepng_state_init(&state);
4993 state.info_raw.colortype = colortype;
4994 state.info_raw.bitdepth = bitdepth;
4995#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS
4996 /*disable reading things that this function doesn't output*/
4997 state.decoder.read_text_chunks = 0;
4998 state.decoder.remember_unknown_chunks = 0;
4999#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/
5000 error = lodepng_decode(out, w, h, &state, in, insize);
5001 lodepng_state_cleanup(&state);
5002 return error;
5003}
5004
5005unsigned lodepng_decode32(unsigned char** out, unsigned* w, unsigned* h, const unsigned char* in, size_t insize) {
5006 return lodepng_decode_memory(out, w, h, in, insize, LCT_RGBA, 8);

Callers 4

lodepng_decode32Function · 0.85
lodepng_decode24Function · 0.85
lodepng_decode_fileFunction · 0.85
decodeFunction · 0.85

Calls 3

lodepng_state_initFunction · 0.85
lodepng_decodeFunction · 0.85
lodepng_state_cleanupFunction · 0.85

Tested by

no test coverage detected