Home | History | Annotate | Download | only in libpng

Lines Matching defs:gray

798    /* Detect gray background and attempt to enable optimization
799 * for gray --> RGB case
803 * background color might actually be gray yet not be flagged as such.
819 png_ptr->background.gray = png_ptr->background.red;
826 if (!(color_type & PNG_COLOR_MASK_COLOR)) /* i.e., GRAY or GRAY_ALPHA */
832 png_ptr->background.gray *= (png_uint_16)0xff;
834 = png_ptr->background.blue = png_ptr->background.gray;
837 png_ptr->trans_values.gray *= (png_uint_16)0xff;
839 = png_ptr->trans_values.blue = png_ptr->trans_values.gray;
844 png_ptr->background.gray *= (png_uint_16)0x55;
846 = png_ptr->background.blue = png_ptr->background.gray;
849 png_ptr->trans_values.gray *= (png_uint_16)0x55;
851 = png_ptr->trans_values.blue = png_ptr->trans_values.gray;
856 png_ptr->background.gray *= (png_uint_16)0x11;
858 = png_ptr->background.blue = png_ptr->background.gray;
861 png_ptr->trans_values.gray *= (png_uint_16)0x11;
863 = png_ptr->trans_values.blue = png_ptr->trans_values.gray;
871 = png_ptr->background.blue = png_ptr->background.gray;
1069 png_ptr->background_1.gray = (png_uint_16)(pow(
1070 (double)png_ptr->background.gray / m, g) * m + .5);
1071 png_ptr->background.gray = (png_uint_16)(pow(
1072 (double)png_ptr->background.gray / m, gs) * m + .5);
1076 (png_ptr->background.red != png_ptr->background.gray))
1094 /* GRAY, GRAY ALPHA, RGB, or RGBA with gray background */
1096 = png_ptr->background_1.blue = png_ptr->background_1.gray;
1098 = png_ptr->background.blue = png_ptr->background.gray;
1420 * gray-to-RGB, or you will have to test 3x as many bytes to check if a
1425 * - Gray + simple transparency -> compare 1 or 2 gray bytes and composite
1428 * - Gray + alpha -> composite with gray background and remove alpha bytes,
1431 * To support RGB backgrounds for gray images we need:
1432 * - Gray + simple transparency -> convert to RGB + simple transparency,
1436 * composite with gray bkgrnd)
1437 * - Gray + alpha -> convert to RGB + alpha, composite with background and
1440 * on gray background)
1444 * in advance if the background was gray or RGB, and position the gray-to-RGB
1449 /* If gray -> RGB, do so now only if background is non-gray; else do later
1528 /* If gray -> RGB, do so now only if we did not do so above */
1709 shift[channels++] = row_info->bit_depth - sig_bits->gray;
2132 } /* COLOR_TYPE == GRAY */
2722 if (palette[i].red == (png_byte)png_ptr->trans_values.gray)
2789 if (i == (png_byte)png_ptr->trans_values.gray)
2845 == trans_values->gray)
2848 *sp |= (png_byte)(background->gray << shift);
2871 == trans_values->gray)
2874 *sp |= (png_byte)(background->gray << shift);
2901 == trans_values->gray)
2904 *sp |= (png_byte)(background->gray << shift);
2928 == trans_values->gray)
2931 *sp |= (png_byte)(background->gray << shift);
2958 == trans_values->gray)
2961 *sp |= (png_byte)(background->gray << shift);
2983 if (*sp == trans_values->gray)
2985 *sp = (png_byte)background->gray;
2999 if (*sp == trans_values->gray)
3001 *sp = (png_byte)background->gray;
3019 if (v == trans_values->gray)
3022 *sp = (png_byte)((background->gray >> 8) & 0xff);
3023 *(sp + 1) = (png_byte)(background->gray & 0xff);
3042 if (v == trans_values->gray)
3044 *sp = (png_byte)((background->gray >> 8) & 0xff);
3045 *(sp + 1) = (png_byte)(background->gray & 0xff);
3181 *dp = (png_byte)background->gray;
3188 png_composite(w, v, a, background_1->gray);
3209 *dp = (png_byte)background->gray;
3213 png_composite(*dp, *sp, a, background_1->gray);
3216 *dp = (png_byte)background->gray;
3248 *dp = (png_byte)((background->gray >> 8) & 0xff);
3249 *(dp + 1) = (png_byte)(background->gray & 0xff);
3257 png_composite_16(v, g, a, background_1->gray);
3283 *dp = (png_byte)((background->gray >> 8) & 0xff);
3284 *(dp + 1) = (png_byte)(background->gray & 0xff);
3292 png_composite_16(v, g, a, background_1->gray);
3857 png_uint_16 gray = (png_uint_16)(trans_value ? trans_value->gray : 0);
3865 gray = (png_uint_16)((gray&0x01)*0xff);
3890 gray = (png_uint_16)((gray&0x03)*0x55);
3914 gray = (png_uint_16)((gray&0x0f)*0x11);
3945 gray = gray & 0xff;
3950 if (*sp == gray)
3960 png_byte gray_high = (gray >> 8) & 0xff;
3961 png_byte gray_low = gray & 0xff;
4261 sig_bit = (int)png_ptr->sig_bit.gray;