diff --git a/tests/color_util.c b/tests/color_util.c index f51666dd..0e0c738a 100644 --- a/tests/color_util.c +++ b/tests/color_util.c @@ -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. diff --git a/tests/color_util.h b/tests/color_util.h index 6b6f96d7..27d7d3c8 100644 --- a/tests/color_util.h +++ b/tests/color_util.h @@ -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);