How to add real time filtering effects in camera 2 API in Android

白昼怎懂夜的黑 提交于 2021-02-07 07:13:23

问题


I am developing a camera application in android, i want to enable real time filtering effects feature in to my app,I have used GPUimage filter to add filtering effects to an image.But i don't know how to enable real time filtering effects to camera preview before taking a picture.I have used camera and camera 2 api for below lollipop version and for lollipop version.Any library is available for this ?? I am a beginner,Can anyone help?


回答1:


If you need simple filters like sepia or negative you can just set CONTROL_EFFECT_MODE field in CaptureRequest instance via CaptureRequest.Builder method mBuilder.set(CaptureRequest.CONTROL_EFFECT_MODE, /*your value*/);

see developers doc for available values.




回答2:


yes I agree with the comments above, by using

mBuilder.set (CaptureRequest.CONTROL_EFFECT_MODE, / * your value * /);

Another example can use the code as below View More

mPreviewRequestBuilder.set (CaptureRequest.CONTROL_EFFECT_MODE, CaptureRequest.CONTROL_EFFECT_MODE_SEPIA);

complete documentation here



来源:https://stackoverflow.com/questions/33892915/how-to-add-real-time-filtering-effects-in-camera-2-api-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!