Lines Matching refs:palette
397 /* Dither file to 8-bit. Supply a palette, the current number
398 * of elements in the palette, the maximum number of elements
400 * of colors is greater than the maximum number, the palette will be
416 png_set_quantize(png_structrp png_ptr, png_colorp palette,
455 /* Find the least used palette entries by starting a
486 /* Swap the palette around, and set up a table, if necessary */
502 palette[i] = palette[j];
524 tmp_color = palette[j];
525 palette[j] = palette[i];
526 palette[i] = tmp_color;
542 min_d = PNG_COLOR_DIST(palette[d_index], palette[0]);
547 d = PNG_COLOR_DIST(palette[d_index], palette[k]);
581 /* Initialize palette index arrays */
619 d = PNG_COLOR_DIST(palette[i], palette[j]);
668 palette[png_ptr->index_to_palette[j]]
669 = palette[num_new_palette];
732 if (png_ptr->palette == NULL)
734 png_ptr->palette = palette;
760 int r = (palette[i].red >> (8 - PNG_QUANTIZE_RED_BITS));
761 int g = (palette[i].green >> (8 - PNG_QUANTIZE_GREEN_BITS));
762 int b = (palette[i].blue >> (8 - PNG_QUANTIZE_BLUE_BITS));
871 * fully transparent palette entry to a full alpha channel--perhaps instead
1094 * the palette.
1099 * The intent is that these two routines should have palette or rgb operations
1105 /* Called to handle the (input) palette case. In png_do_read_transformations
1106 * the first step is to expand the palette if requested, so this code must
1108 * palette expansion, or only do them if there is no expansion.
1164 png_ptr->palette[png_ptr->background.index].red;
1166 png_ptr->palette[png_ptr->background.index].green;
1168 png_ptr->palette[png_ptr->background.index].blue;
1293 * the tests were repeated for the PALETTE color type here - this is no
1365 * 11) PNG_QUANTIZE (converts to palette)
1469 * can be performed directly on the palette, and some (such as rgb to gray)
1470 * can be optimized inside the palette. This is particularly true of the
1472 * in the palette even if the result is expanded to RGB or gray afterward.
1475 * earlier and the palette stuff is actually handled on the first row. This
1476 * leads to the reported bug that the palette returned by png_get_PLTE is not
1547 /* This needs to change - in the palette image case a whole set of tables are
1549 * each palette entry directly. Also, the test is too tricky - why check
1595 png_colorp palette = png_ptr->palette;
1679 palette[i] = back;
1685 v = png_ptr->gamma_to_1[palette[i].red];
1687 palette[i].red = png_ptr->gamma_from_1[w];
1689 v = png_ptr->gamma_to_1[palette[i].green];
1691 palette[i].green = png_ptr->gamma_from_1[w];
1693 v = png_ptr->gamma_to_1[palette[i].blue];
1695 palette[i].blue = png_ptr->gamma_from_1[w];
1700 palette[i].red = png_ptr->gamma_table[palette[i].red];
1701 palette[i].green = png_ptr->gamma_table[palette[i].green];
1702 palette[i].blue = png_ptr->gamma_table[palette[i].blue];
1812 png_colorp palette = png_ptr->palette;
1821 palette[i].red = png_ptr->gamma_table[palette[i].red];
1822 palette[i].green = png_ptr->gamma_table[palette[i].green];
1823 palette[i].blue = png_ptr->gamma_table[palette[i].blue];
1828 } /* color_type == PALETTE && !PNG_BACKGROUND transformation */
1843 png_colorp palette = png_ptr->palette;
1853 palette[i] = back;
1859 png_composite(palette[i].red, palette[i].red,
1862 png_composite(palette[i].green, palette[i].green,
1865 png_composite(palette[i].blue, palette[i].blue,
1892 int component = png_ptr->palette[i].red;
1895 png_ptr->palette[i].red = (png_byte)component;
1902 int component = png_ptr->palette[i].green;
1905 png_ptr->palette[i].green = (png_byte)component;
1912 int component = png_ptr->palette[i].blue;
1915 png_ptr->palette[i].blue = (png_byte)component;
1948 if (png_ptr->palette == NULL)
1949 png_error (png_ptr, "Palette is NULL in indexed image");
2243 /* The palette case has already been handled in the _init routine. */
4193 /* Expands a palette row to an RGB or RGBA row depending
4198 png_const_colorp palette, png_const_bytep trans_alpha, int num_trans)
4310 *dp-- = palette[*sp].blue;
4311 *dp-- = palette[*sp].green;
4312 *dp-- = palette[*sp].red;
4329 *dp-- = palette[*sp].blue;
4330 *dp-- = palette[*sp].green;
4331 *dp-- = palette[*sp].red;
4578 /* If the bit depth is 8 and the color type is not a palette type expand the
4742 png_ptr->palette, png_ptr->trans_alpha, png_ptr->num_trans);
4850 /* Because png_init_read_transformations transforms the palette, unless