RedApparat / Fotoapparat

Making Camera for Android more friendly. 📸
Apache License 2.0
3.81k stars 405 forks source link

Set exposure sensitivity to 'Auto' #395

Closed AviranAbady closed 4 years ago

AviranAbady commented 4 years ago

Does FA support automatic dynamic exposure sensitivity? It seems to be set to manual with 0 as value

override val exposureCompensation: ExposureSelector = manualExposure(DEFAULT_EXPOSURE_COMPENSATION)

I see there's an option to use/provide an IntRange selector, is that the dynamic option? How do I choose the correct start/end range values?

Also, trying to use UpdateConfiguration, the call for getCapabilities seems to destroy the camera session that was created just before it. What's the proper way to use it?


private void initCamera(CameraView cameraView) {
        fotoApparat = Fotoapparat
                .with(getContext())
                .cameraErrorCallback(this)
                .into(cameraView)
                .previewScaleType(ScaleType.CenterCrop)
                .build();

        fotoApparat.getCapabilities().whenDone(capabilities -> {
            UpdateConfiguration config = UpdateConfiguration
                    .builder()
                    .exposureCompensation(lowestExposure())
                    .build();

            fotoApparat.updateConfiguration(config);
        });
    }