Lines Matching refs:palette
145 /* Dither file to 8 bit. Supply a palette, the current number
146 * of elements in the palette, the maximum number of elements
148 * of colors is greater then the maximum number, the palette will be
164 png_set_dither(png_structp png_ptr, png_colorp palette,
202 /* Find the least used palette entries by starting a
232 /* Swap the palette around, and set up a table, if necessary */
247 palette[i] = palette[j];
269 tmp_color = palette[j];
270 palette[j] = palette[i];
271 palette[i] = tmp_color;
287 min_d = PNG_COLOR_DIST(palette[d_index], palette[0]);
292 d = PNG_COLOR_DIST(palette[d_index], palette[k]);
326 /* Initialize palette index arrays */
364 d = PNG_COLOR_DIST(palette[i], palette[j]);
411 palette[png_ptr->index_to_palette[j]]
412 = palette[num_new_palette];
472 if (png_ptr->palette == NULL)
474 png_ptr->palette = palette;
499 int r = (palette[i].red >> (8 - PNG_DITHER_RED_BITS));
500 int g = (palette[i].green >> (8 - PNG_DITHER_GREEN_BITS));
501 int b = (palette[i].blue >> (8 - PNG_DITHER_BLUE_BITS));
548 * are present in the tRNS array for palette images. We can't do it here
588 * fully transparent palette entry to a full alpha channel--perhaps instead
778 * the palette.
878 png_ptr->palette[png_ptr->background.index].red;
880 png_ptr->palette[png_ptr->background.index].green;
882 png_ptr->palette[png_ptr->background.index].blue;
938 png_colorp palette = png_ptr->palette;
1007 palette[i] = back;
1013 v = png_ptr->gamma_to_1[palette[i].red];
1015 palette[i].red = png_ptr->gamma_from_1[w];
1017 v = png_ptr->gamma_to_1[palette[i].green];
1019 palette[i].green = png_ptr->gamma_from_1[w];
1021 v = png_ptr->gamma_to_1[palette[i].blue];
1023 palette[i].blue = png_ptr->gamma_from_1[w];
1028 palette[i].red = png_ptr->gamma_table[palette[i].red];
1029 palette[i].green = png_ptr->gamma_table[palette[i].green];
1030 palette[i].blue = png_ptr->gamma_table[palette[i].blue];
1107 png_colorp palette = png_ptr->palette;
1113 palette[i].red = png_ptr->gamma_table[palette[i].red];
1114 palette[i].green = png_ptr->gamma_table[palette[i].green];
1115 palette[i].blue = png_ptr->gamma_table[palette[i].blue];
1134 png_colorp palette = png_ptr->palette;
1144 palette[i] = back;
1149 png_composite(palette[i].red, palette[i].red,
1151 png_composite(palette[i].green, palette[i].green,
1153 png_composite(palette[i].blue, palette[i].blue,
1182 png_ptr->palette[i].red >>= sr;
1183 png_ptr->palette[i].green >>= sg;
1184 png_ptr->palette[i].blue >>= sb;
1377 png_ptr->palette, png_ptr->trans, png_ptr->num_trans);
2563 /* Build a grayscale palette. Palette is assumed to be 1 << bit_depth
2569 png_build_grayscale_palette(int bit_depth, png_colorp palette)
2578 if (palette == NULL)
2611 palette[i].red = (png_byte)v;
2612 palette[i].green = (png_byte)v;
2613 palette[i].blue = (png_byte)v;
2621 png_correct_palette(png_structp png_ptr, png_colorp palette,
2690 palette[i] = back;
2696 v = png_ptr->gamma_to_1[png_ptr->palette[i].red];
2698 palette[i].red = png_ptr->gamma_from_1[w];
2700 v = png_ptr->gamma_to_1[png_ptr->palette[i].green];
2702 palette[i].green = png_ptr->gamma_from_1[w];
2704 v = png_ptr->gamma_to_1[png_ptr->palette[i].blue];
2706 palette[i].blue = png_ptr->gamma_from_1[w];
2710 palette[i].red = png_ptr->gamma_table[palette[i].red];
2711 palette[i].green = png_ptr->gamma_table[palette[i].green];
2712 palette[i].blue = png_ptr->gamma_table[palette[i].blue];
2722 if (palette[i].red == (png_byte)png_ptr->trans_values.gray)
2724 palette[i] = back;
2728 palette[i].red = png_ptr->gamma_table[palette[i].red];
2729 palette[i].green = png_ptr->gamma_table[palette[i].green];
2730 palette[i].blue = png_ptr->gamma_table[palette[i].blue];
2744 palette[i].red = png_ptr->gamma_table[palette[i].red];
2745 palette[i].green = png_ptr->gamma_table[palette[i].green];
2746 palette[i].blue = png_ptr->gamma_table[palette[i].blue];
2768 palette[i].red = back.red;
2769 palette[i].green = back.green;
2770 palette[i].blue = back.blue;
2774 png_composite(palette[i].red, png_ptr->palette[i].red,
2776 png_composite(palette[i].green, png_ptr->palette[i].green,
2778 png_composite(palette[i].blue, png_ptr->palette[i].blue,
2783 else /* Assume grayscale palette (what else could it be?) */
2791 palette[i].red = (png_byte)png_ptr->background.red;
2792 palette[i].green = (png_byte)png_ptr->background.green;
2793 palette[i].blue = (png_byte)png_ptr->background.blue;
3690 /* Expands a palette row to an RGB or RGBA row depending
3695 png_colorp palette, png_bytep trans, int num_trans)
3801 *dp-- = palette[*sp].blue;
3802 *dp-- = palette[*sp].green;
3803 *dp-- = palette[*sp].red;
3819 *dp-- = palette[*sp].blue;
3820 *dp-- = palette[*sp].green;
3821 *dp-- = palette[*sp].red;