Lines Matching refs:palette
122 /* Dither file to 8 bit. Supply a palette, the current number
123 * of elements in the palette, the maximum number of elements
125 * of colors is greater then the maximum number, the palette will be
141 png_set_dither(png_structp png_ptr, png_colorp palette,
176 /* Find the least used palette entries by starting a
205 /* swap the palette around, and set up a table, if necessary */
219 palette[i] = palette[j];
240 tmp_color = palette[j];
241 palette[j] = palette[i];
242 palette[i] = tmp_color;
258 min_d = PNG_COLOR_DIST(palette[d_index], palette[0]);
263 d = PNG_COLOR_DIST(palette[d_index], palette[k]);
297 /* initialize palette index arrays */
338 d = PNG_COLOR_DIST(palette[i], palette[j]);
385 palette[png_ptr->index_to_palette[j]]
386 = palette[num_new_palette];
444 if (png_ptr->palette == NULL)
446 png_ptr->palette = palette;
475 int r = (palette[i].red >> (8 - PNG_DITHER_RED_BITS));
476 int g = (palette[i].green >> (8 - PNG_DITHER_GREEN_BITS));
477 int b = (palette[i].blue >> (8 - PNG_DITHER_BLUE_BITS));
523 * are present in the tRNS array for palette images. We can't do it here
559 * fully transparent palette entry to a full alpha channel--perhaps instead
723 * the palette.
816 png_ptr->palette[png_ptr->background.index].red;
818 png_ptr->palette[png_ptr->background.index].green;
820 png_ptr->palette[png_ptr->background.index].blue;
875 png_colorp palette = png_ptr->palette;
941 palette[i] = back;
947 v = png_ptr->gamma_to_1[palette[i].red];
949 palette[i].red = png_ptr->gamma_from_1[w];
951 v = png_ptr->gamma_to_1[palette[i].green];
953 palette[i].green = png_ptr->gamma_from_1[w];
955 v = png_ptr->gamma_to_1[palette[i].blue];
957 palette[i].blue = png_ptr->gamma_from_1[w];
962 palette[i].red = png_ptr->gamma_table[palette[i].red];
963 palette[i].green = png_ptr->gamma_table[palette[i].green];
964 palette[i].blue = png_ptr->gamma_table[palette[i].blue];
1031 png_colorp palette = png_ptr->palette;
1037 palette[i].red = png_ptr->gamma_table[palette[i].red];
1038 palette[i].green = png_ptr->gamma_table[palette[i].green];
1039 palette[i].blue = png_ptr->gamma_table[palette[i].blue];
1055 png_colorp palette = png_ptr->palette;
1065 palette[i] = back;
1070 png_composite(palette[i].red, palette[i].red,
1072 png_composite(palette[i].green, palette[i].green,
1074 png_composite(palette[i].blue, palette[i].blue,
1099 png_ptr->palette[i].red >>= sr;
1100 png_ptr->palette[i].green >>= sg;
1101 png_ptr->palette[i].blue >>= sb;
1293 png_ptr->palette, png_ptr->trans, png_ptr->num_trans);
2456 /* Build a grayscale palette. Palette is assumed to be 1 << bit_depth
2462 png_build_grayscale_palette(int bit_depth, png_colorp palette)
2470 if (palette == NULL)
2499 palette[i].red = (png_byte)v;
2500 palette[i].green = (png_byte)v;
2501 palette[i].blue = (png_byte)v;
2508 png_correct_palette(png_structp png_ptr, png_colorp palette,
2575 palette[i] = back;
2581 v = png_ptr->gamma_to_1[png_ptr->palette[i].red];
2583 palette[i].red = png_ptr->gamma_from_1[w];
2585 v = png_ptr->gamma_to_1[png_ptr->palette[i].green];
2587 palette[i].green = png_ptr->gamma_from_1[w];
2589 v = png_ptr->gamma_to_1[png_ptr->palette[i].blue];
2591 palette[i].blue = png_ptr->gamma_from_1[w];
2595 palette[i].red = png_ptr->gamma_table[palette[i].red];
2596 palette[i].green = png_ptr->gamma_table[palette[i].green];
2597 palette[i].blue = png_ptr->gamma_table[palette[i].blue];
2607 if (palette[i].red == (png_byte)png_ptr->trans_values.gray)
2609 palette[i] = back;
2613 palette[i].red = png_ptr->gamma_table[palette[i].red];
2614 palette[i].green = png_ptr->gamma_table[palette[i].green];
2615 palette[i].blue = png_ptr->gamma_table[palette[i].blue];
2629 palette[i].red = png_ptr->gamma_table[palette[i].red];
2630 palette[i].green = png_ptr->gamma_table[palette[i].green];
2631 palette[i].blue = png_ptr->gamma_table[palette[i].blue];
2653 palette[i].red = back.red;
2654 palette[i].green = back.green;
2655 palette[i].blue = back.blue;
2659 png_composite(palette[i].red, png_ptr->palette[i].red,
2661 png_composite(palette[i].green, png_ptr->palette[i].green,
2663 png_composite(palette[i].blue, png_ptr->palette[i].blue,
2668 else /* assume grayscale palette (what else could it be?) */
2676 palette[i].red = (png_byte)png_ptr->background.red;
2677 palette[i].green = (png_byte)png_ptr->background.green;
2678 palette[i].blue = (png_byte)png_ptr->background.blue;
3560 /* Expands a palette row to an RGB or RGBA row depending
3565 png_colorp palette, png_bytep trans, int num_trans)
3668 *dp-- = palette[*sp].blue;
3669 *dp-- = palette[*sp].green;
3670 *dp-- = palette[*sp].red;
3686 *dp-- = palette[*sp].blue;
3687 *dp-- = palette[*sp].green;
3688 *dp-- = palette[*sp].red;