Tuesday, September 24, 2013

#autoselfie now with glitches

I updated the autoselfie app so that it will cause glitches on the image where you touch it. The glitches were ported from the glitchP5 processing library.

There were some interesting things I learnt about the Matrix. The ImageView will transform the bitmap you put in it. The touch events give x and y relative to the imageview not the bitmap. So how to know where to apply the glitch. Luckily the ImageView will tell you what it did to the bitmap with the getImageMatrix() call. This Matrix object contains all the translation, scale and rotation info. Luckily you don't have to decipher the matrix. You can create an inverse matrix and apply it to the bounding box of the path created by the touch events. This rectangle is then used to define the glitch area.

Get it on Google Play Get the app - see the stream

No comments: