Lines Matching full:alpha
186 unpremultiply(int component, int alpha)
188 if (alpha <= component)
191 else if (alpha >= 65535)
195 return sRGB((double)component / alpha);
206 ilineara(int fixed_srgb, int alpha)
208 return u16d((257 * alpha) * sRGB_to_d[fixed_srgb]);
219 ilineara_g22(int fixed_srgb, int alpha)
221 return u16d((257 * alpha) * g22_to_d[fixed_srgb]);
379 "sRGB-gray+alpha",
381 "sRGB-rgb+alpha",
383 "linear-gray+alpha",
385 "linear-rgb+alpha",
388 "color-mapped-sRGB-gray+alpha",
390 "color-mapped-sRGB-rgb+alpha",
392 "color-mapped-linear-gray+alpha",
394 "color-mapped-linear-rgb+alpha",
397 "sRGB-gray+alpha",
399 "sRGB-bgr+alpha",
401 "linear-gray+alpha",
403 "linear-bgr+alpha",
406 "color-mapped-sRGB-gray+alpha",
408 "color-mapped-sRGB-bgr+alpha",
410 "color-mapped-linear-gray+alpha",
412 "color-mapped-linear-bgr+alpha",
415 "alpha+sRGB-gray",
417 "alpha+sRGB-rgb",
419 "alpha+linear-gray",
421 "alpha+linear-rgb",
424 "color-mapped-alpha+sRGB-gray",
426 "color-mapped-alpha+sRGB-rgb",
428 "color-mapped-alpha+linear-gray",
430 "color-mapped-alpha+linear-rgb",
433 "alpha+sRGB-gray",
435 "alpha+sRGB-bgr",
437 "alpha+linear-gray",
439 "alpha+linear-bgr",
442 "color-mapped-alpha+sRGB-gray",
444 "color-mapped-alpha+sRGB-bgr",
446 "color-mapped-alpha+linear-gray",
448 "color-mapped-alpha+linear-bgr",
556 /* AFIRST is meaningless if no alpha: */
790 /* The components, for grayscale images the gray value is in 'g' and if alpha
1149 * 1) Remove an alpha channel by pre-multiplication or compositing on a
1150 * background color. (Adding an alpha channel is a no-op.)
1177 * lin: make sRGB components linear, alpha := 65535
1178 * pre: make sRGB components linear and premultiply by alpha (scale alpha)
1179 * pre': as 'pre' but alpha := 65535
1180 * glin: make sRGB components linear, convert to grayscale, alpha := 65535
1181 * gpre: make sRGB components grayscale and linear and premultiply by alpha
1182 * gpr': as 'gpre' but alpha := 65535
1185 * sRGB: convert linear components to sRGB, alpha := 255
1186 * unpg: unpremultiply gray component and convert to sRGB (scale alpha)
1187 * unpc: unpremultiply color components and convert to sRGB (scale alpha)
1198 * A: set alpha to 65535
1199 * g16: convert linear RGB to linear grayscale (alpha := 65535)
1200 * g16': as 'g16' but alpha is unchanged
1347 /* lin: make sRGB components linear, alpha := 65535 */
1383 /* pre: make sRGB components linear and premultiply by alpha (scale alpha) */
1419 /* pre': as 'pre' but alpha := 65535 */
1455 /* glin: make sRGB components linear, convert to grayscale, alpha := 65535 */
1471 /* gpre: make sRGB components grayscale and linear and premultiply by alpha */
1487 /* gpr': as 'gpre' but alpha := 65535 */
1504 /* Lin: make gAMA 45455 components linear, alpha := 65535 */
1541 /* Pre: make gAMA 45455 components linear and premultiply by alpha (scale alpha)
1580 /* Pre': as 'Pre' but alpha := 65535 */
1618 /* Glin: make gAMA 45455 components linear, convert to grayscale, alpha := 65535
1638 * alpha.
1657 /* Gpr': as 'Gpre' but alpha := 65535 */
1675 /* sRGB: convert linear components to sRGB, alpha := 255 */
1711 /* unpg: unpremultiply gray component and convert to sRGB (scale alpha) */
1730 /* unpc: unpremultiply color components and convert to sRGB (scale alpha) */
1901 /* A: set alpha to 65535 */
1912 /* g16: convert linear RGB to linear grayscale (alpha := 65535) */
1921 /* g16': as 'g16' but alpha is unchanged */
2005 * opaque input pixel values. Notice that alpha should be exact in each case.
2007 * Errors in alpha should only occur when converting from a direct format
2008 * to a colormapped format, when alpha is effectively smashed (so large
2010 * values. The fourth entry in the array is used for the alpha error (and it
2038 int in_opaque; /* Value of input alpha that is opaque */
2117 * typically be large (only the grayscale-no-alpha case permits preserving
2147 /* Rule 1: background only need be supplied if alpha is to be removed */
2278 * this compounds the 8-bit errors according to the alpha value of the pixel.
2283 static int error_via_linear[256]; /* Indexed by 8-bit alpha */
2288 int alpha;
2292 for (alpha=1; alpha<=255; ++alpha)
2304 double v = floor(255*pow(.5/*(128.5 * 255 / 65535)*/ / alpha, 1/2.2)+.1);
2306 error_via_linear[alpha] = (int)v;
2446 * is 8-bit - any component values are valid. Don't check the input alpha
2447 * here to also skip the 16-bit small alpha cases.
2452 /* Check for alpha errors first; an alpha error can damage the components too
2466 errmsg = "alpha";
2470 /* Now if *either* of the output alphas are 0 but alpha is within tolerance
2477 if (errmsg == NULL) /* else just signal an alpha error */
2487 /* Mismatch on a component, check the input alpha */
2496 errmsg = "alpha component";
2537 * 0: alpha
2776 * 3) An alpha channel has not been removed from an 8-bit format, or the
2777 * 8-bit alpha value of the pixel was 255 (opaque).
2779 * If an alpha channel has been *added* then it must have the relevant opaque
2788 /* Was an alpha channel changed? */
2792 /* Was an alpha channel removed? (The third test.) If so the direct
2793 * comparison is only possible if the input alpha is opaque.
2797 /* Was an alpha channel added? */
2802 * 'a' to find each channel of 'b'. If alpha was added then btoa[alpha]
2821 btoa[bloc[i]] = aloc[i]; /* may be '4' for alpha */
2824 alpha_added = bloc[0]; /* location of alpha channel in image b */
2830 alpha_removed = aloc[0]; /* location of alpha channel in image a */
2870 * channel or the opaque alpha value, as appropriate. If
2872 * 'a' alpha channel (alpha_removed) is opaque; only relevant for
3273 * the linear, color and maybe alpha flags, this will cause spurious failures
3325 /* Use the low bit of 'counter' to indicate whether or not to do alpha
3337 /* If there is a format change that removes the alpha channel then
3348 /* Alpha/transparency will be removed, the background is
3363 /* Otherwise an alpha channel is not being eliminated, just leave
3414 * 'image' has an alpha channel but 'output' does not then there
3415 * will a strip-alpha-channel operation (because 'output' is
3698 unsigned int alpha;
3700 for (alpha=0; alpha<4; ++alpha)
3702 printf(" %d", gpc_error[in][out][alpha]);
3703 if (alpha < 3) putchar(',');
3729 unsigned int alpha;
3731 for (alpha=0; alpha<4; ++alpha)
3733 printf(" %d", gpc_error_via_linear[in][out][alpha]);
3734 if (alpha < 3) putchar(',');
3757 unsigned int alpha;
3759 for (alpha=0; alpha<4; ++alpha)
3761 printf(" %d", gpc_error_to_colormap[in][out][alpha]);
3762 if (alpha < 3) putchar(',');