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.
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:
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.
Android supports a subset of OpenGL. That would be the route to take if you're looking for speed.