Lines Matching refs:palette
2675 info->palette = 0; in lodepng_color_mode_init()
2684 if(!info->palette) info->palette = (unsigned char*)lodepng_malloc(1024); in lodepng_color_mode_alloc_palette()
2685 if(!info->palette) return; /*alloc fail*/ in lodepng_color_mode_alloc_palette()
2690 info->palette[i * 4 + 0] = 0; in lodepng_color_mode_alloc_palette()
2691 info->palette[i * 4 + 1] = 0; in lodepng_color_mode_alloc_palette()
2692 info->palette[i * 4 + 2] = 0; in lodepng_color_mode_alloc_palette()
2693 info->palette[i * 4 + 3] = 255; in lodepng_color_mode_alloc_palette()
2704 if(source->palette) { in lodepng_color_mode_copy()
2705 dest->palette = (unsigned char*)lodepng_malloc(1024); in lodepng_color_mode_copy()
2706 if(!dest->palette && source->palettesize) return 83; /*alloc fail*/ in lodepng_color_mode_copy()
2707 lodepng_memcpy(dest->palette, source->palette, source->palettesize * 4); in lodepng_color_mode_copy()
2732 if(a->palette[i] != b->palette[i]) return 0; in lodepng_color_mode_equal()
2738 if(info->palette) lodepng_free(info->palette); in lodepng_palette_clear()
2739 info->palette = 0; in lodepng_palette_clear()
2745 if(!info->palette) /*allocate palette if empty*/ { in lodepng_palette_add()
2747 if(!info->palette) return 83; /*alloc fail*/ in lodepng_palette_add()
2752 info->palette[4 * info->palettesize + 0] = r; in lodepng_palette_add()
2753 info->palette[4 * info->palettesize + 1] = g; in lodepng_palette_add()
2754 info->palette[4 * info->palettesize + 2] = b; in lodepng_palette_add()
2755 info->palette[4 * info->palettesize + 3] = a; in lodepng_palette_add()
2784 if(info->palette[i * 4 + 3] < 255) return 1; in lodepng_has_palette_alpha()
3300 *r = mode->palette[index * 4 + 0]; in getPixelColorRGBA8()
3301 *g = mode->palette[index * 4 + 1]; in getPixelColorRGBA8()
3302 *b = mode->palette[index * 4 + 2]; in getPixelColorRGBA8()
3303 *a = mode->palette[index * 4 + 3]; in getPixelColorRGBA8()
3390 lodepng_memcpy(buffer, &mode->palette[index * 4], 4); in getPixelColorsRGBA8()
3397 lodepng_memcpy(buffer, &mode->palette[index * 4], 4); in getPixelColorsRGBA8()
3464 lodepng_memcpy(buffer, &mode->palette[index * 4], 3); in getPixelColorsRGB8()
3471 lodepng_memcpy(buffer, &mode->palette[index * 4], 3); in getPixelColorsRGB8()
3535 if(mode_in->colortype == LCT_PALETTE && !mode_in->palette) { in lodepng_convert()
3547 const unsigned char* palette = mode_out->palette; in lodepng_convert() local
3554 palette = mode_in->palette; in lodepng_convert()
3567 const unsigned char* p = &palette[i * 4]; in lodepng_convert()
3624 r = mode_in->palette[r_in * 4 + 0] * 257u; in lodepng_convert_rgb()
3625 g = mode_in->palette[r_in * 4 + 1] * 257u; in lodepng_convert_rgb()
3626 b = mode_in->palette[r_in * 4 + 2] * 257u; in lodepng_convert_rgb()
3644 if((r >> 8) == mode_out->palette[j + 0] && (g >> 8) == mode_out->palette[j + 1] && in lodepng_convert_rgb()
3645 (b >> 8) == mode_out->palette[j + 2]) { in lodepng_convert_rgb()
3730 const unsigned char* color = &stats->palette[i * 4]; in lodepng_compute_color_stats()
3839 unsigned char* p = stats->palette; in lodepng_compute_color_stats()
3938 const unsigned char* p = stats->palette; in auto_choose_color()
4357 if(!color->palette && color->palettesize) { in readChunk_PLTE()
4363 color->palette[4 * i + 0] = data[pos++]; /*R*/ in readChunk_PLTE()
4364 color->palette[4 * i + 1] = data[pos++]; /*G*/ in readChunk_PLTE()
4365 color->palette[4 * i + 2] = data[pos++]; /*B*/ in readChunk_PLTE()
4366 color->palette[4 * i + 3] = 255; /*alpha*/ in readChunk_PLTE()
4378 for(i = 0; i != chunkLength; ++i) color->palette[4 * i + 3] = data[i]; in readChunk_tRNS()
4914 …state->error && state->info_png.color.colortype == LCT_PALETTE && !state->info_png.color.palette) { in decodeGeneric()
5129 chunk[j++] = info->palette[i * 4 + 0]; in addChunk_PLTE()
5130 chunk[j++] = info->palette[i * 4 + 1]; in addChunk_PLTE()
5131 chunk[j++] = info->palette[i * 4 + 2]; in addChunk_PLTE()
5145 if(info->palette[4 * (i - 1) + 3] != 255) break; in addChunk_tRNS()
5151 for(i = 0; i != amount; ++i) chunk[8 + i] = info->palette[4 * i + 3]; in addChunk_tRNS()