Lines Matching refs:gray
2092 /* This is set if the color isn't gray but the output is. */
2266 * selected by six levels of alpha. One transparent entry, 6 gray
2276 * entry = (231 * gray + 128) >> 8;
2286 * entry = PNG_DIV51(gray);
2292 unsigned int gray = (i * 256 + 115) / 231;
2293 png_create_colormap_entry(display, i++, gray, gray, gray, 255, P_sRGB);
2447 png_error(png_ptr, "gray[8] color-map: too few entries");
2457 trans = png_ptr->trans_color.gray;
2496 /* The rows from libpng, while technically gray values, are now also
2510 * special processing; add an alpha channel, sacrifice gray level
2519 * gray then it is possible to let libpng handle the substitution by
2520 * ensuring that the corresponding gray level matches the background
2526 png_error(png_ptr, "gray[16] color-map: too few entries");
2541 /* Background is gray; no special processing will be
2545 png_uint_32 gray = back_g;
2549 gray = PNG_sRGB_FROM_LINEAR(gray * 255);
2554 png_create_colormap_entry(display, gray, back_g, back_g,
2562 c.gray = c.red = c.green = c.blue = (png_uint_16)gray;
2565 * It should be the color->gray case below apparently
2589 * precision (and the background color is not a simple gray
2609 /* 8-bit or 16-bit PNG with two channels - gray and alpha. A minimum
2611 * removed there are only 256 possibilities if the background is gray.
2624 png_error(png_ptr, "gray+alpha color-map: too few entries");
2640 * colormap containing gray levels (for the opaque grays), a
2646 * If the background is gray, however, we only need a 256 entry gray
2653 /* Background is gray; no special processing will be required. */
2655 png_uint_32 gray = back_g;
2658 png_error(png_ptr, "gray-alpha color-map: too few entries");
2664 gray = PNG_sRGB_FROM_LINEAR(gray * 255);
2667 png_create_colormap_entry(display, gray, back_g, back_g,
2675 c.gray = c.red = c.green = c.blue = (png_uint_16)gray;
2697 png_uint_32 gray = (i * 256 + 115) / 231;
2698 png_create_colormap_entry(display, i++, gray, gray, gray,
2749 png_uint_32 gray = png_sRGB_table[g*51] * alpha;
2752 PNG_sRGB_FROM_LINEAR(gray + back_rx),
2753 PNG_sRGB_FROM_LINEAR(gray + back_gx),
2754 PNG_sRGB_FROM_LINEAR(gray + back_bx), 255, P_sRGB);
2766 /* Exclude the case where the output is gray; we can always handle this
2783 /* The output will now be one or two 8-bit gray or gray+alpha
2811 png_error(png_ptr, "rgb[gray] color-map: too few entries");
2815 * libpng bug in gamma+compose+rgb-to-gray (the double gamma
2838 png_uint_32 gray = back_g;
2847 /* The app supplied a gray which is in output_encoding, we
2853 gray = png_sRGB_table[gray]; /* now P_LINEAR */
2855 gray = PNG_DIV257(png_gamma_16bit_correct(gray,
2861 png_create_colormap_entry(display, gray, back_g, back_g,
2867 gray = PNG_sRGB_FROM_LINEAR(gray * 255);
2871 png_create_colormap_entry(display, gray, back_g, back_g,
2879 c.gray = c.red = c.green = c.blue = (png_uint_16)gray;
3032 c.gray = c.green = (png_uint_16)back_g;
3277 unsigned int gray = *inrow++;
3287 entry = (231 * gray + 128) >> 8;
3295 entry = 226 + 6 * PNG_DIV51(alpha) + PNG_DIV51(gray);
3305 png_byte gray = *inrow++;
3311 else if (gray != PNG_CMAP_TRANS_BACKGROUND)
3312 *outrow = gray;
3643 * happening inside libpng, so this routine sees an 8 or 16-bit gray+alpha
3659 * libpng doing rgb to gray and gamma correction but background processing
3661 * might be 8 or 16-bit but should always have two channels; gray plus alpha.
3664 png_error(png_ptr, "lost rgb to gray");
3699 /* 8-bit sRGB gray values with an alpha channel; the alpha channel is
3770 inrow += 2; /* gray and alpha channel */
3813 inrow += 2; /* gray and alpha channel */
3955 /* Do this first so that we have a record if rgb to gray is happening. */
3958 /* gray<->color transformation required. */
3964 /* libpng can't do both rgb to gray and
4079 /* If RGB->gray is happening the alpha channel must be left and the
4100 c.gray = display->background->green;
4103 * for gray is much better than calculating the luminance here;
4169 * the output is gray, but fix up the 'format' value in that case.