mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2025-12-20 10:30:10 +01:00
color: export weston_CIExy_to_XYZ()
This will be needed by color-lcms. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This commit is contained in:
parent
6a2ddee844
commit
6db55fe7e4
2 changed files with 8 additions and 5 deletions
|
|
@ -984,8 +984,8 @@ CIExy_to_z(struct weston_CIExy c)
|
||||||
return 1.0f - (c.x + c.y);
|
return 1.0f - (c.x + c.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct weston_vec3f
|
WL_EXPORT struct weston_vec3f
|
||||||
CIExy_to_XYZ(struct weston_CIExy c)
|
weston_CIExy_to_XYZ(struct weston_CIExy c)
|
||||||
{
|
{
|
||||||
return WESTON_VEC3F(c.x / c.y, 1.0f, CIExy_to_z(c) / c.y);
|
return WESTON_VEC3F(c.x / c.y, 1.0f, CIExy_to_z(c) / c.y);
|
||||||
}
|
}
|
||||||
|
|
@ -1024,7 +1024,7 @@ weston_normalized_primary_matrix_init(struct weston_mat3f *npm,
|
||||||
if (!weston_m3f_invert(&Pinv, P))
|
if (!weston_m3f_invert(&Pinv, P))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
struct weston_vec3f c = weston_m3f_mul_v3f(Pinv, CIExy_to_XYZ(w));
|
struct weston_vec3f c = weston_m3f_mul_v3f(Pinv, weston_CIExy_to_XYZ(w));
|
||||||
|
|
||||||
switch (dir) {
|
switch (dir) {
|
||||||
case WESTON_NPM_FORWARD:
|
case WESTON_NPM_FORWARD:
|
||||||
|
|
@ -1064,8 +1064,8 @@ weston_bradford_adaptation(struct weston_CIExy from, struct weston_CIExy to)
|
||||||
struct weston_mat3f tmp;
|
struct weston_mat3f tmp;
|
||||||
|
|
||||||
weston_m3f_invert(&inv, bradford);
|
weston_m3f_invert(&inv, bradford);
|
||||||
from_cr = weston_m3f_mul_v3f(bradford, CIExy_to_XYZ(from));
|
from_cr = weston_m3f_mul_v3f(bradford, weston_CIExy_to_XYZ(from));
|
||||||
to_cr = weston_m3f_mul_v3f(bradford, CIExy_to_XYZ(to));
|
to_cr = weston_m3f_mul_v3f(bradford, weston_CIExy_to_XYZ(to));
|
||||||
r = WESTON_VEC3F(to_cr.x / from_cr.x,
|
r = WESTON_VEC3F(to_cr.x / from_cr.x,
|
||||||
to_cr.y / from_cr.y,
|
to_cr.y / from_cr.y,
|
||||||
to_cr.z / from_cr.z);
|
to_cr.z / from_cr.z);
|
||||||
|
|
|
||||||
|
|
@ -756,4 +756,7 @@ weston_color_format_to_str(enum weston_color_format c);
|
||||||
char *
|
char *
|
||||||
weston_color_format_mask_to_str(uint32_t color_format_mask);
|
weston_color_format_mask_to_str(uint32_t color_format_mask);
|
||||||
|
|
||||||
|
struct weston_vec3f
|
||||||
|
weston_CIExy_to_XYZ(struct weston_CIExy c);
|
||||||
|
|
||||||
#endif /* WESTON_COLOR_H */
|
#endif /* WESTON_COLOR_H */
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue