| 6350 | #ifdef LODEPNG_COMPILE_DECODER |
| 6351 | |
| 6352 | unsigned 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 | |
| 6367 | unsigned decode(std::vector<unsigned char>& out, unsigned& w, unsigned& h, |
| 6368 | const std::vector<unsigned char>& in, LodePNGColorType colortype, unsigned bitdepth) { |
nothing calls this directly
no test coverage detected