From 201cf02d8577016aa3fa54804c2671b147923f27 Mon Sep 17 00:00:00 2001 From: Ivan Baravy Date: Sun, 13 Dec 2020 17:22:19 +0000 Subject: [PATCH] libimg: transparency fixes. img.convert doesn't make opaque pixels transparent. gif decoder considers palette pixels opaque. git-svn-id: svn://kolibrios.org@8394 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/develop/libraries/libs-dev/libimg/convert.asm | 5 +++-- programs/develop/libraries/libs-dev/libimg/gif/gif.asm | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/programs/develop/libraries/libs-dev/libimg/convert.asm b/programs/develop/libraries/libs-dev/libimg/convert.asm index 34b1a4c4be..900dad12f3 100644 --- a/programs/develop/libraries/libs-dev/libimg/convert.asm +++ b/programs/develop/libraries/libs-dev/libimg/convert.asm @@ -173,7 +173,7 @@ proc img._.convert.bpp8g_to_bpp1 _src, _dst mov eax, [_dst] mov eax, [eax + Image.Palette] mov dword[eax], 0x00000000 - mov dword[eax + 4], 0x00ffffff + mov dword[eax + 4], 0xffffffff mov edx, [ebx + Image.Height] .bpp8g_to_bpp1.line: mov ax, 0x0800 @@ -261,6 +261,7 @@ proc img._.convert.bpp24_to_bpp32 _src, _dst lodsw ror eax, 16 lodsb + mov ah, 0xff ; opaque rol eax, 16 stosd dec ecx @@ -584,7 +585,7 @@ proc img._.convert.bpp8a_to_bpp1 _src, _dst mov eax, [_dst] mov eax, [eax + Image.Palette] mov dword[eax], 0x00000000 - mov dword[eax + 4], 0x00ffffff + mov dword[eax + 4], 0xffffffff mov edx, [ebx + Image.Height] .bpp8a_to_bpp1.line: mov ax, 0x0800 diff --git a/programs/develop/libraries/libs-dev/libimg/gif/gif.asm b/programs/develop/libraries/libs-dev/libimg/gif/gif.asm index 7f868a43b6..341270e167 100644 --- a/programs/develop/libraries/libs-dev/libimg/gif/gif.asm +++ b/programs/develop/libraries/libs-dev/libimg/gif/gif.asm @@ -273,7 +273,8 @@ img.decode.gif.cur_color_table_size_child equ ebp + 4 + 4 + 4*3 + 4 lodsd dec esi bswap eax - shr eax, 8 + mov al, 0xff ; opaque + ror eax, 8 stosd loop @b add ebx, sizeof.gif.ImageDescriptor