| 4986 | } |
| 4987 | |
| 4988 | unsigned 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 | |
| 5005 | unsigned 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); |
no test coverage detected