From fa477d24076fde3202e939c9dd716481bb84dca6 Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Tue, 10 May 2022 14:20:58 +0300 Subject: [PATCH] tests/color_util: add TRANSFER_FN_IDENTITY This will be useful to make a curve in a color pipeline pass-through without needing to special-case skipping the curve. Signed-off-by: Pekka Paalanen --- tests/color_util.c | 3 +++ tests/color_util.h | 1 + 2 files changed, 4 insertions(+) diff --git a/tests/color_util.c b/tests/color_util.c index e7aa51f4..b8c66997 100644 --- a/tests/color_util.c +++ b/tests/color_util.c @@ -167,6 +167,9 @@ apply_tone_curve(enum transfer_fn fn, float r) float ret = 0; switch(fn) { + case TRANSFER_FN_IDENTITY: + ret = r; + break; case TRANSFER_FN_SRGB_EOTF: ret = sRGB_EOTF(r); break; diff --git a/tests/color_util.h b/tests/color_util.h index 3fc21aa4..b4cd1f55 100644 --- a/tests/color_util.h +++ b/tests/color_util.h @@ -58,6 +58,7 @@ struct lcmsMAT3 { }; enum transfer_fn { + TRANSFER_FN_IDENTITY, TRANSFER_FN_SRGB_EOTF, TRANSFER_FN_SRGB_EOTF_INVERSE, TRANSFER_FN_ADOBE_RGB_EOTF,