I'm looking for a quick method of doing variable levels of transparency.
My current scheme is to do shifts and adds. I can get a few levels this way but I'm wondering if there is an easier way to get finer control and still be fast.
i.e.
if (blend = 75) {
a = (*source >> 2) & 2MASK;
*dest = a + a + a + ((*dest >> 2) & 2MASK);
}
In this scheme I have to specifically test for each ratio I want and run a little bit different alg. I'm looking for an easy way to just give it a 0 - 255 number and do it in a loop while maintaining fixed point math.
Any help?
My current scheme is to do shifts and adds. I can get a few levels this way but I'm wondering if there is an easier way to get finer control and still be fast.
i.e.
if (blend = 75) {
a = (*source >> 2) & 2MASK;
*dest = a + a + a + ((*dest >> 2) & 2MASK);
}
In this scheme I have to specifically test for each ratio I want and run a little bit different alg. I'm looking for an easy way to just give it a 0 - 255 number and do it in a loop while maintaining fixed point math.
Any help?