HaxePunk/HaxePunk — pull request #223 by azrafe7 (2014-02-10 22:46:21+00:00)
Title: Crosstarget Pixel/Imagemask initial impl (see #215)

- should work with all mask (except SlopedGrid)
- added implementation of BitmapData.hitTest (as it's not yet provided by openFL)

This works as it is but needs some optimizations:
1. one could be making use of some BitmapData pooling for Imagemask (I have one [over here](https://github.com/azrafe7/HaxePunk/blob/feature/pixelmask/com/haxepunk/utils/BitmapDataPool.hx))
- making the retrieving of source BitmapData more obvious (esp. HARDWARE)
- optimize if no transformations are applied (angle, colorTranform, etc.)

A test is here: https://github.com/azrafe7/HaxePunk-minitests/tree/master/TestPixelmask-1 ([swf](https://dl.dropboxusercontent.com/u/32864004/dev/FPDemo/TestPixelmask-1.swf))

About `#2` see specifically how I _hacked_ around it in https://github.com/azrafe7/HaxePunk/blob/pixelmask-1/com/haxepunk/masks/Imagemask.hx#L85-L96 and https://github.com/azrafe7/HaxePunk/blob/pixelmask-1/com/haxepunk/graphics/Image.hx#L171-L188.

NOTE: This should probably not be merged as it is (well it could be worked upon later but...), I'd like to know your opinion about it (an IRC session maybe? that could probably be the faster way to address my doubts andl lead faster to a solution).