Home | History | Annotate | Download | only in libtests

Lines Matching full:srgb

47 #include "../tools/sRGB.h"
60 * misbehavior, such as using a simple power law to correct sRGB to linear.
149 /* sRGB support: use exact calculations rounded to the nearest int, see the
172 sRGB(double linear /*range 0.0 .. 1.0*/)
180 return sRGB(fixed_linear / 65535.);
194 return sRGB((double)component / alpha);
235 * sRGB transform, given an 8-bit value which might be either sRGB or power-law.
359 printf(" --sRGB-16bit");
377 "sRGB-gray",
378 "sRGB-gray+alpha",
379 "sRGB-rgb",
380 "sRGB-rgb+alpha",
386 "color-mapped-sRGB-gray",
387 "color-mapped-sRGB-gray+alpha",
388 "color-mapped-sRGB-rgb",
389 "color-mapped-sRGB-rgb+alpha",
395 "sRGB-gray",
396 "sRGB-gray+alpha",
397 "sRGB-bgr",
398 "sRGB-bgr+alpha",
404 "color-mapped-sRGB-gray",
405 "color-mapped-sRGB-gray+alpha",
406 "color-mapped-sRGB-bgr",
407 "color-mapped-sRGB-bgr+alpha",
413 "sRGB-gray",
414 "alpha+sRGB-gray",
415 "sRGB-rgb",
416 "alpha+sRGB-rgb",
422 "color-mapped-sRGB-gray",
423 "color-mapped-alpha+sRGB-gray",
424 "color-mapped-sRGB-rgb",
425 "color-mapped-alpha+sRGB-rgb",
431 "sRGB-gray",
432 "alpha+sRGB-gray",
433 "sRGB-bgr",
434 "alpha+sRGB-bgr",
440 "color-mapped-sRGB-gray",
441 "color-mapped-alpha+sRGB-gray",
442 "color-mapped-sRGB-bgr",
443 "color-mapped-alpha+sRGB-bgr",
797 /* The background as the original sRGB 8-bit value converted to the final
1164 * 16 G sRGB sRGB sRGB sRGB . . . .
1166 * 16 RGB sG sG sRGB sRGB g16 g16 . .
1172 * g8: convert sRGB components to sRGB grayscale
1173 * g8b: convert sRGB components to grayscale and composite on gray background
1176 * lin: make sRGB components linear, alpha := 65535
1177 * pre: make sRGB components linear and premultiply by alpha (scale alpha)
1179 * glin: make sRGB components linear, convert to grayscale, alpha := 65535
1180 * gpre: make sRGB components grayscale and linear and premultiply by alpha
1184 * sRGB: convert linear components to sRGB, alpha := 255
1185 * unpg: unpremultiply gray component and convert to sRGB (scale alpha)
1186 * unpc: unpremultiply color components and convert to sRGB (scale alpha)
1187 * b16g: composite linear onto gray background and convert the result to sRGB
1188 * b16c: composite linear onto color background and convert the result to sRGB
1189 * sG: convert linear RGB to sRGB grayscale
1190 * sGp: unpremultiply RGB then convert to sRGB grayscale
1191 * sCp: unpremultiply RGB then convert to sRGB
1192 * gb16: composite linear onto background and convert to sRGB grayscale
1194 * cb16: composite linear onto background and convert to sRGB
1265 out->r = out->g = out->b = sRGB(sRGB_to_d[in->g] * a + back->dg * (1-a));
1293 out->r = sRGB(sRGB_to_d[in->r] * a + back->dr * (1-a));
1294 out->g = sRGB(sRGB_to_d[in->g] * a + back->dg * (1-a));
1295 out->b = sRGB(sRGB_to_d[in->b] * a + back->db * (1-a));
1301 /* g8: convert sRGB components to sRGB grayscale */
1312 sRGB(YfromRGB(sRGB_to_d[in->r], sRGB_to_d[in->g], sRGB_to_d[in->b]));
1317 /* g8b: convert sRGB components to grayscale and composite on gray background */
1330 out->r = out->g = out->b = sRGB(YfromRGB(
1338 out->r = out->g = out->b = sRGB(a * YfromRGB(sRGB_to_d[in->r],
1346 /* lin: make sRGB components linear, alpha := 65535 */
1382 /* pre: make sRGB components linear and premultiply by alpha (scale alpha) */
1454 /* glin: make sRGB components linear, convert to grayscale, alpha := 65535 */
1470 /* gpre: make sRGB components grayscale and linear and premultiply by alpha */
1674 /* sRGB: convert linear components to sRGB, alpha := 255 */
1710 /* unpg: unpremultiply gray component and convert to sRGB (scale alpha) */
1724 out->r = out->g = out->b = sRGB((double)in->g / in->a);
1729 /* unpc: unpremultiply color components and convert to sRGB (scale alpha) */
1743 out->r = sRGB((double)in->r / in->a);
1744 out->g = sRGB((double)in->g / in->a);
1745 out->b = sRGB((double)in->b / in->a);
1750 /* b16g: composite linear onto gray background and convert the result to sRGB */
1763 out->r = out->g = out->b = sRGB(in->g * a + back->dg * a1);
1769 /* b16c: composite linear onto color background and convert the result to sRGB*/
1786 out->r = sRGB(in->r * a + back->dr * a1);
1787 out->g = sRGB(in->g * a + back->dg * a1);
1788 out->b = sRGB(in->b * a + back->db * a1);
1794 /* sG: convert linear RGB to sRGB grayscale */
1800 out->r = out->g = out->b = sRGB(YfromRGBint(in->r, in->g, in->b)/65535);
1804 /* sGp: unpremultiply RGB then convert to sRGB grayscale */
1818 out->r = out->g = out->b = sRGB(YfromRGBint(in->r, in->g, in->b)/in->a);
1823 /* sCp: unpremultiply RGB then convert to sRGB */
1837 out->r = sRGB((double)in->r / in->a);
1838 out->g = sRGB((double)in->g / in->a);
1839 out->b = sRGB((double)in->b / in->a);
1844 /* gb16: composite linear onto background and convert to sRGB grayscale */
1861 out->r = out->g = out->b = sRGB(in->g * a + back->dg * a1);
1867 /* cb16: composite linear onto background and convert to sRGB */
1891 out->r = sRGB(in->r * a + back->dr * a1);
1892 out->g = sRGB(in->g * a + back->dg * a1);
1893 out->b = sRGB(in->b * a + back->db * a1);
1944 * 16 G sRGB sRGB sRGB sRGB . . . .
1946 * 16 RGB sG sG sRGB sRGB g16 g16 . .
1994 * In some cases the conversion between sRGB formats goes via a linear
1995 * intermediate; an sRGB to linear conversion (as above) is followed by a simple
1996 * linear to sRGB step with no other conversions. This is done by a separate
1998 * (since final output is always sRGB not colormapped).
2149 /* The input value is 'NULL' to use the background and (otherwise) an sRGB
2152 * linear (16-bit) output the sRGB background color is ignored; the
2181 else /* sRGB output */
2264 * The following is *just* the result of a round trip from 8-bit sRGB to linear
2265 * then back to 8-bit sRGB when it is done by libpng. There are two problems:
2268 * in instability in the low values and even with 16-bit precision sRGB(1) ends
2269 * up mapping to sRGB(0) as a result of rounding in the 16-bit representation.
2274 * which is mapping sRGB(14) to sRGB(0).
2294 * case error arises with 16-bit 128.5, work out what sRGB
2299 * because libpng uses a simple power law for sRGB data at present.
3395 * side works ok. Check the conversion to sRGB if the copy is
3413 /* 'output' is linear, convert to the corresponding sRGB format.
3563 else if (strcmp(arg, "--sRGB-16bit") == 0)