Home | History | Annotate | Download | only in libpng

Lines Matching refs:alpha

215       /* Invert the alpha channel (in tRNS) */
1587 /* Swap location of alpha bytes from ARGB to RGBA */
1597 * alpha channel.
1644 /* Invert the alpha channel from opacity to transparency */
1771 const png_uint_16 alpha = in_ptr[aindex];
1775 out_ptr[aindex] = alpha;
1778 * component/alpha*65535 << 15. (I.e. 15 bits of precision); this
1782 if (alpha > 0 && alpha < 65535)
1783 reciprocal = ((0xffff<<15)+(alpha>>1))/alpha;
1790 /* The following gives 65535 for an alpha of 0, which is fine,
1797 if (component >= alpha)
1800 /* component<alpha, so component/alpha is less than one and
1803 else if (component > 0 && alpha < 65535)
1814 /* Skip to next component (skip the intervening alpha channel) */
1826 /* Given 16-bit input (1 to 4 channels) write 8-bit output. If an alpha channel
1830 * Calculate an alpha reciprocal to reverse pre-multiplication. As above the
1834 #define UNP_RECIPROCAL(alpha) ((((0xffff*0xff)<<7)+(alpha>>1))/alpha)
1837 png_unpremultiply(png_uint_32 component, png_uint_32 alpha,
1840 /* The following gives 1.0 for an alpha of 0, which is fine, otherwise if 0/0
1846 * There is a rounding problem here; if alpha is less than 128 it will end up
1850 if (component >= alpha || alpha < 128)
1853 /* component<alpha, so component/alpha is less than one and
1858 /* The test is that alpha/257 (rounded) is less than 255, the first value
1863 if (alpha < 65407)
1922 png_uint_16 alpha = in_ptr[aindex];
1923 png_byte alphabyte = (png_byte)PNG_DIV257(alpha);
1927 /* Scale and write the alpha channel. */
1931 reciprocal = UNP_RECIPROCAL(alpha);
1935 *out_ptr++ = png_unpremultiply(*in_ptr++, alpha, reciprocal);
1938 /* Skip to next component (skip the intervening alpha channel) */
1951 /* No alpha channel, so the row_end really is the end of the row and it
2013 * pre-multiplication if the color-map has an alpha channel.
2021 if (channels & 1) /* no alpha */
2038 else /* alpha */
2040 png_uint_16 alpha = entry[afirst ? 0 : channels-1];
2041 png_byte alphabyte = (png_byte)PNG_DIV257(alpha);
2049 reciprocal = (((0xffff*0xff)<<7)+(alpha>>1))/alpha;
2058 alpha, reciprocal);
2059 palette[i].green = png_unpremultiply(entry[afirst + 1], alpha,
2061 palette[i].red = png_unpremultiply(entry[afirst + bgr], alpha,
2067 png_unpremultiply(entry[afirst], alpha, reciprocal);
2135 int alpha = !colormap && (format & PNG_FORMAT_FLAG_ALPHA) != 0;
2277 * either there is an alpha channel or it is converted to 8-bit.
2279 if ((linear && alpha) || (!colormap && display->convert_to_8bit))