Lines Matching full:background
123 /* Handle alpha and tRNS via a background color */
136 png_warning(png_ptr, "Application must supply a known background gamma");
144 png_ptr->background = *background_color;
367 /* Finally, if pre-multiplying, set the background fields to achieve the
373 memset(&png_ptr->background, 0, (sizeof png_ptr->background));
380 "conflicting calls to set alpha mode and background");
819 * disabled in background handling. There is no evidence (so far) that this
1139 /* Any alpha means background and associative alpha processing is
1152 * background color is in the file format or the screen format in the case
1163 png_ptr->background.red =
1164 png_ptr->palette[png_ptr->background.index].red;
1165 png_ptr->background.green =
1166 png_ptr->palette[png_ptr->background.index].green;
1167 png_ptr->background.blue =
1168 png_ptr->palette[png_ptr->background.index].blue;
1187 } /* background expand and (therefore) no alpha association. */
1196 * background and alpha mode stuff if there isn't.
1204 /* Any alpha means background and associative alpha processing is
1219 * background color is in the file format or the screen format in the case
1232 /* Expand background and tRNS chunks */
1233 int gray = png_ptr->background.gray;
1263 png_ptr->background.red = png_ptr->background.green =
1264 png_ptr->background.blue = (png_uint_16)gray;
1272 } /* background expand and (therefore) no alpha association. */
1424 /* Detect gray background and attempt to enable optimization for
1429 * background color might actually be gray yet not be flagged as such.
1435 * interdependencies. The color type of the background should be recorded in
1437 background is currently in.
1441 /* PNG_BACKGROUND_EXPAND: the background is in the file color space, so if
1442 * the file was grayscale the background value is gray.
1457 if (png_ptr->background.red == png_ptr->background.green &&
1458 png_ptr->background.red == png_ptr->background.blue)
1461 png_ptr->background.gray = png_ptr->background.red;
1471 * composite (background and alpha) stuff, which can be pretty much all done
1493 * handling the background color must be 8, not 16, bits deep, but the
1499 * NOTE: this discards the low 16 bits of the user supplied background
1503 CHOP(png_ptr->background.red);
1504 CHOP(png_ptr->background.green);
1505 CHOP(png_ptr->background.blue);
1506 CHOP(png_ptr->background.gray);
1520 * component this will also happen after PNG_COMPOSE and so the background
1525 png_ptr->background.red = (png_uint_16)(png_ptr->background.red * 257);
1526 png_ptr->background.green =
1527 (png_uint_16)(png_ptr->background.green * 257);
1528 png_ptr->background.blue = (png_uint_16)(png_ptr->background.blue * 257);
1529 png_ptr->background.gray = (png_uint_16)(png_ptr->background.gray * 257);
1534 * background support (see the comments in scripts/pnglibconf.dfa), this
1544 png_ptr->background_1 = png_ptr->background;
1587 "libpng does not support gamma+background+rgb_to_gray");
1601 back.red = png_ptr->gamma_table[png_ptr->background.red];
1602 back.green = png_ptr->gamma_table[png_ptr->background.green];
1603 back.blue = png_ptr->gamma_table[png_ptr->background.blue];
1605 back_1.red = png_ptr->gamma_to_1[png_ptr->background.red];
1606 back_1.green = png_ptr->gamma_to_1[png_ptr->background.green];
1607 back_1.blue = png_ptr->gamma_to_1[png_ptr->background.blue];
1639 back.red = png_gamma_8bit_correct(png_ptr->background.red,
1641 back.green = png_gamma_8bit_correct(png_ptr->background.green,
1643 back.blue = png_gamma_8bit_correct(png_ptr->background.blue,
1649 back.red = (png_byte)png_ptr->background.red;
1650 back.green = (png_byte)png_ptr->background.green;
1651 back.blue = (png_byte)png_ptr->background.blue;
1656 back_1.red = png_gamma_8bit_correct(png_ptr->background.red,
1659 png_ptr->background.green, g);
1660 back_1.blue = png_gamma_8bit_correct(png_ptr->background.blue,
1666 back_1.red = (png_byte)png_ptr->background.red;
1667 back_1.green = (png_byte)png_ptr->background.green;
1668 back_1.blue = (png_byte)png_ptr->background.blue;
1742 png_error(png_ptr, "invalid background gamma type");
1750 png_ptr->background.gray, g);
1753 png_ptr->background.gray = png_gamma_correct(png_ptr,
1754 png_ptr->background.gray, gs);
1756 if ((png_ptr->background.red != png_ptr->background.green) ||
1757 (png_ptr->background.red != png_ptr->background.blue) ||
1758 (png_ptr->background.red != png_ptr->background.gray))
1760 /* RGB or RGBA with color background */
1764 png_ptr->background.red, g);
1767 png_ptr->background.green, g);
1770 png_ptr->background.blue, g);
1775 png_ptr->background.red = png_gamma_correct(png_ptr,
1776 png_ptr->background.red, gs);
1778 png_ptr->background.green = png_gamma_correct(png_ptr,
1779 png_ptr->background.green, gs);
1781 png_ptr->background.blue = png_gamma_correct(png_ptr,
1782 png_ptr->background.blue, gs);
1788 /* GRAY, GRAY ALPHA, RGB, or RGBA with gray background */
1792 png_ptr->background.red = png_ptr->background.green
1793 = png_ptr->background.blue = png_ptr->background.gray;
1796 /* The background is now in screen gamma: */
1845 back.red = (png_byte)png_ptr->background.red;
1846 back.green = (png_byte)png_ptr->background.green;
1847 back.blue = (png_byte)png_ptr->background.blue;
1968 /* The following is almost certainly wrong unless the background value is in
1972 info_ptr->background = png_ptr->background;
3184 /* Replace any alpha or transparency with the supplied background color.
3185 * "background" is already in the screen gamma, while "background_1" is
3226 tmp |= png_ptr->background.gray << shift;
3255 tmp |= png_ptr->background.gray << shift;
3291 tmp |= png_ptr->background.gray << shift;
3321 tmp |= png_ptr->background.gray << shift;
3357 tmp |= png_ptr->background.gray << shift;
3383 *sp = (png_byte)png_ptr->background.gray;
3396 *sp = (png_byte)png_ptr->background.gray;
3416 /* Background is already in screen gamma */
3417 *sp = (png_byte)((png_ptr->background.gray >> 8)
3419 *(sp + 1) = (png_byte)(png_ptr->background.gray
3443 *sp = (png_byte)((png_ptr->background.gray >> 8)
3445 *(sp + 1) = (png_byte)(png_ptr->background.gray
3473 *sp = (png_byte)png_ptr->background.red;
3474 *(sp + 1) = (png_byte)png_ptr->background.green;
3475 *(sp + 2) = (png_byte)png_ptr->background.blue;
3496 *sp = (png_byte)png_ptr->background.red;
3497 *(sp + 1) = (png_byte)png_ptr->background.green;
3498 *(sp + 2) = (png_byte)png_ptr->background.blue;
3523 /* Background is already in screen gamma */
3524 *sp = (png_byte)((png_ptr->background.red >> 8) & 0xff);
3525 *(sp + 1) = (png_byte)(png_ptr->background.red & 0xff);
3526 *(sp + 2) = (png_byte)((png_ptr->background.green >> 8)
3528 *(sp + 3) = (png_byte)(png_ptr->background.green
3530 *(sp + 4) = (png_byte)((png_ptr->background.blue >> 8)
3532 *(sp + 5) = (png_byte)(png_ptr->background.blue & 0xff);
3570 *sp = (png_byte)((png_ptr->background.red >> 8) & 0xff);
3571 *(sp + 1) = (png_byte)(png_ptr->background.red & 0xff);
3572 *(sp + 2) = (png_byte)((png_ptr->background.green >> 8)
3574 *(sp + 3) = (png_byte)(png_ptr->background.green
3576 *(sp + 4) = (png_byte)((png_ptr->background.blue >> 8)
3578 *(sp + 5) = (png_byte)(png_ptr->background.blue & 0xff);
3604 /* Background is already in screen gamma */
3605 *sp = (png_byte)png_ptr->background.gray;
3629 *sp = (png_byte)png_ptr->background.gray;
3632 png_composite(*sp, *sp, a, png_ptr->background.gray);
3659 /* Background is already in screen gamma */
3660 *sp = (png_byte)((png_ptr->background.gray >> 8)
3662 *(sp + 1) = (png_byte)(png_ptr->background.gray & 0xff);
3692 *sp = (png_byte)((png_ptr->background.gray >> 8)
3694 *(sp + 1) = (png_byte)(png_ptr->background.gray & 0xff);
3702 png_composite_16(v, g, a, png_ptr->background.gray);
3734 /* Background is already in screen gamma */
3735 *sp = (png_byte)png_ptr->background.red;
3736 *(sp + 1) = (png_byte)png_ptr->background.green;
3737 *(sp + 2) = (png_byte)png_ptr->background.blue;
3771 *sp = (png_byte)png_ptr->background.red;
3772 *(sp + 1) = (png_byte)png_ptr->background.green;
3773 *(sp + 2) = (png_byte)png_ptr->background.blue;
3778 png_composite(*sp, *sp, a, png_ptr->background.red);
3781 png_ptr->background.green);
3784 png_ptr->background.blue);
3820 /* Background is already in screen gamma */
3821 *sp = (png_byte)((png_ptr->background.red >> 8) & 0xff);
3822 *(sp + 1) = (png_byte)(png_ptr->background.red & 0xff);
3823 *(sp + 2) = (png_byte)((png_ptr->background.green >> 8)
3825 *(sp + 3) = (png_byte)(png_ptr->background.green
3827 *(sp + 4) = (png_byte)((png_ptr->background.blue >> 8)
3829 *(sp + 5) = (png_byte)(png_ptr->background.blue & 0xff);
3876 *sp = (png_byte)((png_ptr->background.red >> 8) & 0xff);
3877 *(sp + 1) = (png_byte)(png_ptr->background.red & 0xff);
3878 *(sp + 2) = (png_byte)((png_ptr->background.green >> 8)
3880 *(sp + 3) = (png_byte)(png_ptr->background.green
3882 *(sp + 4) = (png_byte)((png_ptr->background.blue >> 8)
3884 *(sp + 5) = (png_byte)(png_ptr->background.blue & 0xff);
3897 png_composite_16(v, r, a, png_ptr->background.red);
3901 png_composite_16(v, g, a, png_ptr->background.green);
3905 png_composite_16(v, b, a, png_ptr->background.blue);
4798 * with background "in place" if transparent,
4800 * - Gray + alpha -> composite with gray background and remove alpha bytes,
4806 * background "in place" if transparent
4809 * - Gray + alpha -> convert to RGB + alpha, composite with background and
4812 * on gray background)
4816 * in advance if the background was gray or RGB, and position the gray-to-RGB
4821 /* If gray -> RGB, do so now only if background is non-gray; else do later