Home | History | Annotate | Download | only in libtests

Lines Matching refs:sRGB

39 #include "../tools/sRGB.h"
52 * misbehavior, such as using a simple power law to correct sRGB to linear.
133 /* sRGB support: use exact calculations rounded to the nearest int, see the
156 sRGB(double linear /*range 0.0 .. 1.0*/)
164 return sRGB(fixed_linear / 65535.);
178 return sRGB((double)component / alpha);
219 * sRGB transform, given an 8-bit value which might be either sRGB or power-law.
340 printf(" --sRGB-16bit");
352 "sRGB-gray",
353 "sRGB-gray+alpha",
354 "sRGB-rgb",
355 "sRGB-rgb+alpha",
361 "color-mapped-sRGB-gray",
362 "color-mapped-sRGB-gray+alpha",
363 "color-mapped-sRGB-rgb",
364 "color-mapped-sRGB-rgb+alpha",
370 "sRGB-gray",
371 "sRGB-gray+alpha",
372 "sRGB-bgr",
373 "sRGB-bgr+alpha",
379 "color-mapped-sRGB-gray",
380 "color-mapped-sRGB-gray+alpha",
381 "color-mapped-sRGB-bgr",
382 "color-mapped-sRGB-bgr+alpha",
388 "sRGB-gray",
389 "alpha+sRGB-gray",
390 "sRGB-rgb",
391 "alpha+sRGB-rgb",
397 "color-mapped-sRGB-gray",
398 "color-mapped-alpha+sRGB-gray",
399 "color-mapped-sRGB-rgb",
400 "color-mapped-alpha+sRGB-rgb",
406 "sRGB-gray",
407 "alpha+sRGB-gray",
408 "sRGB-bgr",
409 "alpha+sRGB-bgr",
415 "color-mapped-sRGB-gray",
416 "color-mapped-alpha+sRGB-gray",
417 "color-mapped-sRGB-bgr",
418 "color-mapped-alpha+sRGB-bgr",
765 /* The background as the original sRGB 8-bit value converted to the final
1132 * 16 G sRGB sRGB sRGB sRGB . . . .
1134 * 16 RGB sG sG sRGB sRGB g16 g16 . .
1140 * g8: convert sRGB components to sRGB grayscale
1141 * g8b: convert sRGB components to grayscale and composite on gray background
1144 * lin: make sRGB components linear, alpha := 65535
1145 * pre: make sRGB components linear and premultiply by alpha (scale alpha)
1147 * glin: make sRGB components linear, convert to grayscale, alpha := 65535
1148 * gpre: make sRGB components grayscale and linear and premultiply by alpha
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)
1155 * b16g: composite linear onto gray background and convert the result to sRGB
1156 * b16c: composite linear onto color background and convert the result to sRGB
1157 * sG: convert linear RGB to sRGB grayscale
1158 * sGp: unpremultiply RGB then convert to sRGB grayscale
1159 * sCp: unpremultiply RGB then convert to sRGB
1160 * gb16: composite linear onto background and convert to sRGB grayscale
1162 * cb16: composite linear onto background and convert to sRGB
1233 out->r = out->g = out->b = sRGB(sRGB_to_d[in->g] * a + back->dg * (1-a));
1261 out->r = sRGB(sRGB_to_d[in->r] * a + back->dr * (1-a));
1262 out->g = sRGB(sRGB_to_d[in->g] * a + back->dg * (1-a));
1263 out->b = sRGB(sRGB_to_d[in->b] * a + back->db * (1-a));
1269 /* g8: convert sRGB components to sRGB grayscale */
1280 sRGB(YfromRGB(sRGB_to_d[in->r], sRGB_to_d[in->g], sRGB_to_d[in->b]));
1285 /* g8b: convert sRGB components to grayscale and composite on gray background */
1298 out->r = out->g = out->b = sRGB(YfromRGB(
1306 out->r = out->g = out->b = sRGB(a * YfromRGB(sRGB_to_d[in->r],
1314 /* lin: make sRGB components linear, alpha := 65535 */
1350 /* pre: make sRGB components linear and premultiply by alpha (scale alpha) */
1422 /* glin: make sRGB components linear, convert to grayscale, alpha := 65535 */
1438 /* gpre: make sRGB components grayscale and linear and premultiply by alpha */
1642 /* sRGB: convert linear components to sRGB, alpha := 255 */
1678 /* unpg: unpremultiply gray component and convert to sRGB (scale alpha) */
1692 out->r = out->g = out->b = sRGB((double)in->g / in->a);
1697 /* unpc: unpremultiply color components and convert to sRGB (scale alpha) */
1711 out->r = sRGB((double)in->r / in->a);
1712 out->g = sRGB((double)in->g / in->a);
1713 out->b = sRGB((double)in->b / in->a);
1718 /* b16g: composite linear onto gray background and convert the result to sRGB */
1731 out->r = out->g = out->b = sRGB(in->g * a + back->dg * a1);
1737 /* b16c: composite linear onto color background and convert the result to sRGB*/
1754 out->r = sRGB(in->r * a + back->dr * a1);
1755 out->g = sRGB(in->g * a + back->dg * a1);
1756 out->b = sRGB(in->b * a + back->db * a1);
1762 /* sG: convert linear RGB to sRGB grayscale */
1768 out->r = out->g = out->b = sRGB(YfromRGBint(in->r, in->g, in->b)/65535);
1772 /* sGp: unpremultiply RGB then convert to sRGB grayscale */
1786 out->r = out->g = out->b = sRGB(YfromRGBint(in->r, in->g, in->b)/in->a);
1791 /* sCp: unpremultiply RGB then convert to sRGB */
1805 out->r = sRGB((double)in->r / in->a);
1806 out->g = sRGB((double)in->g / in->a);
1807 out->b = sRGB((double)in->b / in->a);
1812 /* gb16: composite linear onto background and convert to sRGB grayscale */
1829 out->r = out->g = out->b = sRGB(in->g * a + back->dg * a1);
1835 /* cb16: composite linear onto background and convert to sRGB */
1859 out->r = sRGB(in->r * a + back->dr * a1);
1860 out->g = sRGB(in->g * a + back->dg * a1);
1861 out->b = sRGB(in->b * a + back->db * a1);
1912 * 16 G sRGB sRGB sRGB sRGB . . . .
1914 * 16 RGB sG sG sRGB sRGB g16 g16 . .
1962 * In some cases the conversion between sRGB formats goes via a linear
1963 * intermediate; an sRGB to linear conversion (as above) is followed by a simple
1964 * linear to sRGB step with no other conversions. This is done by a separate
1966 * (since final output is always sRGB not colormapped).
1990 { /* input: sRGB-gray */
1995 }, { /* input: sRGB-gray+alpha */
2000 }, { /* input: sRGB-rgb */
2005 }, { /* input: sRGB-rgb+alpha */
2030 }, { /* input: color-mapped-sRGB-gray */
2035 }, { /* input: color-mapped-sRGB-gray+alpha */
2040 }, { /* input: color-mapped-sRGB-rgb */
2045 }, { /* input: color-mapped-sRGB-rgb+alpha */
2074 { /* input: sRGB-gray */
2076 }, { /* input: sRGB-gray+alpha */
2078 }, { /* input: sRGB-rgb */
2080 }, { /* input: sRGB-rgb+alpha */
2090 }, { /* input: color-mapped-sRGB-gray */
2092 }, { /* input: color-mapped-sRGB-gray+alpha */
2094 }, { /* input: color-mapped-sRGB-rgb */
2096 }, { /* input: color-mapped-sRGB-rgb+alpha */
2110 { /* input: sRGB-gray */
2113 }, { /* input: sRGB-gray+alpha */
2116 }, { /* input: sRGB-rgb */
2119 }, { /* input: sRGB-rgb+alpha */
2266 /* The input value is 'NULL' to use the background and (otherwise) an sRGB
2269 * linear (16-bit) output the sRGB background color is ignored; the
2298 else /* sRGB output */
2381 * The following is *just* the result of a round trip from 8-bit sRGB to linear
2382 * then back to 8-bit sRGB when it is done by libpng. There are two problems:
2385 * in instability in the low values and even with 16-bit precision sRGB(1) ends
2386 * up mapping to sRGB(0) as a result of rounding in the 16-bit representation.
2391 * which is mapping sRGB(14) to sRGB(0).
2411 * case error arises with 16-bit 128.5, work out what sRGB
2416 * because libpng uses a simple power law for sRGB data at present.
3405 * side works ok. Check the conversion to sRGB if the copy is
3423 /* 'output' is linear, convert to the corresponding sRGB format.
3563 else if (strcmp(arg, "--sRGB-16bit") == 0)