6

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?

Jack
  • 1,825
  • 3
  • 26
  • 43

2 Answers2

5

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.

RevakoOA
  • 601
  • 1
  • 9
  • 20
  • Thanks for the reply.I want to add custom filtering effects like in candy cam and retrica app .Can you help me ? – Jack Jan 22 '16 at 17:34
  • 1
    Second api isn't popular. But I'll try to find something. _All capture sessions can be used for capturing images from the camera but only reprocessable capture sessions can reprocess images captured from the camera in the same session previously._ You should start from method createReprocessableCaptureSession() – RevakoOA Jan 23 '16 at 11:44
0

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

Faisal Halim
  • 231
  • 3
  • 11