Can we use the EffectFactory class for lower versions

For my new assignment, I wanted to use some library that could provide the "Posterize" effect. I found many libraries like Aviary SDK and jhlabs . Yes, they are easy to use, but they make the code more heavy. Therefore, I continue to search for the Android API itself, which can perform a similar task. And after a lot of RnD, I finally found one of my EffectsFactory time saving class, which provides the same as me. I applied it in my assignment. But the bad thing was added at API level 14, and my application should be compatible with at least API level 8.

So my question is:

Can I use the EffectsFactory class for a lower version? If so, how?

Or, if not, do we have any API in the Android SDK that is similar to effectfactory?

Please avoid links to any library or NDK open library.

+8
android image-processing
source share
1 answer

No, there is no Android API that will publish the image below API 14. Even above API 14 EffectsFactory may not work, as the Android Documentation says:

Some effects may not be available on all platforms, so before creating a specific effect, the application must confirm that the effect is supported on this platform by calling isEffectSupported(String) .

However, you can easily make the easy decision yourself. Planning is a simple process. For example, the filter code for JHlabs posters is less than 50 lines (and most of them are sugar). In your shoes, if you use a third-party library, this is out of the question, I would have written my own without hesitation.

To edit . If you download images that the application receives from the camera, there is also Camera.Parameters.setColorEffect () , but again this is not supported on all devices, as in the documentation :

For example, an application should call getSupportedColorEffects() before calling setColorEffect(String) .

+3
source share

All Articles