v2 / thirdparty / stb_image / stbi.c
39 lines · 30 sloc · 1.09 KB · 97e1b24d307524675dda8f2f091f80fdb1f39437
Raw
1#define STB_IMAGE_IMPLEMENTATION
2#define STB_IMAGE_WRITE_IMPLEMENTATION
3#define STB_IMAGE_RESIZE_IMPLEMENTATION
4
5#include <stddef.h>
6
7extern void * stbi__callback_malloc(size_t size);
8extern void * stbi__callback_realloc(void *ptr, size_t size);
9extern 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/*
23void set_png_compression_level(int level);
24void write_force_png_filter(int level);
25void write_tga_with_rle(int level);
26*/
27
28void set_png_compression_level(int level) {
29 stbi_write_png_compression_level = level;
30}
31
32void write_force_png_filter(int level){
33 stbi_write_force_png_filter = level;
34}
35
36void write_tga_with_rle(int level) {
37 stbi_write_tga_with_rle = level;
38}
39
40