Example usage for android.hardware.camera2 CameraCharacteristics SENSOR_INFO_SENSITIVITY_RANGE

List of usage examples for android.hardware.camera2 CameraCharacteristics SENSOR_INFO_SENSITIVITY_RANGE

Introduction

In this page you can find the example usage for android.hardware.camera2 CameraCharacteristics SENSOR_INFO_SENSITIVITY_RANGE.

Prototype

Key SENSOR_INFO_SENSITIVITY_RANGE

To view the source code for android.hardware.camera2 CameraCharacteristics SENSOR_INFO_SENSITIVITY_RANGE.

Click Source Link

Document

Range of sensitivities for CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity supported by this camera device.

The values are the standard ISO sensitivity values, as defined in ISO 12232:2006.

Range of valid values:
Min <= 100, Max >= 800

Optional - This value may be null on some devices.

Full capability - Present on all camera devices that report being CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL devices in the CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel key

Usage

From source file:com.example.android.camera2basic.Camera2BasicFragment.java

@Override
public void onStopTrackingTouch(SeekBar seekBar) {
    switch (seekBar.getId()) {
    case R.id.iso: {
        Range<Integer> range = mCameraCharacteristics.get(CameraCharacteristics.SENSOR_INFO_SENSITIVITY_RANGE);
        int max = range.getUpper();
        int min = range.getLower();
        isoValue = ((seekBar.getProgress() * (max - min)) / 100 + min);
        createCameraPreviewSession_ISO();
        break;/*from   w  w w.  ja va 2 s .  c  o  m*/
    }
    case R.id.focus: {
        float distance = mCameraCharacteristics.get(CameraCharacteristics.LENS_INFO_MINIMUM_FOCUS_DISTANCE);
        focusValue = seekBar.getProgress() * distance / 100;
        createCameraPreviewSession_FOCUS();
        break;
    }
    default:
        break;
    }

}