I have a BitmapData object with an alpha channel. I’d like to know the fastet way to offset that alpha channel in ActionScript3 (FlashPlayer10). By offsetting I mean shifting all pixels of that channel in one direction (wrapping around the image borders) while leaving the color channels as they were.
Is there a good way to apply a such a transform to one channel only?
I think how I would tackle this is to create a clone() of the original bitmapData object. Leave the original intact. With the clone, shift all the pixels the way you want. There’s no built in “scroll with carry” but it’s not too hard. Here’s some code for one, but you can simplify it a lot if you only do one direction:
http://www.actionscript.org/forums/showthread.php3?p=767722
AFter scrolling, use copyChannel() to copy the alpha channel from your scrolled clone back to the original.