Example usage for android.hardware.camera2 CaptureResult CONTROL_AWB_MODE

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

Introduction

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

Prototype

Key CONTROL_AWB_MODE

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

Click Source Link

Document

Whether auto-white balance (AWB) is currently setting the color transform fields, and what its illumination target is.

This control is only effective if CaptureRequest#CONTROL_MODE android.control.mode is AUTO.

When set to the ON mode, the camera device's auto-white balance routine is enabled, overriding the application's selected CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform , CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains and CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode .

Usage

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  w w w.jav a 2s.com*/
}