render/color: add wlr_color_transfer_function_get_default_luminance()

This commit is contained in:
Simon Ser 2025-02-26 08:58:15 +01:00
parent 50537e2e6f
commit 10b8880fc7
3 changed files with 33 additions and 0 deletions

View file

@ -128,3 +128,23 @@ void wlr_color_primaries_to_xyz(const struct wlr_color_primaries *primaries, flo
};
memcpy(matrix, result, sizeof(result));
}
void wlr_color_transfer_function_get_default_luminance(enum wlr_color_transfer_function tf,
struct wlr_color_luminances *lum) {
switch (tf) {
case WLR_COLOR_TRANSFER_FUNCTION_ST2084_PQ:
*lum = (struct wlr_color_luminances){
.min = 0.005,
.max = 10000,
.reference = 203,
};
break;
default:
*lum = (struct wlr_color_luminances){
.min = 0.2,
.max = 80,
.reference = 80,
};
break;
}
}