forked from: Bitmap Edge and Orientation Transform Best

written by j2e japanese2english@gmail.com
The function itself takes bitmapData and overwrites it with edge data.
The edge data is color-coded and can be used to determine
the orientation of the edge at any point when read or further manipulated.
Vertical edges are more red. Horizontal edges are more cyan/green.
Edges which go from upper right to lower left are more yellow, and 
edges which go from upper left to lower right are more blue.
I think this is similar to the edge filter in Photoshop, but may be less efficient.
At any rate, this is the fixed version that I wrote from scratch. Use at your own risk (-_^)
This demo version takes a snapshot from a webcam when you click the mouse over
flash stage, and it shows the effects of the function.