Home | History | Annotate | Download | only in libtests

Lines Matching defs:sRGB

48 #include "../tools/sRGB.h"
61 * misbehavior, such as using a simple power law to correct sRGB to linear.
150 /* sRGB support: use exact calculations rounded to the nearest int, see the
173 sRGB(double linear /*range 0.0 .. 1.0*/)
181 return sRGB(fixed_linear / 65535.);
195 return sRGB((double)component / alpha);
236 * sRGB transform, given an 8-bit value which might be either sRGB or power-law.
360 printf(" --sRGB-16bit");
378 "sRGB-gray",
379 "sRGB-gray+alpha",
380 "sRGB-rgb",
381 "sRGB-rgb+alpha",
387 "color-mapped-sRGB-gray",
388 "color-mapped-sRGB-gray+alpha",
389 "color-mapped-sRGB-rgb",
390 "color-mapped-sRGB-rgb+alpha",
396 "sRGB-gray",
397 "sRGB-gray+alpha",
398 "sRGB-bgr",
399 "sRGB-bgr+alpha",
405 "color-mapped-sRGB-gray",
406 "color-mapped-sRGB-gray+alpha",
407 "color-mapped-sRGB-bgr",
408 "color-mapped-sRGB-bgr+alpha",
414 "sRGB-gray",
415 "alpha+sRGB-gray",
416 "sRGB-rgb",
417 "alpha+sRGB-rgb",
423 "color-mapped-sRGB-gray",
424 "color-mapped-alpha+sRGB-gray",
425 "color-mapped-sRGB-rgb",
426 "color-mapped-alpha+sRGB-rgb",
432 "sRGB-gray",
433 "alpha+sRGB-gray",
434 "sRGB-bgr",
435 "alpha+sRGB-bgr",
441 "color-mapped-sRGB-gray",
442 "color-mapped-alpha+sRGB-gray",
443 "color-mapped-sRGB-bgr",
444 "color-mapped-alpha+sRGB-bgr",
798 /* The background as the original sRGB 8-bit value converted to the final
1165 * 16 G sRGB sRGB sRGB sRGB . . . .
1167 * 16 RGB sG sG sRGB sRGB g16 g16 . .
1173 * g8: convert sRGB components to sRGB grayscale
1174 * g8b: convert sRGB components to grayscale and composite on gray background
1177 * lin: make sRGB components linear, alpha := 65535
1178 * pre: make sRGB components linear and premultiply by alpha (scale alpha)
1180 * glin: make sRGB components linear, convert to grayscale, alpha := 65535
1181 * gpre: make sRGB components grayscale and linear and premultiply by alpha
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)
1188 * b16g: composite linear onto gray background and convert the result to sRGB
1189 * b16c: composite linear onto color background and convert the result to sRGB
1190 * sG: convert linear RGB to sRGB grayscale
1191 * sGp: unpremultiply RGB then convert to sRGB grayscale
1192 * sCp: unpremultiply RGB then convert to sRGB
1193 * gb16: composite linear onto background and convert to sRGB grayscale
1195 * cb16: composite linear onto background and convert to sRGB
1266 out->r = out->g = out->b = sRGB(sRGB_to_d[in->g] * a + back->dg * (1-a));
1294 out->r = sRGB(sRGB_to_d[in->r] * a + back->dr * (1-a));
1295 out->g = sRGB(sRGB_to_d[in->g] * a + back->dg * (1-a));
1296 out->b = sRGB(sRGB_to_d[in->b] * a + back->db * (1-a));
1302 /* g8: convert sRGB components to sRGB grayscale */
1313 sRGB(YfromRGB(sRGB_to_d[in->r], sRGB_to_d[in->g], sRGB_to_d[in->b]));
1318 /* g8b: convert sRGB components to grayscale and composite on gray background */
1331 out->r = out->g = out->b = sRGB(YfromRGB(
1339 out->r = out->g = out->b = sRGB(a * YfromRGB(sRGB_to_d[in->r],
1347 /* lin: make sRGB components linear, alpha := 65535 */
1383 /* pre: make sRGB components linear and premultiply by alpha (scale alpha) */
1455 /* glin: make sRGB components linear, convert to grayscale, alpha := 65535 */
1471 /* gpre: make sRGB components grayscale and linear and premultiply by alpha */
1675 /* sRGB: convert linear components to sRGB, alpha := 255 */
1711 /* unpg: unpremultiply gray component and convert to sRGB (scale alpha) */
1725 out->r = out->g = out->b = sRGB((double)in->g / in->a);
1730 /* unpc: unpremultiply color components and convert to sRGB (scale alpha) */
1744 out->r = sRGB((double)in->r / in->a);
1745 out->g = sRGB((double)in->g / in->a);
1746 out->b = sRGB((double)in->b / in->a);
1751 /* b16g: composite linear onto gray background and convert the result to sRGB */
1764 out->r = out->g = out->b = sRGB(in->g * a + back->dg * a1);
1770 /* b16c: composite linear onto color background and convert the result to sRGB*/
1787 out->r = sRGB(in->r * a + back->dr * a1);
1788 out->g = sRGB(in->g * a + back->dg * a1);
1789 out->b = sRGB(in->b * a + back->db * a1);
1795 /* sG: convert linear RGB to sRGB grayscale */
1801 out->r = out->g = out->b = sRGB(YfromRGBint(in->r, in->g, in->b)/65535);
1805 /* sGp: unpremultiply RGB then convert to sRGB grayscale */
1819 out->r = out->g = out->b = sRGB(YfromRGBint(in->r, in->g, in->b)/in->a);
1824 /* sCp: unpremultiply RGB then convert to sRGB */
1838 out->r = sRGB((double)in->r / in->a);
1839 out->g = sRGB((double)in->g / in->a);
1840 out->b = sRGB((double)in->b / in->a);
1845 /* gb16: composite linear onto background and convert to sRGB grayscale */
1862 out->r = out->g = out->b = sRGB(in->g * a + back->dg * a1);
1868 /* cb16: composite linear onto background and convert to sRGB */
1892 out->r = sRGB(in->r * a + back->dr * a1);
1893 out->g = sRGB(in->g * a + back->dg * a1);
1894 out->b = sRGB(in->b * a + back->db * a1);
1945 * 16 G sRGB sRGB sRGB sRGB . . . .
1947 * 16 RGB sG sG sRGB sRGB g16 g16 . .
1995 * In some cases the conversion between sRGB formats goes via a linear
1996 * intermediate; an sRGB to linear conversion (as above) is followed by a simple
1997 * linear to sRGB step with no other conversions. This is done by a separate
1999 * (since final output is always sRGB not colormapped).
2150 /* The input value is 'NULL' to use the background and (otherwise) an sRGB
2153 * linear (16-bit) output the sRGB background color is ignored; the
2182 else /* sRGB output */
2265 * The following is *just* the result of a round trip from 8-bit sRGB to linear
2266 * then back to 8-bit sRGB when it is done by libpng. There are two problems:
2269 * in instability in the low values and even with 16-bit precision sRGB(1) ends
2270 * up mapping to sRGB(0) as a result of rounding in the 16-bit representation.
2275 * which is mapping sRGB(14) to sRGB(0).
2295 * case error arises with 16-bit 128.5, work out what sRGB
2300 * because libpng uses a simple power law for sRGB data at present.
3385 * side works ok. Check the conversion to sRGB if the copy is
3403 /* 'output' is linear, convert to the corresponding sRGB format.
3553 else if (strcmp(arg, "--sRGB-16bit") == 0)