igl_stb_image.cpp 600 B

123456789101112131415161718192021222324
  1. #include "igl_stb_image.h"
  2. #define STB_IMAGE_IMPLEMENTATION
  3. #include "stb_image.h"
  4. #define STB_IMAGE_WRITE_IMPLEMENTATION
  5. #include "stb_image_write.h"
  6. unsigned char * igl::stbi_load(char const *filename, int *x, int *y, int *comp, int req_comp)
  7. {
  8. return ::stbi_load(filename, x, y, comp, req_comp);
  9. }
  10. void igl::stbi_image_free(void *retval_from_stbi_load)
  11. {
  12. ::stbi_image_free(retval_from_stbi_load);
  13. }
  14. int igl::stbi_write_png(
  15. char const *filename, int w, int h, int comp, const void *data, int stride_in_bytes)
  16. {
  17. return ::stbi_write_png(filename, w, h, comp, data, stride_in_bytes);
  18. }