I'm trying to build a camera app based on CameraX and want to enable Bokeh (Blur) effect for the camera preview. This might be done by CameraX extensions, but how to enable them?
I've read the article about Vendor extensions at Android Developer Docs. I've tried to reuse their approach, but classes shown at the example are not included at CameraX alpha-02
import androidx.camera.extensions.BokehExtender;
void onCreate() {
// Create a Builder same as in normal workflow.
ImageCaptureConfig.Builder builder = new ImageCaptureConfig.Builder();
// Create a Extender object which can be used to apply extension
// configurations.
BokehImageCaptureExtender bokehImageCapture = new
BokehImageCaptureExtender(builder);
// Query if extension is available (optional).
if (bokehImageCapture.isExtensionAvailable()) {
// Enable the extension if available.
bokehImageCapture.enableExtension();
}
// Finish constructing configuration with the same flow as when not using
// extensions.
ImageCaptureConfig config = builder.build();
ImageCapture useCase = new ImageCapture(config);
CameraX.bindToLifecycle((LifecycleOwner)this, useCase);
}
I expected that BokehImageCaptureExtender will be imported, but looks like it's still not provided. And the whole package androidx.camera.extensions is missing.
This classes could be found at the official AndroidX git repository but it's hard to setup it without importing the full AndroidX project.