| 5978 | #ifdef LODEPNG_COMPILE_DECODER |
| 5979 | |
| 5980 | unsigned decode(std::vector<unsigned char>& out, unsigned& w, unsigned& h, const unsigned char* in, |
| 5981 | size_t insize, LodePNGColorType colortype, unsigned bitdepth) |
| 5982 | { |
| 5983 | unsigned char* buffer; |
| 5984 | unsigned error = lodepng_decode_memory(&buffer, &w, &h, in, insize, colortype, bitdepth); |
| 5985 | if(buffer && !error) |
| 5986 | { |
| 5987 | State state; |
| 5988 | state.info_raw.colortype = colortype; |
| 5989 | state.info_raw.bitdepth = bitdepth; |
| 5990 | size_t buffersize = lodepng_get_raw_size(w, h, &state.info_raw); |
| 5991 | out.insert(out.end(), &buffer[0], &buffer[buffersize]); |
| 5992 | lodepng_free(buffer); |
| 5993 | } |
| 5994 | return error; |
| 5995 | } |
| 5996 | |
| 5997 | unsigned decode(std::vector<unsigned char>& out, unsigned& w, unsigned& h, |
| 5998 | const std::vector<unsigned char>& in, LodePNGColorType colortype, unsigned bitdepth) |
no test coverage detected