From: Jehan Date: Mon, 13 Feb 2023 22:34:48 +0000 (+0100) Subject: babl: fix LUT from grayscale to RGBA images. X-Git-Tag: archive/raspbian/1%0.1.106-3+rpi1^2~15^2^2~29 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=da380ab0a8a60157ad069bba6aebca58ba18f087;p=babl.git 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. --- 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)