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
This commit is contained in:
parent
751768c3c2
commit
201cf02d85
@ -173,7 +173,7 @@ proc img._.convert.bpp8g_to_bpp1 _src, _dst
|
|||||||
mov eax, [_dst]
|
mov eax, [_dst]
|
||||||
mov eax, [eax + Image.Palette]
|
mov eax, [eax + Image.Palette]
|
||||||
mov dword[eax], 0x00000000
|
mov dword[eax], 0x00000000
|
||||||
mov dword[eax + 4], 0x00ffffff
|
mov dword[eax + 4], 0xffffffff
|
||||||
mov edx, [ebx + Image.Height]
|
mov edx, [ebx + Image.Height]
|
||||||
.bpp8g_to_bpp1.line:
|
.bpp8g_to_bpp1.line:
|
||||||
mov ax, 0x0800
|
mov ax, 0x0800
|
||||||
@ -261,6 +261,7 @@ proc img._.convert.bpp24_to_bpp32 _src, _dst
|
|||||||
lodsw
|
lodsw
|
||||||
ror eax, 16
|
ror eax, 16
|
||||||
lodsb
|
lodsb
|
||||||
|
mov ah, 0xff ; opaque
|
||||||
rol eax, 16
|
rol eax, 16
|
||||||
stosd
|
stosd
|
||||||
dec ecx
|
dec ecx
|
||||||
@ -584,7 +585,7 @@ proc img._.convert.bpp8a_to_bpp1 _src, _dst
|
|||||||
mov eax, [_dst]
|
mov eax, [_dst]
|
||||||
mov eax, [eax + Image.Palette]
|
mov eax, [eax + Image.Palette]
|
||||||
mov dword[eax], 0x00000000
|
mov dword[eax], 0x00000000
|
||||||
mov dword[eax + 4], 0x00ffffff
|
mov dword[eax + 4], 0xffffffff
|
||||||
mov edx, [ebx + Image.Height]
|
mov edx, [ebx + Image.Height]
|
||||||
.bpp8a_to_bpp1.line:
|
.bpp8a_to_bpp1.line:
|
||||||
mov ax, 0x0800
|
mov ax, 0x0800
|
||||||
|
@ -273,7 +273,8 @@ img.decode.gif.cur_color_table_size_child equ ebp + 4 + 4 + 4*3 + 4
|
|||||||
lodsd
|
lodsd
|
||||||
dec esi
|
dec esi
|
||||||
bswap eax
|
bswap eax
|
||||||
shr eax, 8
|
mov al, 0xff ; opaque
|
||||||
|
ror eax, 8
|
||||||
stosd
|
stosd
|
||||||
loop @b
|
loop @b
|
||||||
add ebx, sizeof.gif.ImageDescriptor
|
add ebx, sizeof.gif.ImageDescriptor
|
||||||
|
Loading…
Reference in New Issue
Block a user