Home | History | Annotate | Download | only in libtests

Lines Matching refs:alpha

169 unpremultiply(int component, int alpha)
171 if (alpha <= component)
174 else if (alpha >= 65535)
178 return sRGB((double)component / alpha);
189 ilineara(int fixed_srgb, int alpha)
191 return u16d((257 * alpha) * sRGB_to_d[fixed_srgb]);
202 ilineara_g22(int fixed_srgb, int alpha)
204 return u16d((257 * alpha) * g22_to_d[fixed_srgb]);
353 "sRGB-gray+alpha",
355 "sRGB-rgb+alpha",
357 "linear-gray+alpha",
359 "linear-rgb+alpha",
362 "color-mapped-sRGB-gray+alpha",
364 "color-mapped-sRGB-rgb+alpha",
366 "color-mapped-linear-gray+alpha",
368 "color-mapped-linear-rgb+alpha",
371 "sRGB-gray+alpha",
373 "sRGB-bgr+alpha",
375 "linear-gray+alpha",
377 "linear-bgr+alpha",
380 "color-mapped-sRGB-gray+alpha",
382 "color-mapped-sRGB-bgr+alpha",
384 "color-mapped-linear-gray+alpha",
386 "color-mapped-linear-bgr+alpha",
389 "alpha+sRGB-gray",
391 "alpha+sRGB-rgb",
393 "alpha+linear-gray",
395 "alpha+linear-rgb",
398 "color-mapped-alpha+sRGB-gray",
400 "color-mapped-alpha+sRGB-rgb",
402 "color-mapped-alpha+linear-gray",
404 "color-mapped-alpha+linear-rgb",
407 "alpha+sRGB-gray",
409 "alpha+sRGB-bgr",
411 "alpha+linear-gray",
413 "alpha+linear-bgr",
416 "color-mapped-alpha+sRGB-gray",
418 "color-mapped-alpha+sRGB-bgr",
420 "color-mapped-alpha+linear-gray",
422 "color-mapped-alpha+linear-bgr",
530 /* AFIRST is meaningless if no alpha: */
757 /* The components, for grayscale images the gray value is in 'g' and if alpha
1116 * 1) Remove an alpha channel by pre-multiplication or compositing on a
1117 * background color. (Adding an alpha channel is a no-op.)
1144 * lin: make sRGB components linear, alpha := 65535
1145 * pre: make sRGB components linear and premultiply by alpha (scale alpha)
1146 * pre': as 'pre' but alpha := 65535
1147 * glin: make sRGB components linear, convert to grayscale, alpha := 65535
1148 * gpre: make sRGB components grayscale and linear and premultiply by alpha
1149 * gpr': as 'gpre' but alpha := 65535
1152 * sRGB: convert linear components to sRGB, alpha := 255
1153 * unpg: unpremultiply gray component and convert to sRGB (scale alpha)
1154 * unpc: unpremultiply color components and convert to sRGB (scale alpha)
1165 * A: set alpha to 65535
1166 * g16: convert linear RGB to linear grayscale (alpha := 65535)
1167 * g16': as 'g16' but alpha is unchanged
1314 /* lin: make sRGB components linear, alpha := 65535 */
1350 /* pre: make sRGB components linear and premultiply by alpha (scale alpha) */
1386 /* pre': as 'pre' but alpha := 65535 */
1422 /* glin: make sRGB components linear, convert to grayscale, alpha := 65535 */
1438 /* gpre: make sRGB components grayscale and linear and premultiply by alpha */
1454 /* gpr': as 'gpre' but alpha := 65535 */
1471 /* Lin: make gAMA 45455 components linear, alpha := 65535 */
1508 /* Pre: make gAMA 45455 components linear and premultiply by alpha (scale alpha)
1547 /* Pre': as 'Pre' but alpha := 65535 */
1585 /* Glin: make gAMA 45455 components linear, convert to grayscale, alpha := 65535
1605 * alpha.
1624 /* Gpr': as 'Gpre' but alpha := 65535 */
1642 /* sRGB: convert linear components to sRGB, alpha := 255 */
1678 /* unpg: unpremultiply gray component and convert to sRGB (scale alpha) */
1697 /* unpc: unpremultiply color components and convert to sRGB (scale alpha) */
1868 /* A: set alpha to 65535 */
1879 /* g16: convert linear RGB to linear grayscale (alpha := 65535) */
1888 /* g16': as 'g16' but alpha is unchanged */
1972 * opaque input pixel values. Notice that alpha should be exact in each case.
1974 * Errors in alpha should only occur when converting from a direct format
1975 * to a colormapped format, when alpha is effectively smashed (so large
1977 * values. The fourth entry in the array is used for the alpha error (and it
1995 }, { /* input: sRGB-gray+alpha */
2005 }, { /* input: sRGB-rgb+alpha */
2015 }, { /* input: linear-gray+alpha */
2025 }, { /* input: linear-rgb+alpha */
2035 }, { /* input: color-mapped-sRGB-gray+alpha */
2045 }, { /* input: color-mapped-sRGB-rgb+alpha */
2055 }, { /* input: color-mapped-linear-gray+alpha */
2065 }, { /* input: color-mapped-linear-rgb+alpha */
2076 }, { /* input: sRGB-gray+alpha */
2080 }, { /* input: sRGB-rgb+alpha */
2084 }, { /* input: linear-gray+alpha */
2088 }, { /* input: linear-rgb+alpha */
2092 }, { /* input: color-mapped-sRGB-gray+alpha */
2096 }, { /* input: color-mapped-sRGB-rgb+alpha */
2100 }, { /* input: color-mapped-linear-gray+alpha */
2104 }, { /* input: color-mapped-linear-rgb+alpha */
2113 }, { /* input: sRGB-gray+alpha */
2119 }, { /* input: sRGB-rgb+alpha */
2125 }, { /* input: linear-gray+alpha */
2131 }, { /* input: linear-rgb+alpha */
2154 int in_opaque; /* Value of input alpha that is opaque */
2233 * typically be large (only the grayscale-no-alpha case permits preserving
2263 /* Rule 1: background only need be supplied if alpha is to be removed */
2394 * this compounds the 8-bit errors according to the alpha value of the pixel.
2399 static int error_via_linear[256]; /* Indexed by 8-bit alpha */
2404 int alpha;
2408 for (alpha=1; alpha<=255; ++alpha)
2420 double v = floor(255*pow(.5/*(128.5 * 255 / 65535)*/ / alpha, 1/2.2)+.1);
2422 error_via_linear[alpha] = (int)v;
2562 * is 8-bit - any component values are valid. Don't check the input alpha
2563 * here to also skip the 16-bit small alpha cases.
2568 /* Check for alpha errors first; an alpha error can damage the components too
2582 errmsg = "alpha";
2586 /* Now if *either* of the output alphas are 0 but alpha is within tolerance
2593 if (errmsg == NULL) /* else just signal an alpha error */
2603 /* Mismatch on a component, check the input alpha */
2612 errmsg = "alpha component";
2653 * 0: alpha
2892 * 3) An alpha channel has not been removed from an 8-bit format, or the
2893 * 8-bit alpha value of the pixel was 255 (opaque).
2895 * If an alpha channel has been *added* then it must have the relevant opaque
2904 /* Was an alpha channel changed? */
2908 /* Was an alpha channel removed? (The third test.) If so the direct
2909 * comparison is only possible if the input alpha is opaque.
2913 /* Was an alpha channel added? */
2918 * 'a' to find each channel of 'b'. If alpha was added then btoa[alpha]
2937 btoa[bloc[i]] = aloc[i]; /* may be '4' for alpha */
2940 alpha_added = bloc[0]; /* location of alpha channel in image b */
2946 alpha_removed = aloc[0]; /* location of alpha channel in image a */
2986 * channel or the opaque alpha value, as appropriate. If
2988 * 'a' alpha channel (alpha_removed) is opaque; only relevant for
3293 * the linear, color and maybe alpha flags, this will cause spurious failures
3345 /* Use the low bit of 'counter' to indicate whether or not to do alpha
3357 /* If there is a format change that removes the alpha channel then
3368 /* Alpha/transparency will be removed, the background is
3383 /* Otherwise an alpha channel is not being eliminated, just leave
3434 * 'image' has an alpha channel but 'output' does not then there
3435 * will a strip-alpha-channel operation (because 'output' is
3687 unsigned int alpha;
3689 for (alpha=0; alpha<4; ++alpha)
3691 printf(" %d", gpc_error[in][out][alpha]);
3692 if (alpha < 3) putchar(',');
3718 unsigned int alpha;
3720 for (alpha=0; alpha<4; ++alpha)
3722 printf(" %d", gpc_error_via_linear[in][out][alpha]);
3723 if (alpha < 3) putchar(',');
3746 unsigned int alpha;
3748 for (alpha=0; alpha<4; ++alpha)
3750 printf(" %d", gpc_error_to_colormap[in][out][alpha]);
3751 if (alpha < 3) putchar(',');