Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit be143322 authored by Wu-cheng Li's avatar Wu-cheng Li Committed by Android (Google) Code Review
Browse files

Merge "Add exposure compensation parameter."

parents 739e1f8c ff723b6c
Loading
Loading
Loading
Loading
+36 −0
Original line number Diff line number Diff line
@@ -723,6 +723,7 @@ public class Camera {
        private static final String KEY_FOCAL_LENGTH = "focal-length";
        private static final String KEY_HORIZONTAL_VIEW_ANGLE = "horizontal-view-angle";
        private static final String KEY_VERTICAL_VIEW_ANGLE = "vertical-view-angle";
        private static final String KEY_EXPOSURE_COMPENSATION = "exposure-compensation";
        // Parameter key suffix for supported values.
        private static final String SUPPORTED_VALUES_SUFFIX = "-values";

@@ -1539,6 +1540,41 @@ public class Camera {
            return Float.parseFloat(get(KEY_VERTICAL_VIEW_ANGLE));
        }

        /**
         * Gets the current exposure compensation setting.
         *
         * @return the current exposure compensation value multiplied by 100.
         *         null if exposure compensation is not supported. Ex: -100
         *         means -1 EV. 130 means +1.3 EV.
         * @hide
         */
        public int getExposureCompensation() {
            return getInt(KEY_EXPOSURE_COMPENSATION);
        }

        /**
         * Sets the exposure compensation.
         *
         * @param value exposure compensation multiplied by 100. Ex: -100 means
         *        -1 EV. 130 means +1.3 EV.
         * @hide
         */
        public void setExposureCompensation(int value) {
            set(KEY_EXPOSURE_COMPENSATION, value);
        }

        /**
         * Gets the supported exposure compensation.
         *
         * @return a List of Integer constants. null if exposure compensation is
         *         not supported. The list is sorted from small to large. Ex:
         *         -100, -66, -33, 0, 33, 66, 100.
         * @hide
         */
        public List<Integer> getSupportedExposureCompensation() {
            return splitInt(get(KEY_EXPOSURE_COMPENSATION + SUPPORTED_VALUES_SUFFIX));
        }

        /**
         * Gets current zoom value. This also works when smooth zoom is in
         * progress.
+7 −0
Original line number Diff line number Diff line
@@ -187,6 +187,13 @@ public:
    // Vertical angle of view in degrees.
    // Example value: "42.5". Read only.
    static const char KEY_VERTICAL_VIEW_ANGLE[];
    // Exposure compensation. The value is multiplied by 100. -100 means -1 EV.
    // 130 means +1.3 EV.
    // Example value: "0" or "133". Read/write.
    static const char KEY_EXPOSURE_COMPENSATION[];
    // Supported exposure compensation.
    // Example value: "-100,-66,-33,0,33,66,100". Read only.
    static const char KEY_SUPPORTED_EXPOSURE_COMPENSATION[];


        // Values for white balance settings.
+2 −0
Original line number Diff line number Diff line
@@ -59,6 +59,8 @@ const char CameraParameters::KEY_SUPPORTED_FOCUS_MODES[] = "focus-mode-values";
const char CameraParameters::KEY_FOCAL_LENGTH[] = "focal-length";
const char CameraParameters::KEY_HORIZONTAL_VIEW_ANGLE[] = "horizontal-view-angle";
const char CameraParameters::KEY_VERTICAL_VIEW_ANGLE[] = "vertical-view-angle";
const char CameraParameters::KEY_EXPOSURE_COMPENSATION[] = "exposure-compensation";
const char CameraParameters::KEY_SUPPORTED_EXPOSURE_COMPENSATION[] = "exposure-compensation-values";

// Values for white balance settings.
const char CameraParameters::WHITE_BALANCE_AUTO[] = "auto";