Example usage for android.hardware.camera2 CaptureResult SENSOR_SENSITIVITY

List of usage examples for android.hardware.camera2 CaptureResult SENSOR_SENSITIVITY

Introduction

In this page you can find the example usage for android.hardware.camera2 CaptureResult SENSOR_SENSITIVITY.

Prototype

Key SENSOR_SENSITIVITY

To view the source code for android.hardware.camera2 CaptureResult SENSOR_SENSITIVITY.

Click Source Link

Document

The amount of gain applied to sensor data before processing.

The sensitivity is the standard ISO sensitivity value, as defined in ISO 12232:2006.

The sensitivity must be within CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange , and if if it less than CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY android.sensor.maxAnalogSensitivity , the camera device is guaranteed to use only analog amplification for applying the gain.

If the camera device cannot apply the exact sensitivity requested, it will reduce the gain to the nearest supported value.

Usage

From source file:freed.cam.apis.camera2.modules.PictureModuleApi2.java

@NonNull
private void process_rawWithDngConverter(ImageHolder image, int rawFormat, File file) {
    Log.d(TAG, "Create DNG VIA RAw2DNG");
    ByteBuffer buffer = image.getImage().getPlanes()[0].getBuffer();
    byte[] bytes = new byte[buffer.remaining()];
    buffer.get(bytes);/*from   www  . jav a  2  s.c o  m*/

    float fnum, focal = 0;
    fnum = image.getCaptureResult().get(CaptureResult.LENS_APERTURE);
    focal = image.getCaptureResult().get(CaptureResult.LENS_FOCAL_LENGTH);
    Log.d("Freedcam RawCM2", String.valueOf(bytes.length));

    int mISO = image.getCaptureResult().get(CaptureResult.SENSOR_SENSITIVITY).intValue();
    double mExposuretime = image.getCaptureResult().get(CaptureResult.SENSOR_EXPOSURE_TIME).doubleValue();
    //        int mFlash = image.getCaptureResult().get(CaptureResult.FLASH_STATE).intValue();
    //        double exposurecompensation= image.getCaptureResult().get(CaptureResult.CONTROL_AE_EXPOSURE_COMPENSATION).doubleValue();
    final DngProfile prof = getDngProfile(rawFormat, image);
    saveRawToDng(file, bytes, fnum, focal, (float) mExposuretime, mISO,
            image.captureResult.get(CaptureResult.JPEG_ORIENTATION), null, prof);
    image.getImage().close();
    bytes = null;
    buffer = null;
    image = null;
}

From source file:com.almalence.opencam.PluginManagerBase.java

@TargetApi(21)
public boolean addToSharedMemExifTagsFromCaptureResult(final CaptureResult result, final long SessionID,
        final int num) {
    String exposure_time = String.valueOf(result.get(CaptureResult.SENSOR_EXPOSURE_TIME));
    String sensitivity = String.valueOf(result.get(CaptureResult.SENSOR_SENSITIVITY));
    String aperture = String.valueOf(result.get(CaptureResult.LENS_APERTURE));
    String focal_lenght = String.valueOf(result.get(CaptureResult.LENS_FOCAL_LENGTH));
    String flash_mode = String.valueOf(result.get(CaptureResult.FLASH_MODE));
    String awb_mode = String.valueOf(result.get(CaptureResult.CONTROL_AWB_MODE));

    if (num != -1 && exposure_time != null && !exposure_time.equals("null"))
        addToSharedMem("exiftag_exposure_time" + num + SessionID, exposure_time);
    else if (exposure_time != null && !exposure_time.equals("null"))
        addToSharedMem("exiftag_exposure_time" + SessionID, exposure_time);
    if (sensitivity != null && !sensitivity.equals("null"))
        addToSharedMem("exiftag_iso" + SessionID, sensitivity);
    if (aperture != null && !aperture.equals("null"))
        addToSharedMem("exiftag_aperture" + SessionID, aperture);
    if (focal_lenght != null && !focal_lenght.equals("null"))
        addToSharedMem("exiftag_focal_lenght" + SessionID, focal_lenght);
    if (flash_mode != null && !flash_mode.equals("null"))
        addToSharedMem("exiftag_flash" + SessionID, flash_mode);
    if (awb_mode != null && !awb_mode.equals("null"))
        addToSharedMem("exiftag_white_balance" + SessionID, awb_mode);

    return true;/*from   ww w  . j a  v a 2s. com*/
}