| 6097 | |
| 6098 | #ifdef LODEPNG_COMPILE_DISK |
| 6099 | unsigned lodepng_encode_file(const char* filename, const unsigned char* image, unsigned w, unsigned h, |
| 6100 | LodePNGColorType colortype, unsigned bitdepth) { |
| 6101 | unsigned char* buffer; |
| 6102 | size_t buffersize; |
| 6103 | unsigned error = lodepng_encode_memory(&buffer, &buffersize, image, w, h, colortype, bitdepth); |
| 6104 | if(!error) error = lodepng_save_file(buffer, buffersize, filename); |
| 6105 | lodepng_free(buffer); |
| 6106 | return error; |
| 6107 | } |
| 6108 | |
| 6109 | unsigned lodepng_encode32_file(const char* filename, const unsigned char* image, unsigned w, unsigned h) { |
| 6110 | return lodepng_encode_file(filename, image, w, h, LCT_RGBA, 8); |
no test coverage detected