MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / stbi__gif_load

Function stbi__gif_load

include/stb/stb_image.h:7048–7075  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7046}
7047
7048static void *stbi__gif_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri)
7049{
7050 stbi_uc *u = 0;
7051 stbi__gif g;
7052 memset(&g, 0, sizeof(g));
7053 STBI_NOTUSED(ri);
7054
7055 u = stbi__gif_load_next(s, &g, comp, req_comp, 0);
7056 if (u == (stbi_uc *) s) u = 0; // end of animated gif marker
7057 if (u) {
7058 *x = g.w;
7059 *y = g.h;
7060
7061 // moved conversion to after successful load so that the same
7062 // can be done for multiple frames.
7063 if (req_comp && req_comp != 4)
7064 u = stbi__convert_format(u, 4, req_comp, g.w, g.h);
7065 } else if (g.out) {
7066 // if there was an error and we allocated an image buffer, free it!
7067 STBI_FREE(g.out);
7068 }
7069
7070 // free buffers needed for multiple frame loading;
7071 STBI_FREE(g.history);
7072 STBI_FREE(g.background);
7073
7074 return u;
7075}
7076
7077static int stbi__gif_info(stbi__context *s, int *x, int *y, int *comp)
7078{

Callers 1

stbi__load_mainFunction · 0.85

Calls 2

stbi__gif_load_nextFunction · 0.85
stbi__convert_formatFunction · 0.85

Tested by

no test coverage detected