Lines Matching refs:palette
409 /* Dither file to 8-bit. Supply a palette, the current number
410 * of elements in the palette, the maximum number of elements
412 * of colors is greater than the maximum number, the palette will be
428 png_set_quantize(png_structrp png_ptr, png_colorp palette,
467 /* Find the least used palette entries by starting a
498 /* Swap the palette around, and set up a table, if necessary */
514 palette[i] = palette[j];
536 tmp_color = palette[j];
537 palette[j] = palette[i];
538 palette[i] = tmp_color;
554 min_d = PNG_COLOR_DIST(palette[d_index], palette[0]);
559 d = PNG_COLOR_DIST(palette[d_index], palette[k]);
593 /* Initialize palette index arrays */
633 d = PNG_COLOR_DIST(palette[i], palette[j]);
682 palette[png_ptr->index_to_palette[j]]
683 = palette[num_new_palette];
746 if (png_ptr->palette == NULL)
748 png_ptr->palette = palette;
774 int r = (palette[i].red >> (8 - PNG_QUANTIZE_RED_BITS));
775 int g = (palette[i].green >> (8 - PNG_QUANTIZE_GREEN_BITS));
776 int b = (palette[i].blue >> (8 - PNG_QUANTIZE_BLUE_BITS));
885 * fully transparent palette entry to a full alpha channel--perhaps instead
1108 * the palette.
1113 * The intent is that these two routines should have palette or rgb operations
1119 /* Called to handle the (input) palette case. In png_do_read_transformations
1120 * the first step is to expand the palette if requested, so this code must
1122 * palette expansion, or only do them if there is no expansion.
1178 png_ptr->palette[png_ptr->background.index].red;
1180 png_ptr->palette[png_ptr->background.index].green;
1182 png_ptr->palette[png_ptr->background.index].blue;
1379 * 11) PNG_QUANTIZE (converts to palette)
1483 * can be performed directly on the palette, and some (such as rgb to gray)
1484 * can be optimized inside the palette. This is particularly true of the
1486 * in the palette even if the result is expanded to RGB or gray afterward.
1489 * earlier and the palette stuff is actually handled on the first row. This
1490 * leads to the reported bug that the palette returned by png_get_PLTE is not
1561 /* This needs to change - in the palette image case a whole set of tables are
1563 * each palette entry directly. Also, the test is too tricky - why check
1609 png_colorp palette = png_ptr->palette;
1693 palette[i] = back;
1699 v = png_ptr->gamma_to_1[palette[i].red];
1701 palette[i].red = png_ptr->gamma_from_1[w];
1703 v = png_ptr->gamma_to_1[palette[i].green];
1705 palette[i].green = png_ptr->gamma_from_1[w];
1707 v = png_ptr->gamma_to_1[palette[i].blue];
1709 palette[i].blue = png_ptr->gamma_from_1[w];
1714 palette[i].red = png_ptr->gamma_table[palette[i].red];
1715 palette[i].green = png_ptr->gamma_table[palette[i].green];
1716 palette[i].blue = png_ptr->gamma_table[palette[i].blue];
1826 png_colorp palette = png_ptr->palette;
1835 palette[i].red = png_ptr->gamma_table[palette[i].red];
1836 palette[i].green = png_ptr->gamma_table[palette[i].green];
1837 palette[i].blue = png_ptr->gamma_table[palette[i].blue];
1857 png_colorp palette = png_ptr->palette;
1867 palette[i] = back;
1873 png_composite(palette[i].red, palette[i].red,
1876 png_composite(palette[i].green, palette[i].green,
1879 png_composite(palette[i].blue, palette[i].blue,
1906 int component = png_ptr->palette[i].red;
1909 png_ptr->palette[i].red = (png_byte)component;
1916 int component = png_ptr->palette[i].green;
1919 png_ptr->palette[i].green = (png_byte)component;
1926 int component = png_ptr->palette[i].blue;
1929 png_ptr->palette[i].blue = (png_byte)component;
1962 if (png_ptr->palette == NULL)
2257 /* The palette case has already been handled in the _init routine. */
4205 /* Expands a palette row to an RGB or RGBA row depending
4210 png_bytep row, png_const_colorp palette, png_const_bytep trans_alpha,
4321 * In these cases, the palette hasn't been riffled.
4336 *dp-- = palette[*sp].blue;
4337 *dp-- = palette[*sp].green;
4338 *dp-- = palette[*sp].red;
4362 *dp-- = palette[*sp].blue;
4363 *dp-- = palette[*sp].green;
4364 *dp-- = palette[*sp].red;
4609 /* If the bit depth is 8 and the color type is not a palette type expand the
4779 /* Initialize the accelerated palette expansion. */
4787 png_ptr->palette, png_ptr->trans_alpha, png_ptr->num_trans);
4894 /* Because png_init_read_transformations transforms the palette, unless