render/color: introduce color_transform_compose

It flattens color transform pipelines, and facilitates building
pipelines of variable content
This commit is contained in:
Félix Poisot 2025-11-28 18:21:45 +00:00 committed by Simon Ser
parent 3d8c471aef
commit 32d5fc1d11
3 changed files with 104 additions and 35 deletions

View file

@ -87,6 +87,16 @@ struct wlr_color_transform_inverse_eotf *wlr_color_transform_inverse_eotf_from_b
struct wlr_color_transform_lut_3x1d *color_transform_lut_3x1d_from_base(
struct wlr_color_transform *tr);
/**
* Create a simplified / normalized wlr_color_transform pipeline.
* `transforms` may contain NULL transforms, they will be interpreted as the
* identity transform, and removed.
* `*result` may be set to a tranform of a type different from
* `wlr_color_transform_pipeline`, or to NULL if all input transforms are NULL
*/
bool color_transform_compose(struct wlr_color_transform **result,
struct wlr_color_transform **transforms, size_t len);
/**
* Compute the matrix to convert RGB color values to CIE 1931 XYZ.
*/