PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Info on AlphaBlt and AlphaBltFast

I was wondering if the time required for alpha blending is the same regardless of the alpha value.

For example, if I have an alpha mask that is all white, will the blit be faster than if it's, for example, 200? Is the blending applied if the alpha value is 255 or 0?

Some of the graphics I use would be much nicer with blended edges, but not at the expense of too much speed.

Thanks!
If you use AlphaBlt or AlphaBltFast, alpha blending is not used if the mask is 0 or 255.

The code is basically:
Code:
If (alphavalue > 0)
{
pixel = *source
if (alphavalue < MAX) // 555 or 565 maximum
pixel = alphablend (pixel, *dest)
*dest = pixel
}

If you use Blt or BltFast, alpha blending is simply shut off if you use 0 or 255 for opacity (if you use 0 the function will return immediately).