Browse Source

Added gif loading using callbacks.

Brucey 3 years ago
parent
commit
19fb4fd1cf
1 changed files with 14 additions and 0 deletions
  1. 14 0
      stb.mod/stb/stb_image.h

+ 14 - 0
stb.mod/stb/stb_image.h

@@ -428,6 +428,7 @@ STBIDEF stbi_uc *stbi_load_from_file  (FILE *f, int *x, int *y, int *channels_in
 
 #ifndef STBI_NO_GIF
 STBIDEF stbi_uc *stbi_load_gif_from_memory(stbi_uc const *buffer, int len, int **delays, int *x, int *y, int *z, int *comp, int req_comp);
+STBIDEF stbi_uc *stbi_load_gif_from_callbacks(stbi_io_callbacks const *clbk, void *user, int **delays, int *x, int *y, int *z, int *comp, int req_comp);
 #endif
 
 #ifdef STBI_WINDOWS_UTF8
@@ -1434,6 +1435,19 @@ STBIDEF stbi_uc *stbi_load_gif_from_memory(stbi_uc const *buffer, int len, int *
 
    return result;
 }
+STBIDEF stbi_uc *stbi_load_gif_from_callbacks(stbi_io_callbacks const *clbk, void *user, int **delays, int *x, int *y, int *z, int *comp, int req_comp)
+{
+   unsigned char *result;
+   stbi__context s;
+   stbi__start_callbacks(&s, (stbi_io_callbacks *) clbk, user);
+
+   result = (unsigned char*) stbi__load_gif_main(&s, delays, x, y, z, comp, req_comp);
+   if (stbi__vertically_flip_on_load) {
+      stbi__vertical_flip_slices( result, *x, *y, *z, *comp );
+   }
+
+   return result;
+}
 #endif
 
 #ifndef STBI_NO_LINEAR