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

Commit 09a2ab9d authored by Wu-cheng Li's avatar Wu-cheng Li
Browse files

Add camera focus distances API.

Applications can use this API to estimate the distance
between the subject and the camera.

bug:1955650
Change-Id: Ie6c8ea4971759cab6c9bcdda2c5ceb5925791c27
parent ea10bc61
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -69,8 +69,10 @@ const char CameraParameters::KEY_MAX_ZOOM[] = "max-zoom";
const char CameraParameters::KEY_ZOOM_RATIOS[] = "zoom-ratios";
const char CameraParameters::KEY_ZOOM_SUPPORTED[] = "zoom-supported";
const char CameraParameters::KEY_SMOOTH_ZOOM_SUPPORTED[] = "smooth-zoom-supported";
const char CameraParameters::KEY_FOCUS_DISTANCES[] = "focus-distances";

const char CameraParameters::TRUE[] = "true";
const char CameraParameters::INFINITY[] = "Infinity";

// Values for white balance settings.
const char CameraParameters::WHITE_BALANCE_AUTO[] = "auto";
+21 −0
Original line number Diff line number Diff line
@@ -221,9 +221,30 @@ public:
    // Example value: "true". Read only.
    static const char KEY_SMOOTH_ZOOM_SUPPORTED[];

    // The distances (in meters) from the camera to where an object appears to
    // be in focus. The object is sharpest at the optimal focus distance. The
    // depth of field is the far focus distance minus near focus distance.
    //
    // Applications can read this parameter anytime to get the latest focus
    // distances. If the focus mode is FOCUS_MODE_EDOF, the values may be all
    // 0, which means focus distance is not applicable. If the focus mode is
    // FOCUS_MODE_CONTINUOUS and autofocus has started, focus distances may
    // change from time to time.
    //
    // Far focus distance > optimal focus distance > near focus distance. If
    // the far focus distance is infinity, the value should be "Infinity" (case
    // sensitive). The format is three float values separated by commas. The
    // first is near focus distance. The second is optimal focus distance. The
    // third is far focus distance.
    // Example value: "0.95,1.9,Infinity" or "0.049,0.05,0.051". Read only.
    static const char KEY_FOCUS_DISTANCES[];

    // Value for KEY_ZOOM_SUPPORTED or KEY_SMOOTH_ZOOM_SUPPORTED.
    static const char TRUE[];

    // Value for KEY_FOCUS_DISTANCES.
    static const char INFINITY[];

    // Values for white balance settings.
    static const char WHITE_BALANCE_AUTO[];
    static const char WHITE_BALANCE_INCANDESCENT[];