| 6097 | #ifdef LODEPNG_COMPILE_DECODER |
| 6098 | |
| 6099 | unsigned decode(std::vector<unsigned char>& out, unsigned& w, unsigned& h, const unsigned char* in, |
| 6100 | size_t insize, LodePNGColorType colortype, unsigned bitdepth) |
| 6101 | { |
| 6102 | unsigned char* buffer; |
| 6103 | unsigned error = lodepng_decode_memory(&buffer, &w, &h, in, insize, colortype, bitdepth); |
| 6104 | if(buffer && !error) |
| 6105 | { |
| 6106 | State state; |
| 6107 | state.info_raw.colortype = colortype; |
| 6108 | state.info_raw.bitdepth = bitdepth; |
| 6109 | size_t buffersize = lodepng_get_raw_size(w, h, &state.info_raw); |
| 6110 | out.insert(out.end(), &buffer[0], &buffer[buffersize]); |
| 6111 | lodepng_free(buffer); |
| 6112 | } |
| 6113 | return error; |
| 6114 | } |
| 6115 | |
| 6116 | unsigned decode(std::vector<unsigned char>& out, unsigned& w, unsigned& h, |
| 6117 | const std::vector<unsigned char>& in, LodePNGColorType colortype, unsigned bitdepth) |
no test coverage detected