mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-02-05 04:06:11 -05:00
render/color: move inverse EOTF eval helper to private header
This will be used by the DRM backend in the next commit.
This commit is contained in:
parent
0d24cdb822
commit
f9a27c5b6f
2 changed files with 7 additions and 2 deletions
|
|
@ -97,4 +97,9 @@ void wlr_color_primaries_to_xyz(const struct wlr_color_primaries *primaries, flo
|
|||
void wlr_color_transfer_function_get_default_luminance(enum wlr_color_transfer_function tf,
|
||||
struct wlr_color_luminances *lum);
|
||||
|
||||
/**
|
||||
* Apply a color transfer function's EOTF⁻¹ operation.
|
||||
*/
|
||||
float wlr_color_transfer_function_eval_inverse_eotf(enum wlr_color_transfer_function tf, float x);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@ static float bt1886_eval_inverse_eotf(float x) {
|
|||
return powf(x / a, 1.0 / 2.4) - b;
|
||||
}
|
||||
|
||||
static float transfer_function_eval_inverse_eotf(
|
||||
float wlr_color_transfer_function_eval_inverse_eotf(
|
||||
enum wlr_color_transfer_function tf, float x) {
|
||||
switch (tf) {
|
||||
case WLR_COLOR_TRANSFER_FUNCTION_SRGB:
|
||||
|
|
@ -198,7 +198,7 @@ static void color_transform_inverse_eotf_eval(
|
|||
struct wlr_color_transform_inverse_eotf *tr,
|
||||
float out[static 3], const float in[static 3]) {
|
||||
for (size_t i = 0; i < 3; i++) {
|
||||
out[i] = transfer_function_eval_inverse_eotf(tr->tf, in[i]);
|
||||
out[i] = wlr_color_transfer_function_eval_inverse_eotf(tr->tf, in[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue