diff options
author | Paul Rohde <codelogic@google.com> | 2014-12-05 12:17:15 -0800 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2016-01-15 10:01:23 -0800 |
commit | d8420e3702c5504e45a51fd29642167b4ab66312 (patch) | |
tree | 6aaebf6a1982a8897966821edc86efb004b079ae /src/com/android/camera/util/CameraUtil.java | |
parent | db2718622223b230618e9dae5b0c5d2eb4e68741 (diff) | |
download | android_packages_apps_Snap-d8420e3702c5504e45a51fd29642167b4ab66312.tar.gz android_packages_apps_Snap-d8420e3702c5504e45a51fd29642167b4ab66312.tar.bz2 android_packages_apps_Snap-d8420e3702c5504e45a51fd29642167b4ab66312.zip |
Drop new focus indicator into Camera2.
* Create a new custom focus view that interacts with physical lens diopter changes.
* Replace all occurances of the old focus indicator with the new one.
Change-Id: Ia02646ce4d1eb059ecb8a1dfccc15dfc9c167e1b
Diffstat (limited to 'src/com/android/camera/util/CameraUtil.java')
-rw-r--r-- | src/com/android/camera/util/CameraUtil.java | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/src/com/android/camera/util/CameraUtil.java b/src/com/android/camera/util/CameraUtil.java index 6765d2027..d508c7b33 100644 --- a/src/com/android/camera/util/CameraUtil.java +++ b/src/com/android/camera/util/CameraUtil.java @@ -767,7 +767,7 @@ public class CameraUtil { + "," + rect.right + "," + rect.bottom + ")"); } - public static void rectFToRect(RectF rectF, Rect rect) { + public static void inlineRectToRectF(RectF rectF, Rect rect) { rect.left = Math.round(rectF.left); rect.top = Math.round(rectF.top); rect.right = Math.round(rectF.right); @@ -776,7 +776,7 @@ public class CameraUtil { public static Rect rectFToRect(RectF rectF) { Rect rect = new Rect(); - rectFToRect(rectF, rect); + inlineRectToRectF(rectF, rect); return rect; } @@ -796,21 +796,6 @@ public class CameraUtil { matrix.postTranslate(viewWidth / 2f, viewHeight / 2f); } - public static void prepareMatrix(Matrix matrix, boolean mirror, int displayOrientation, - Rect previewRect) { - // Need mirror for front camera. - matrix.setScale(mirror ? -1 : 1, 1); - // This is the value for android.hardware.Camera.setDisplayOrientation. - matrix.postRotate(displayOrientation); - - // Camera driver coordinates range from (-1000, -1000) to (1000, 1000). - // We need to map camera driver coordinates to preview rect coordinates - Matrix mapping = new Matrix(); - mapping.setRectToRect(new RectF(-1000, -1000, 1000, 1000), rectToRectF(previewRect), - Matrix.ScaleToFit.FILL); - matrix.setConcat(mapping, matrix); - } - public static String createJpegName(long dateTaken, boolean refocus) { synchronized (sImageFileNamer) { return sImageFileNamer.generateName(dateTaken, refocus); |