Monday, February 21, 2011

[android-developers] How to use drawBitmapMesh method for image warping

Hi,

I need to apply mesh warping on an image in android. Method
drawBitmapMesh can be used to define a mesh and apply the bulge warp
effect on an image.

This is the algorithm that can be used:
Remap pixels according to:

For each x, y

x' -> rn*Cos[a] + .5
y' -> rn*Sin[a] + .5

where
a = ArcTan[x - .5, y - .5]
rn = r^2.5/.5
r = Sqrt[(x - .5)^2 + (y - .5)^2]

Here is API Demo example how we can use it.
http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/BitmapMesh.html

But somehow when I use it, I do not get the desired output.

Can anyone please help?

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment