From 09a2ab9dfe5c8fe74703b9894d930b1b1dbf0c11 Mon Sep 17 00:00:00 2001 From: Wu-cheng Li Date: Thu, 13 May 2010 19:31:02 +0800 Subject: 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 --- camera/CameraParameters.cpp | 2 ++ include/camera/CameraParameters.h | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/camera/CameraParameters.cpp b/camera/CameraParameters.cpp index cfb7ba1..035fa9f 100644 --- a/camera/CameraParameters.cpp +++ b/camera/CameraParameters.cpp @@ -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"; diff --git a/include/camera/CameraParameters.h b/include/camera/CameraParameters.h index 979df9f..19b052b 100644 --- a/include/camera/CameraParameters.h +++ b/include/camera/CameraParameters.h @@ -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[]; -- cgit v1.1