| 241 | VARP(pngcompress, 0, 9, 9); |
| 242 | |
| 243 | void writepngchunk(stream *f, const char *type, const void *data = NULL, uint len = 0) |
| 244 | { |
| 245 | f->putbig<uint>(len); |
| 246 | f->write(type, 4); |
| 247 | if(data) f->write(data, len); |
| 248 | |
| 249 | uint crc = crc32(0, Z_NULL, 0); |
| 250 | crc = ~crc32(crc, (const Bytef *)type, 4); |
| 251 | if(data) loopi(len) enet_crc32_inc(&crc, ((const uchar *)data)[i]); |
| 252 | f->putbig<uint>(~crc); |
| 253 | } |
| 254 | |
| 255 | int save_png(const char *filename, SDL_Surface *image) |
| 256 | { |
no test coverage detected