diff --git a/tests/color_util.c b/tests/color_util.c index b8c66997..cc4d3fab 100644 --- a/tests/color_util.c +++ b/tests/color_util.c @@ -93,6 +93,29 @@ find_tone_curve_type(enum transfer_fn fn, int *type, double params[5]) return false; } +enum transfer_fn +transfer_fn_invert(enum transfer_fn fn) +{ + switch (fn) { + case TRANSFER_FN_ADOBE_RGB_EOTF: + return TRANSFER_FN_ADOBE_RGB_EOTF_INVERSE; + case TRANSFER_FN_ADOBE_RGB_EOTF_INVERSE: + return TRANSFER_FN_ADOBE_RGB_EOTF; + case TRANSFER_FN_IDENTITY: + return TRANSFER_FN_IDENTITY; + case TRANSFER_FN_POWER2_4_EOTF: + return TRANSFER_FN_POWER2_4_EOTF_INVERSE; + case TRANSFER_FN_POWER2_4_EOTF_INVERSE: + return TRANSFER_FN_POWER2_4_EOTF; + case TRANSFER_FN_SRGB_EOTF: + return TRANSFER_FN_SRGB_EOTF_INVERSE; + case TRANSFER_FN_SRGB_EOTF_INVERSE: + return TRANSFER_FN_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 b4cd1f55..14fd6095 100644 --- a/tests/color_util.h +++ b/tests/color_util.h @@ -106,3 +106,6 @@ process_pixel_using_pipeline(enum transfer_fn pre_curve, struct color_float color_float_apply_matrix(const struct lcmsMAT3 *mat, struct color_float c); + +enum transfer_fn +transfer_fn_invert(enum transfer_fn fn);