Lines Matching refs:background

120 /* Handle alpha and tRNS via a background color */
133 png_warning(png_ptr, "Application must supply a known background gamma");
141 png_memcpy(&(png_ptr->background), background_color,
357 /* Finally, if pre-multiplying, set the background fields to achieve the
363 png_memset(&png_ptr->background, 0, sizeof png_ptr->background);
370 "conflicting calls to set alpha mode and background");
813 * disabled in background handling. There is no evidence (so far) that this
1130 /* Any alpha means background and associative alpha processing is
1143 * background color is in the file format or the screen format in the case
1154 png_ptr->background.red =
1155 png_ptr->palette[png_ptr->background.index].red;
1156 png_ptr->background.green =
1157 png_ptr->palette[png_ptr->background.index].green;
1158 png_ptr->background.blue =
1159 png_ptr->palette[png_ptr->background.index].blue;
1178 } /* background expand and (therefore) no alpha association. */
1187 * background and alpha mode stuff if there isn't.
1195 /* Any alpha means background and associative alpha processing is
1210 * background color is in the file format or the screen format in the case
1223 /* Expand background and tRNS chunks */
1227 png_ptr->background.gray *= (png_uint_16)0xff;
1228 png_ptr->background.red = png_ptr->background.green
1229 = png_ptr->background.blue = png_ptr->background.gray;
1239 png_ptr->background.gray *= (png_uint_16)0x55;
1240 png_ptr->background.red = png_ptr->background.green
1241 = png_ptr->background.blue = png_ptr->background.gray;
1251 png_ptr->background.gray *= (png_uint_16)0x11;
1252 png_ptr->background.red = png_ptr->background.green
1253 = png_ptr->background.blue = png_ptr->background.gray;
1267 png_ptr->background.red = png_ptr->background.green
1268 = png_ptr->background.blue = png_ptr->background.gray;
1272 } /* background expand and (therefore) no alpha association. */
1414 /* Detect gray background and attempt to enable optimization for
1419 * background color might actually be gray yet not be flagged as such.
1425 * interdependencies. The color type of the background should be recorded in
1427 * of exactly what color space the background is currently in.
1431 /* PNG_BACKGROUND_EXPAND: the background is in the file color space, so if
1432 * the file was greyscale the background value is gray.
1447 if (png_ptr->background.red == png_ptr->background.green &&
1448 png_ptr->background.red == png_ptr->background.blue)
1451 png_ptr->background.gray = png_ptr->background.red;
1460 * composite (background and alpha) stuff, which can be pretty much all done
1482 * handling the background color must be 8, not 16, bits deep, but the
1488 * NOTE: this discards the low 16 bits of the user supplied background
1492 CHOP(png_ptr->background.red);
1493 CHOP(png_ptr->background.green);
1494 CHOP(png_ptr->background.blue);
1495 CHOP(png_ptr->background.gray);
1501 * background support (see the comments in scripts/pnglibconf.dfa), this
1511 png_ptr->background_1 = png_ptr->background;
1559 back.red = png_ptr->gamma_table[png_ptr->background.red];
1560 back.green = png_ptr->gamma_table[png_ptr->background.green];
1561 back.blue = png_ptr->gamma_table[png_ptr->background.blue];
1563 back_1.red = png_ptr->gamma_to_1[png_ptr->background.red];
1564 back_1.green = png_ptr->gamma_to_1[png_ptr->background.green];
1565 back_1.blue = png_ptr->gamma_to_1[png_ptr->background.blue];
1597 back.red = png_gamma_8bit_correct(png_ptr->background.red,
1599 back.green = png_gamma_8bit_correct(png_ptr->background.green,
1601 back.blue = png_gamma_8bit_correct(png_ptr->background.blue,
1607 back.red = (png_byte)png_ptr->background.red;
1608 back.green = (png_byte)png_ptr->background.green;
1609 back.blue = (png_byte)png_ptr->background.blue;
1614 back_1.red = png_gamma_8bit_correct(png_ptr->background.red,
1617 png_ptr->background.green, g);
1618 back_1.blue = png_gamma_8bit_correct(png_ptr->background.blue,
1624 back_1.red = (png_byte)png_ptr->background.red;
1625 back_1.green = (png_byte)png_ptr->background.green;
1626 back_1.blue = (png_byte)png_ptr->background.blue;
1698 png_error(png_ptr, "invalid background gamma type");
1702 png_ptr->background.gray, g);
1704 png_ptr->background.gray = png_gamma_correct(png_ptr,
1705 png_ptr->background.gray, gs);
1707 if ((png_ptr->background.red != png_ptr->background.green) ||
1708 (png_ptr->background.red != png_ptr->background.blue) ||
1709 (png_ptr->background.red != png_ptr->background.gray))
1711 /* RGB or RGBA with color background */
1713 png_ptr->background.red, g);
1716 png_ptr->background.green, g);
1719 png_ptr->background.blue, g);
1721 png_ptr->background.red = png_gamma_correct(png_ptr,
1722 png_ptr->background.red, gs);
1724 png_ptr->background.green = png_gamma_correct(png_ptr,
1725 png_ptr->background.green, gs);
1727 png_ptr->background.blue = png_gamma_correct(png_ptr,
1728 png_ptr->background.blue, gs);
1733 /* GRAY, GRAY ALPHA, RGB, or RGBA with gray background */
1737 png_ptr->background.red = png_ptr->background.green
1738 = png_ptr->background.blue = png_ptr->background.gray;
1781 back.red = (png_byte)png_ptr->background.red;
1782 back.green = (png_byte)png_ptr->background.green;
1783 back.blue = (png_byte)png_ptr->background.blue;
1883 /* The following is almost certainly wrong unless the background value is in
1887 info_ptr->background = png_ptr->background;
2131 * with background "in place" if transparent,
2133 * - Gray + alpha -> composite with gray background and remove alpha bytes,
2139 * background "in place" if transparent
2142 * - Gray + alpha -> convert to RGB + alpha, composite with background and
2145 * on gray background)
2149 * in advance if the background was gray or RGB, and position the gray-to-RGB
2154 /* If gray -> RGB, do so now only if background is non-gray; else do later
3430 /* Replace any alpha or transparency with the supplied background color.
3431 * "background" is already in the screen gamma, while "background_1" is
3472 *sp |= (png_byte)(png_ptr->background.gray << shift);
3500 *sp |= (png_byte)(png_ptr->background.gray << shift);
3534 *sp |= (png_byte)(png_ptr->background.gray << shift);
3563 *sp |= (png_byte)(png_ptr->background.gray << shift);
3597 *sp |= (png_byte)(png_ptr->background.gray << shift);
3622 *sp = (png_byte)png_ptr->background.gray;
3635 *sp = (png_byte)png_ptr->background.gray;
3656 *sp = (png_byte)((png_ptr->background.gray >> 8) & 0xff);
3657 *(sp + 1) = (png_byte)(png_ptr->background.gray & 0xff);
3680 *sp = (png_byte)((png_ptr->background.gray >> 8) & 0xff);
3681 *(sp + 1) = (png_byte)(png_ptr->background.gray & 0xff);
3708 *sp = (png_byte)png_ptr->background.red;
3709 *(sp + 1) = (png_byte)png_ptr->background.green;
3710 *(sp + 2) = (png_byte)png_ptr->background.blue;
3731 *sp = (png_byte)png_ptr->background.red;
3732 *(sp + 1) = (png_byte)png_ptr->background.green;
3733 *(sp + 2) = (png_byte)png_ptr->background.blue;
3759 *sp = (png_byte)((png_ptr->background.red >> 8) & 0xff);
3760 *(sp + 1) = (png_byte)(png_ptr->background.red & 0xff);
3761 *(sp + 2) = (png_byte)((png_ptr->background.green >> 8) & 0xff);
3762 *(sp + 3) = (png_byte)(png_ptr->background.green & 0xff);
3763 *(sp + 4) = (png_byte)((png_ptr->background.blue >> 8) & 0xff);
3764 *(sp + 5) = (png_byte)(png_ptr->background.blue & 0xff);
3802 *sp = (png_byte)((png_ptr->background.red >> 8) & 0xff);
3803 *(sp + 1) = (png_byte)(png_ptr->background.red & 0xff);
3804 *(sp + 2) = (png_byte)((png_ptr->background.green >> 8) & 0xff);
3805 *(sp + 3) = (png_byte)(png_ptr->background.green & 0xff);
3806 *(sp + 4) = (png_byte)((png_ptr->background.blue >> 8) & 0xff);
3807 *(sp + 5) = (png_byte)(png_ptr->background.blue & 0xff);
3834 *sp = (png_byte)png_ptr->background.gray;
3858 *sp = (png_byte)png_ptr->background.gray;
3889 *sp = (png_byte)((png_ptr->background.gray >> 8) & 0xff);
3890 *(sp + 1) = (png_byte)(png_ptr->background.gray & 0xff);
3919 *sp = (png_byte)((png_ptr->background.gray >> 8) & 0xff);
3920 *(sp + 1) = (png_byte)(png_ptr->background.gray & 0xff);
3961 *sp = (png_byte)png_ptr->background.red;
3962 *(sp + 1) = (png_byte)png_ptr->background.green;
3963 *(sp + 2) = (png_byte)png_ptr->background.blue;
3997 *sp = (png_byte)png_ptr->background.red;
3998 *(sp + 1) = (png_byte)png_ptr->background.green;
3999 *(sp + 2) = (png_byte)png_ptr->background.blue;
4004 png_composite(*sp, *sp, a, png_ptr->background.red);
4007 png_ptr->background.green);
4010 png_ptr->background.blue);
4047 *sp = (png_byte)((png_ptr->background.red >> 8) & 0xff);
4048 *(sp + 1) = (png_byte)(png_ptr->background.red & 0xff);
4049 *(sp + 2) = (png_byte)((png_ptr->background.green >> 8) & 0xff);
4050 *(sp + 3) = (png_byte)(png_ptr->background.green & 0xff);
4051 *(sp + 4) = (png_byte)((png_ptr->background.blue >> 8) & 0xff);
4052 *(sp + 5) = (png_byte)(png_ptr->background.blue & 0xff);
4096 *sp = (png_byte)((png_ptr->background.red >> 8) & 0xff);
4097 *(sp + 1) = (png_byte)(png_ptr->background.red & 0xff);
4098 *(sp + 2) = (png_byte)((png_ptr->background.green >> 8) & 0xff);
4099 *(sp + 3) = (png_byte)(png_ptr->background.green & 0xff);
4100 *(sp + 4) = (png_byte)((png_ptr->background.blue >> 8) & 0xff);
4101 *(sp + 5) = (png_byte)(png_ptr->background.blue & 0xff);
4114 png_composite_16(v, r, a, png_ptr->background.red);
4118 png_composite_16(v, g, a, png_ptr->background.green);
4122 png_composite_16(v, b, a, png_ptr->background.blue);