Re: [AD] auto convert bitmap mask to alpha channel

[ Thread Index | Date Index | More Archives ]

On Sat, 2009-07-18 at 12:34 -0500, Matthew Leverton wrote:
> Attached is an implementation of a proposal to allow the programmer to
> have Allegro auto convert a color mask to an alpha channel upon
> loading an image. It's most useful when loading a font:
> al_enable_load_bitmap_mask(al_map_rgb(255,0,255));
> font = al_load_font("a4font.bmp");
> al_disable_load_bitmap_mask();
> I realize you could load the bitmap, convert the mask, save it as a
> tga file, reload the font, etc. It's mostly meant as a way not to
> scare people transitioning from A4 with lots of old data files.
> Alternatively, there could be an al_load_masked_bitmap_font() or something.
> Or people could just be told to suck it up and convert all of their
> files. I have no strong feelings about it.

We could change the font loading code to understand the A4 format. If we
don't want to hardcode any colors, then the first non-background pixel
in the bitmap could be treated as transparency mask (if the bitmap has
no alpha).

Elias Pschernig <elias@xxxxxxxxxx>

Mail converted by MHonArc 2.6.19+