adonthell-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Adonthell-devel] Surfaces with Per-Pixel Alpha


From: Kai Sterker
Subject: [Adonthell-devel] Surfaces with Per-Pixel Alpha
Date: Sat, 16 Feb 2008 11:36:24 +0100

An issue that comes up in conjunction with text rendering is that our
surface class doesn't easily support per-pixel alpha. The only way
right now to have per-pixel alpha is using surface::set_data(), which
entails a lot of additional copying around of buffers.

To get around it, I'd propose the following:

Extend surface::set_alpha() to take an additional bool per_pixel_alpha
that would be false by default, to remain backwards compatible. When
per_pixel_alpha is set to true, resizing the surface would create an
RGBA surface instead of an RGB surface.

All surface methods that take individual color components (like
map_color, put_pix, etc ...) would be extended to accept an (optional)
alpha value too.

That should allow rendering text on a translucent surface that can be
blitted pretty fast to any background while still looking good. The
overall impact on everything else would be minimal.

If there are no objections (and no better ideas), I'd implement that
over the weekend. Let me know if I'm missing something, as I'm not all
that familiar with the gfx stuff.

Kai




reply via email to

[Prev in Thread] Current Thread [Next in Thread]