tests: drop EOTF from TRANSFER_FN_SRGB_EOTF

The sRGB display uses a power-2.2 transfer characteristic. These enum
values refer to the two-piece sRGB transfer function instead, so they
should not be named "EOTF".

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This commit is contained in:
Pekka Paalanen 2025-04-23 17:08:11 +03:00 committed by Pekka Paalanen
parent b2bc30034b
commit 338d727d99
6 changed files with 30 additions and 30 deletions

View file

@ -57,9 +57,9 @@ const struct lcms_pipeline pipeline_sRGB = {
.Green = { 0.300, 0.600, 1.0 }, .Green = { 0.300, 0.600, 1.0 },
.Blue = { 0.150, 0.060, 1.0 } .Blue = { 0.150, 0.060, 1.0 }
}, },
.pre_fn = TRANSFER_FN_SRGB_EOTF, .pre_fn = TRANSFER_FN_SRGB,
.mat = WESTON_MAT3F_IDENTITY, .mat = WESTON_MAT3F_IDENTITY,
.post_fn = TRANSFER_FN_SRGB_EOTF_INVERSE .post_fn = TRANSFER_FN_SRGB_INVERSE
}; };
const struct lcms_pipeline pipeline_adobeRGB = { const struct lcms_pipeline pipeline_adobeRGB = {
@ -69,7 +69,7 @@ const struct lcms_pipeline pipeline_adobeRGB = {
.Green = { 0.210, 0.710, 1.0 }, .Green = { 0.210, 0.710, 1.0 },
.Blue = { 0.150, 0.060, 1.0 } .Blue = { 0.150, 0.060, 1.0 }
}, },
.pre_fn = TRANSFER_FN_SRGB_EOTF, .pre_fn = TRANSFER_FN_SRGB,
.mat = WESTON_MAT3F( .mat = WESTON_MAT3F(
0.715127, 0.284868, 0.000005, 0.715127, 0.284868, 0.000005,
0.000001, 0.999995, 0.000004, 0.000001, 0.999995, 0.000004,
@ -84,7 +84,7 @@ const struct lcms_pipeline pipeline_BT2020 = {
.Green = { 0.170, 0.797, 1.0 }, .Green = { 0.170, 0.797, 1.0 },
.Blue = { 0.131, 0.046, 1.0 } .Blue = { 0.131, 0.046, 1.0 }
}, },
.pre_fn = TRANSFER_FN_SRGB_EOTF, .pre_fn = TRANSFER_FN_SRGB,
.mat = WESTON_MAT3F( .mat = WESTON_MAT3F(
0.627402, 0.329292, 0.043306, 0.627402, 0.329292, 0.043306,
0.069095, 0.919544, 0.011360, 0.069095, 0.919544, 0.011360,

View file

@ -61,9 +61,9 @@ const struct lcms_pipeline pipeline_sRGB = {
.Green = { 0.300, 0.600, 1.0 }, .Green = { 0.300, 0.600, 1.0 },
.Blue = { 0.150, 0.060, 1.0 } .Blue = { 0.150, 0.060, 1.0 }
}, },
.pre_fn = TRANSFER_FN_SRGB_EOTF, .pre_fn = TRANSFER_FN_SRGB,
.mat = WESTON_MAT3F_IDENTITY, .mat = WESTON_MAT3F_IDENTITY,
.post_fn = TRANSFER_FN_SRGB_EOTF_INVERSE .post_fn = TRANSFER_FN_SRGB_INVERSE
}; };
struct image_description { struct image_description {

View file

@ -59,8 +59,8 @@ struct color_tone_curve {
/* Mapping from enum transfer_fn to LittleCMS curve parameters. */ /* Mapping from enum transfer_fn to LittleCMS curve parameters. */
const struct color_tone_curve arr_curves[] = { const struct color_tone_curve arr_curves[] = {
{ {
.fn = TRANSFER_FN_SRGB_EOTF, .fn = TRANSFER_FN_SRGB,
.inv_fn = TRANSFER_FN_SRGB_EOTF_INVERSE, .inv_fn = TRANSFER_FN_SRGB_INVERSE,
.internal_type = 4, .internal_type = 4,
.param = { 2.4, 1. / 1.055, 0.055 / 1.055, 1. / 12.92, 0.04045 }, .param = { 2.4, 1. / 1.055, 0.055 / 1.055, 1. / 12.92, 0.04045 },
}, },
@ -113,10 +113,10 @@ transfer_fn_invert(enum transfer_fn fn)
return TRANSFER_FN_POWER2_4_EOTF_INVERSE; return TRANSFER_FN_POWER2_4_EOTF_INVERSE;
case TRANSFER_FN_POWER2_4_EOTF_INVERSE: case TRANSFER_FN_POWER2_4_EOTF_INVERSE:
return TRANSFER_FN_POWER2_4_EOTF; return TRANSFER_FN_POWER2_4_EOTF;
case TRANSFER_FN_SRGB_EOTF: case TRANSFER_FN_SRGB:
return TRANSFER_FN_SRGB_EOTF_INVERSE; return TRANSFER_FN_SRGB_INVERSE;
case TRANSFER_FN_SRGB_EOTF_INVERSE: case TRANSFER_FN_SRGB_INVERSE:
return TRANSFER_FN_SRGB_EOTF; return TRANSFER_FN_SRGB;
} }
test_assert_not_reached("bad transfer_fn"); test_assert_not_reached("bad transfer_fn");
return 0; return 0;
@ -136,10 +136,10 @@ transfer_fn_name(enum transfer_fn fn)
return "power 2.4"; return "power 2.4";
case TRANSFER_FN_POWER2_4_EOTF_INVERSE: case TRANSFER_FN_POWER2_4_EOTF_INVERSE:
return "inverse power 2.4"; return "inverse power 2.4";
case TRANSFER_FN_SRGB_EOTF: case TRANSFER_FN_SRGB:
return "sRGB EOTF"; return "sRGB two-piece";
case TRANSFER_FN_SRGB_EOTF_INVERSE: case TRANSFER_FN_SRGB_INVERSE:
return "inverse sRGB EOTF"; return "inverse sRGB two-piece";
} }
test_assert_not_reached("bad transfer_fn"); test_assert_not_reached("bad transfer_fn");
return 0; return 0;
@ -166,7 +166,7 @@ ensure_unit_range(float v)
} }
static float static float
sRGB_EOTF(float e) sRGB_two_piece(float e)
{ {
e = ensure_unit_range(e); e = ensure_unit_range(e);
if (e <= 0.04045) if (e <= 0.04045)
@ -176,7 +176,7 @@ sRGB_EOTF(float e)
} }
static float static float
sRGB_EOTF_inv(float o) sRGB_two_piece_inv(float o)
{ {
o = ensure_unit_range(o); o = ensure_unit_range(o);
if (o <= 0.04045 / 12.92) if (o <= 0.04045 / 12.92)
@ -222,11 +222,11 @@ apply_tone_curve(enum transfer_fn fn, float r)
case TRANSFER_FN_IDENTITY: case TRANSFER_FN_IDENTITY:
ret = r; ret = r;
break; break;
case TRANSFER_FN_SRGB_EOTF: case TRANSFER_FN_SRGB:
ret = sRGB_EOTF(r); ret = sRGB_two_piece(r);
break; break;
case TRANSFER_FN_SRGB_EOTF_INVERSE: case TRANSFER_FN_SRGB_INVERSE:
ret = sRGB_EOTF_inv(r); ret = sRGB_two_piece_inv(r);
break; break;
case TRANSFER_FN_ADOBE_RGB_EOTF: case TRANSFER_FN_ADOBE_RGB_EOTF:
ret = AdobeRGB_EOTF(r); ret = AdobeRGB_EOTF(r);
@ -272,13 +272,13 @@ color_float_apply_curve(enum transfer_fn fn, struct color_float c)
void void
sRGB_linearize(struct color_float *cf) sRGB_linearize(struct color_float *cf)
{ {
*cf = color_float_apply_curve(TRANSFER_FN_SRGB_EOTF, *cf); *cf = color_float_apply_curve(TRANSFER_FN_SRGB, *cf);
} }
void void
sRGB_delinearize(struct color_float *cf) sRGB_delinearize(struct color_float *cf)
{ {
*cf = color_float_apply_curve(TRANSFER_FN_SRGB_EOTF_INVERSE, *cf); *cf = color_float_apply_curve(TRANSFER_FN_SRGB_INVERSE, *cf);
} }
struct color_float struct color_float

View file

@ -52,8 +52,8 @@ struct color_float {
enum transfer_fn { enum transfer_fn {
TRANSFER_FN_IDENTITY, TRANSFER_FN_IDENTITY,
TRANSFER_FN_SRGB_EOTF, TRANSFER_FN_SRGB,
TRANSFER_FN_SRGB_EOTF_INVERSE, TRANSFER_FN_SRGB_INVERSE,
TRANSFER_FN_ADOBE_RGB_EOTF, TRANSFER_FN_ADOBE_RGB_EOTF,
TRANSFER_FN_ADOBE_RGB_EOTF_INVERSE, TRANSFER_FN_ADOBE_RGB_EOTF_INVERSE,
TRANSFER_FN_POWER2_4_EOTF, TRANSFER_FN_POWER2_4_EOTF,

View file

@ -51,8 +51,8 @@ compare_pipeline_to_transfer_fn(cmsPipeline *pipeline, enum transfer_fn fn,
} }
static const enum transfer_fn build_MPE_curves_test_set[] = { static const enum transfer_fn build_MPE_curves_test_set[] = {
TRANSFER_FN_SRGB_EOTF, TRANSFER_FN_SRGB,
TRANSFER_FN_SRGB_EOTF_INVERSE, TRANSFER_FN_SRGB_INVERSE,
TRANSFER_FN_ADOBE_RGB_EOTF, TRANSFER_FN_ADOBE_RGB_EOTF,
TRANSFER_FN_ADOBE_RGB_EOTF_INVERSE, TRANSFER_FN_ADOBE_RGB_EOTF_INVERSE,
TRANSFER_FN_POWER2_4_EOTF, TRANSFER_FN_POWER2_4_EOTF,

View file

@ -179,9 +179,9 @@ build_MPE_curve(cmsContext ctx, enum transfer_fn fn)
return build_MPE_curve_power(ctx, 2.4); return build_MPE_curve_power(ctx, 2.4);
case TRANSFER_FN_POWER2_4_EOTF_INVERSE: case TRANSFER_FN_POWER2_4_EOTF_INVERSE:
return build_MPE_curve_power(ctx, 1.0 / 2.4); return build_MPE_curve_power(ctx, 1.0 / 2.4);
case TRANSFER_FN_SRGB_EOTF: case TRANSFER_FN_SRGB:
return build_MPE_curve_sRGB(ctx); return build_MPE_curve_sRGB(ctx);
case TRANSFER_FN_SRGB_EOTF_INVERSE: case TRANSFER_FN_SRGB_INVERSE:
return build_MPE_curve_sRGB_inv(ctx); return build_MPE_curve_sRGB_inv(ctx);
default: default:
test_assert_not_reached("unimplemented MPE curve"); test_assert_not_reached("unimplemented MPE curve");