diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2014-05-21 05:04:01 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2014-05-21 05:04:01 -0700 |
commit | 4981abb118ff6730b653eaeebf61a682f3e5a89d (patch) | |
tree | 2b50d7cb46f70ee2ad78a8876f19131d093666d7 | |
parent | 3aa258be27016c1a63c72bd4d14a6bb67e464590 (diff) | |
parent | 306e7cf92e89291c3bfa4d869099371e1d5ff157 (diff) | |
download | android_packages_apps_Snap-4981abb118ff6730b653eaeebf61a682f3e5a89d.tar.gz android_packages_apps_Snap-4981abb118ff6730b653eaeebf61a682f3e5a89d.tar.bz2 android_packages_apps_Snap-4981abb118ff6730b653eaeebf61a682f3e5a89d.zip |
Merge "Camera: Decrease downsample factor for smaller resolution"
-rw-r--r-- | src/com/android/camera/PhotoModule.java | 7 | ||||
-rw-r--r-- | src/com/android/camera/PhotoUI.java | 8 |
2 files changed, 13 insertions, 2 deletions
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java index 01bbf33ae..01e3bd4f3 100644 --- a/src/com/android/camera/PhotoModule.java +++ b/src/com/android/camera/PhotoModule.java @@ -1092,6 +1092,13 @@ public class PhotoModule } // Animate capture with real jpeg data instead of a preview frame. if (mCameraState != LONGSHOT) { + Size pic_size = mParameters.getPictureSize(); + if ((pic_size.width <= 352) && (pic_size.height<= 288)) { + mUI.setDownFactor(2); //Downsample by 2 for CIF & below + } + else { + mUI.setDownFactor(4); + } mUI.animateCapture(jpegData, orientation, mMirror); } } else { diff --git a/src/com/android/camera/PhotoUI.java b/src/com/android/camera/PhotoUI.java index bc021a533..7717e1af0 100644 --- a/src/com/android/camera/PhotoUI.java +++ b/src/com/android/camera/PhotoUI.java @@ -68,7 +68,7 @@ public class PhotoUI implements PieListener, CameraManager.CameraFaceDetectionCallback { private static final String TAG = "CAM_UI"; - private static final int DOWN_SAMPLE_FACTOR = 4; + private int mDownSampleFactor = 4; private final AnimationManager mAnimationManager; private CameraActivity mActivity; private PhotoController mController; @@ -162,7 +162,7 @@ public class PhotoUI implements PieListener, @Override protected Bitmap doInBackground(Void... params) { // Decode image in background. - Bitmap bitmap = CameraUtil.downSample(mData, DOWN_SAMPLE_FACTOR); + Bitmap bitmap = CameraUtil.downSample(mData, mDownSampleFactor); if ((mOrientation != 0 || mMirror) && (bitmap != null)) { Matrix m = new Matrix(); if (mMirror) { @@ -234,6 +234,10 @@ public class PhotoUI implements PieListener, mPrevOrientationResize = false; } + public void setDownFactor(int factor) { + mDownSampleFactor = factor; + } + public void cameraOrientationPreviewResize(boolean orientation){ mPrevOrientationResize = mOrientationResize; mOrientationResize = orientation; |