make_stb.cpp 851 B

12345678910111213141516171819202122232425262728
  1. #include "defines.h"
  2. #include <string>
  3. #include <stdint.h>
  4. #include "psram.h"
  5. #define USE_SHARED_PSRAM_FOR_STBI
  6. #ifdef USE_SHARED_PSRAM_FOR_STBI
  7. #define STBI_MALLOC(sz) psram_reserve_shared_stbi_memory(sz)
  8. #define STBI_REALLOC(p, newsz) psram_reallocate_shared_stbi_memory(p, newsz)
  9. #define STBI_FREE(p) psram_free_shared_stbi_memory(p)
  10. #else // Use normal PSRAM
  11. #define STBI_MALLOC(sz) malloc_psram_heap("STBI", sz, MALLOC_CAP_SPIRAM)
  12. #define STBI_REALLOC(p, newsz) realloc_psram_heap("STBI", p, newsz, MALLOC_CAP_SPIRAM)
  13. #define STBI_FREE(p) free_psram_heap("STBI", p)
  14. #endif
  15. #define STB_IMAGE_IMPLEMENTATION
  16. #include "../stb/stb_image.h"
  17. #define STB_IMAGE_WRITE_IMPLEMENTATION
  18. #include "../stb/stb_image_write.h"
  19. #define STB_IMAGE_RESIZE_IMPLEMENTATION
  20. // #include "../stb/deprecated/stb_image_resize.h"
  21. #include "../stb/stb_image_resize.h"