需要包含的头文件
#include "stb/stb_image.h"
#include "stb/stb_image_write.h"
函数原型
typedef void stbi_write_func(void *context, void *data, int size);
STBIWDEF int stbi_write_png_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const void *data, int stride_in_bytes);
STBIWDEF int stbi_write_bmp_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const void *data);
STBIWDEF int stbi_write_tga_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const void *data);
STBIWDEF int stbi_write_hdr_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const float *data);
renderdoc集成stbi image的方法,在renderdoc/3rdparty/stb/stb_impl.c中
// Implementation file for stb headers - public domain - https://github.com/nothings/stb
#define STB_IMAGE_IMPLEMENTATION
#define STBI_ASSERT(x)
#define STB_IMAGE_WRITE_IMPLEMENTATION
#define STBIW_ASSERT(x)
#define STB_IMAGE_RESIZE_IMPLEMENTATION
#define STBIR_ASSERT(x)