| 1 | #define STB_IMAGE_IMPLEMENTATION |
| 2 | #define STB_IMAGE_WRITE_IMPLEMENTATION |
| 3 | #define STB_IMAGE_RESIZE_IMPLEMENTATION |
| 4 | |
| 5 | #include <stddef.h> |
| 6 | |
| 7 | extern void * stbi__callback_malloc(size_t size); |
| 8 | extern void * stbi__callback_realloc(void *ptr, size_t size); |
| 9 | extern void stbi__callback_free(void *ptr); |
| 10 | |
| 11 | #define STBI_MALLOC(sz) stbi__callback_malloc(sz) |
| 12 | #define STBI_REALLOC(p,newsz) stbi__callback_realloc(p,newsz) |
| 13 | #define STBI_FREE(p) stbi__callback_free(p) |
| 14 | #define STBIW_MALLOC(sz) stbi__callback_malloc(sz) |
| 15 | #define STBIW_REALLOC(p,newsz) stbi__callback_realloc(p,newsz) |
| 16 | #define STBIW_FREE(p) stbi__callback_free(p) |
| 17 | |
| 18 | #include "stb_image.h" |
| 19 | #include "stb_image_write.h" |
| 20 | #include "stb_image_resize2.h" |
| 21 | |
| 22 | /* |
| 23 | void set_png_compression_level(int level); |
| 24 | void write_force_png_filter(int level); |
| 25 | void write_tga_with_rle(int level); |
| 26 | */ |
| 27 | |
| 28 | void set_png_compression_level(int level) { |
| 29 | stbi_write_png_compression_level = level; |
| 30 | } |
| 31 | |
| 32 | void write_force_png_filter(int level){ |
| 33 | stbi_write_force_png_filter = level; |
| 34 | } |
| 35 | |
| 36 | void write_tga_with_rle(int level) { |
| 37 | stbi_write_tga_with_rle = level; |
| 38 | } |
| 39 | |
| 40 | |