From da380ab0a8a60157ad069bba6aebca58ba18f087 Mon Sep 17 00:00:00 2001 From: Jehan Date: Mon, 13 Feb 2023 23:34:48 +0100 Subject: [PATCH] babl: fix LUT from grayscale to RGBA images. Images from "Y'A" to "R'G'B'A" for instance would end up completely transparent because we were not reporting the alpha channel from the source to destination buffer. --- babl/babl-fish-path.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/babl/babl-fish-path.c b/babl/babl-fish-path.c index 808381c..a4b002a 100644 --- a/babl/babl-fish-path.c +++ b/babl/babl-fish-path.c @@ -200,8 +200,10 @@ static inline int _do_lut (uint32_t *lut, uint32_t *dst = (uint32_t*)destination; while (n--) { - *dst = lut[*src++]; - dst++; + uint16_t col = *src++; + *dst = lut[col & 0xff]; + *dst |= (((uint32_t) (col & 0xff00)) << 16); + dst++; } } else if (source_bpp == 2 && dest_bpp == 2) -- 2.30.2