I am looking for a way to add more advanced blend modes to my program (ones that I could define myself). How would you suggest going about this with Android?
Setting pixels individually is too slow to be a viable solution.
It's possible even without openGL. PorterDuff should be the solution:
android.graphics.PorterDuffXfermode
and
android.graphics.PorterDuff
Here is a very good example:
http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/Xfermodes.html
To be honest I'm not sure this is supported. Using OpenGL as an example, the blending modes are defined by the OpenGL ES Spec, so that they can potentially be implemented in hardware. Adding your own blend function would be breaking the spec, not to mention incredibly slow, because it would have to act pixel by pixel.
I'm not so sure about canvas, but I believe that you can't do it there either, for similar reasons.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With