Re: [AD] About kryten2's bug

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


> I just realized that the new KEEP_TRANS mechanism makes it possible to fix
> the grabber bug, because the dithering mode can now preserve the pink mask
> color.

I think there is actually a flaw in generate_optimized_palette(): the code
reserves index 0 for the pink color (that's ok) but flags it as unavailable
(rsvd = -1) for the optimization process. Therefore, for a bitmap containing
transparent (pink) pixels, the code reserves another index for a pink color
and we end up with two pink color indexes.

This was needed because RGB mapping tables never contain index 0, hence pink
colors had to be mapped to another index. With the new COLORCONV_KEEP_TRANS,
all these limitations are gone since the pink tranparent color is always
mapped to index 0.

So I've attached a patch (quantize.diff) that makes index 0 available for
the optimization process in generate_optimized_palette(). In this way, a
bitmap containing only one pink (transparent) color generates a palette
containing only one pink index (0) too and the two pixel values are mapped
to each other in the COLORCONV_KEEP_TRANS mode.

> Therefore I propose to add an option (check box) to the grabber in order
> to enable/disable the KEEP_TRANS flag.

I've attached another patch (grabber.diff) which does that. It doesn't add
the flag to the dat properties because I think this would break backward
compatibility. Am I wrong ?

--
Eric Botcazou
ebotcazou@xxxxxxxxxx

Attachment: grabber.zip
Description: Zip compressed data



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/