| 6134 | #ifdef LODEPNG_COMPILE_DECODER |
| 6135 | |
| 6136 | unsigned decode(std::vector<unsigned char>& out, unsigned& w, unsigned& h, const unsigned char* in, |
| 6137 | size_t insize, LodePNGColorType colortype, unsigned bitdepth) |
| 6138 | { |
| 6139 | unsigned char* buffer; |
| 6140 | unsigned error = lodepng_decode_memory(&buffer, &w, &h, in, insize, colortype, bitdepth); |
| 6141 | if(buffer && !error) |
| 6142 | { |
| 6143 | State state; |
| 6144 | state.info_raw.colortype = colortype; |
| 6145 | state.info_raw.bitdepth = bitdepth; |
| 6146 | size_t buffersize = lodepng_get_raw_size(w, h, &state.info_raw); |
| 6147 | out.insert(out.end(), &buffer[0], &buffer[buffersize]); |
| 6148 | lodepng_free(buffer); |
| 6149 | } |
| 6150 | return error; |
| 6151 | } |
| 6152 | |
| 6153 | unsigned decode(std::vector<unsigned char>& out, unsigned& w, unsigned& h, |
| 6154 | const std::vector<unsigned char>& in, LodePNGColorType colortype, unsigned bitdepth) |
nothing calls this directly
no test coverage detected