From: Øyvind Kolås Date: Wed, 15 Feb 2023 16:21:56 +0000 (+0100) Subject: babl: LUT, only exclude associated alpha when copied X-Git-Tag: archive/raspbian/1%0.1.106-3+rpi1^2~15^2^2~24 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=920aee0b73805cf8f3acb57ff7975c07b004452f;p=babl.git babl: LUT, only exclude associated alpha when copied --- diff --git a/babl/babl-fish-path.c b/babl/babl-fish-path.c index c1e59a8..bda0c7b 100644 --- a/babl/babl-fish-path.c +++ b/babl/babl-fish-path.c @@ -962,26 +962,30 @@ _babl_fish_prepare_bpp (Babl *babl) babl_format_get_n_components (babl_source) - 1); const Babl *dest_type = babl_format_get_type (babl_dest, babl_format_get_n_components (babl_dest) - 1); + + int dest_not_associated = ((babl->conversion.destination->format.model->flags & + BABL_MODEL_FLAG_ASSOCIATED)==0); + if ( (babl->conversion.source->format.type[0]->bits < 32) - && ((babl->conversion.destination->format.model->flags & - BABL_MODEL_FLAG_ASSOCIATED)==0) - && ( ( source_bpp == 2 && dest_bpp == 16) ||( source_bpp == 4 && dest_bpp == 16 - && dest_type == babl_type_from_id (BABL_FLOAT)) + && dest_type == babl_type_from_id (BABL_FLOAT) + && dest_not_associated) ||( source_bpp == 4 && dest_bpp == 4 - && dest_type ==source_type) + && dest_type == source_type + && dest_not_associated) ||( source_bpp == 4 && dest_bpp == 8 - && dest_type == babl_type_from_id (BABL_U16)) + && dest_type == babl_type_from_id (BABL_U16) + && dest_not_associated) ||( source_bpp == 3 && dest_bpp == 4)