diff options
author | Wu-cheng Li <wuchengli@google.com> | 2010-01-27 22:55:14 +0800 |
---|---|---|
committer | Wu-cheng Li <wuchengli@google.com> | 2010-01-30 20:36:04 +0800 |
commit | 6c8d2760736a0753dad96b4bb8f98c7d075e6d54 (patch) | |
tree | 5df1fac94e122b86f92095d697d4da8bb737d210 /core | |
parent | 4c4300c71229638183d814ab8374e09f722910f5 (diff) | |
download | frameworks_base-6c8d2760736a0753dad96b4bb8f98c7d075e6d54.zip frameworks_base-6c8d2760736a0753dad96b4bb8f98c7d075e6d54.tar.gz frameworks_base-6c8d2760736a0753dad96b4bb8f98c7d075e6d54.tar.bz2 |
Add focal length and view angle API.
bug:2375989,2375987
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/hardware/Camera.java | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/core/java/android/hardware/Camera.java b/core/java/android/hardware/Camera.java index 82012b0..47c2cac 100644 --- a/core/java/android/hardware/Camera.java +++ b/core/java/android/hardware/Camera.java @@ -720,6 +720,9 @@ public class Camera { private static final String KEY_SCENE_MODE = "scene-mode"; private static final String KEY_FLASH_MODE = "flash-mode"; private static final String KEY_FOCUS_MODE = "focus-mode"; + 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"; // Parameter key suffix for supported values. private static final String SUPPORTED_VALUES_SUFFIX = "-values"; @@ -1507,6 +1510,36 @@ public class Camera { } /** + * Gets the focal length (in millimeter) of the camera. + * + * @return the focal length. This method will always return a valid + * value. + */ + public float getFocalLength() { + return Float.parseFloat(get(KEY_FOCAL_LENGTH)); + } + + /** + * Gets the horizontal angle of view in degrees. + * + * @return horizontal angle of view. This method will always return a + * valid value. + */ + public float getHorizontalViewAngle() { + return Float.parseFloat(get(KEY_HORIZONTAL_VIEW_ANGLE)); + } + + /** + * Gets the vertical angle of view in degrees. + * + * @return vertical angle of view. This method will always return a + * valid value. + */ + public float getVerticalViewAngle() { + return Float.parseFloat(get(KEY_VERTICAL_VIEW_ANGLE)); + } + + /** * Gets current zoom value. This also works when smooth zoom is in * progress. * |