How to add LUT filter (from .CUBE file) in realtime camera preview?

162 Views Asked by At

Currently, I'm using the below code to show a preview of the camera on texture view. So can somebody help me with applying LUT filters from the cube file to the preview?

private void startPreview() {
    mCamera = Camera.open(camId);
    if (mCamera == null) {
        throw new RuntimeException("Default camera not available");
    }

    try {
        mCamera.setPreviewTexture(mSurfaceTexture);

        Display display = ((WindowManager) getSystemService(WINDOW_SERVICE)).getDefaultDisplay();

        if (display.getRotation() == Surface.ROTATION_0) {
            mCamera.setDisplayOrientation(90);
        }
        if (display.getRotation() == Surface.ROTATION_270) {
            mCamera.setDisplayOrientation(180);
        }
        mCamera.startPreview();
        inPreview = true;
    } catch (IOException ioe) {
        inPreview = false;
        Log.e(TAG, "Exception starting preview", ioe);
    }
}

Thank You.

0

There are 0 best solutions below