| 6173 | #ifdef LODEPNG_COMPILE_DECODER |
| 6174 | |
| 6175 | unsigned decode(std::vector<unsigned char>& out, unsigned& w, unsigned& h, const unsigned char* in, |
| 6176 | size_t insize, LodePNGColorType colortype, unsigned bitdepth) |
| 6177 | { |
| 6178 | unsigned char* buffer; |
| 6179 | unsigned error = lodepng_decode_memory(&buffer, &w, &h, in, insize, colortype, bitdepth); |
| 6180 | if(buffer && !error) |
| 6181 | { |
| 6182 | State state; |
| 6183 | state.info_raw.colortype = colortype; |
| 6184 | state.info_raw.bitdepth = bitdepth; |
| 6185 | size_t buffersize = lodepng_get_raw_size(w, h, &state.info_raw); |
| 6186 | out.insert(out.end(), &buffer[0], &buffer[buffersize]); |
| 6187 | lodepng_free(buffer); |
| 6188 | } |
| 6189 | return error; |
| 6190 | } |
| 6191 | |
| 6192 | unsigned decode(std::vector<unsigned char>& out, unsigned& w, unsigned& h, |
| 6193 | const std::vector<unsigned char>& in, LodePNGColorType colortype, unsigned bitdepth) |
no test coverage detected