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

Function stbi__out_gif_code

include/stb/stb_image.h:6654–6689  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6652}
6653
6654static void stbi__out_gif_code(stbi__gif *g, stbi__uint16 code)
6655{
6656 stbi_uc *p, *c;
6657 int idx;
6658
6659 // recurse to decode the prefixes, since the linked-list is backwards,
6660 // and working backwards through an interleaved image would be nasty
6661 if (g->codes[code].prefix >= 0)
6662 stbi__out_gif_code(g, g->codes[code].prefix);
6663
6664 if (g->cur_y >= g->max_y) return;
6665
6666 idx = g->cur_x + g->cur_y;
6667 p = &g->out[idx];
6668 g->history[idx / 4] = 1;
6669
6670 c = &g->color_table[g->codes[code].suffix * 4];
6671 if (c[3] > 128) { // don't render transparent pixels;
6672 p[0] = c[2];
6673 p[1] = c[1];
6674 p[2] = c[0];
6675 p[3] = c[3];
6676 }
6677 g->cur_x += 4;
6678
6679 if (g->cur_x >= g->max_x) {
6680 g->cur_x = g->start_x;
6681 g->cur_y += g->step;
6682
6683 while (g->cur_y >= g->max_y && g->parse > 0) {
6684 g->step = (1 << g->parse) * g->line_size;
6685 g->cur_y = g->start_y + (g->step >> 1);
6686 --g->parse;
6687 }
6688 }
6689}
6690
6691static stbi_uc *stbi__process_gif_raster(stbi__context *s, stbi__gif *g)
6692{

Callers 1

stbi__process_gif_rasterFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected