| 6073 | } |
| 6074 | |
| 6075 | unsigned lodepng_encode_memory(unsigned char** out, size_t* outsize, const unsigned char* image, |
| 6076 | unsigned w, unsigned h, LodePNGColorType colortype, unsigned bitdepth) { |
| 6077 | unsigned error; |
| 6078 | LodePNGState state; |
| 6079 | lodepng_state_init(&state); |
| 6080 | state.info_raw.colortype = colortype; |
| 6081 | state.info_raw.bitdepth = bitdepth; |
| 6082 | state.info_png.color.colortype = colortype; |
| 6083 | state.info_png.color.bitdepth = bitdepth; |
| 6084 | lodepng_encode(out, outsize, image, w, h, &state); |
| 6085 | error = state.error; |
| 6086 | lodepng_state_cleanup(&state); |
| 6087 | return error; |
| 6088 | } |
| 6089 | |
| 6090 | unsigned lodepng_encode32(unsigned char** out, size_t* outsize, const unsigned char* image, unsigned w, unsigned h) { |
| 6091 | return lodepng_encode_memory(out, outsize, image, w, h, LCT_RGBA, 8); |
no test coverage detected