tests/color_util: add transfer_fn_name()

This helps reporting test results, then you can print the fn by name.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
dev
Pekka Paalanen 3 years ago committed by Pekka Paalanen
parent 142d8e5125
commit 0225453fb1
  1. 23
      tests/color_util.c
  2. 3
      tests/color_util.h

@ -121,6 +121,29 @@ transfer_fn_invert(enum transfer_fn fn)
return 0;
}
const char *
transfer_fn_name(enum transfer_fn fn)
{
switch (fn) {
case TRANSFER_FN_ADOBE_RGB_EOTF:
return "AdobeRGB EOTF";
case TRANSFER_FN_ADOBE_RGB_EOTF_INVERSE:
return "inverse AdobeRGB EOTF";
case TRANSFER_FN_IDENTITY:
return "identity";
case TRANSFER_FN_POWER2_4_EOTF:
return "power 2.4";
case TRANSFER_FN_POWER2_4_EOTF_INVERSE:
return "inverse power 2.4";
case TRANSFER_FN_SRGB_EOTF:
return "sRGB EOTF";
case TRANSFER_FN_SRGB_EOTF_INVERSE:
return "inverse sRGB EOTF";
}
assert(0 && "bad transfer_fn");
return 0;
}
/**
* NaN comes out as is
*This function is not intended for hiding NaN.

@ -110,6 +110,9 @@ color_float_apply_matrix(const struct lcmsMAT3 *mat, struct color_float c);
enum transfer_fn
transfer_fn_invert(enum transfer_fn fn);
const char *
transfer_fn_name(enum transfer_fn fn);
void
lcmsMAT3_invert(struct lcmsMAT3 *result, const struct lcmsMAT3 *mat);

Loading…
Cancel
Save