render: introduce Gamma 2.2 color transform

This commit is contained in:
Félix Poisot 2025-08-17 15:51:26 +00:00
parent 6978509f64
commit c2d9ae2142
9 changed files with 31 additions and 1 deletions

View file

@ -42,6 +42,7 @@ static bool get_tf_preference(enum wlr_color_transfer_function tf) {
case WLR_COLOR_TRANSFER_FUNCTION_ST2084_PQ:
return 1;
case WLR_COLOR_TRANSFER_FUNCTION_EXT_LINEAR:
case WLR_COLOR_TRANSFER_FUNCTION_GAMMA22:
return -1;
}
abort(); // unreachable

View file

@ -993,6 +993,8 @@ wlr_color_manager_v1_transfer_function_to_wlr(enum wp_color_manager_v1_transfer_
return WLR_COLOR_TRANSFER_FUNCTION_ST2084_PQ;
case WP_COLOR_MANAGER_V1_TRANSFER_FUNCTION_EXT_LINEAR:
return WLR_COLOR_TRANSFER_FUNCTION_EXT_LINEAR;
case WP_COLOR_MANAGER_V1_TRANSFER_FUNCTION_GAMMA22:
return WLR_COLOR_TRANSFER_FUNCTION_GAMMA22;
default:
abort();
}
@ -1007,6 +1009,8 @@ wlr_color_manager_v1_transfer_function_from_wlr(enum wlr_color_transfer_function
return WP_COLOR_MANAGER_V1_TRANSFER_FUNCTION_ST2084_PQ;
case WLR_COLOR_TRANSFER_FUNCTION_EXT_LINEAR:
return WP_COLOR_MANAGER_V1_TRANSFER_FUNCTION_EXT_LINEAR;
case WLR_COLOR_TRANSFER_FUNCTION_GAMMA22:
return WP_COLOR_MANAGER_V1_TRANSFER_FUNCTION_GAMMA22;
}
abort();
}