summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSuman Mukherjee <sumam@codeaurora.org>2014-05-14 14:12:22 +0530
committerSteve Kondik <shade@chemlab.org>2014-10-29 07:01:46 +0000
commit9dc82ab8b42a547a4b1ff2cbdc8c13deb10093af (patch)
tree93cf3b1f07a0de7dbf21518e2d46d0779d1764c3
parentfaca25958436d4aa9236d6685eb48f00c88c27b3 (diff)
downloadandroid_packages_apps_Camera2-9dc82ab8b42a547a4b1ff2cbdc8c13deb10093af.tar.gz
android_packages_apps_Camera2-9dc82ab8b42a547a4b1ff2cbdc8c13deb10093af.tar.bz2
android_packages_apps_Camera2-9dc82ab8b42a547a4b1ff2cbdc8c13deb10093af.zip
Camera: Decrease downsample factor for smaller resolution
After image capture, animation takes place with a downsampled image (by factor 4). Due to downsampling smaller resolution (QCIF and others) image size for animated thumbnail is going below the allocated size and it appeared very small. Fix: For image size of resolution CIF downwards, use downsampling factor as 2 without affecting performance for other resolution. Change-Id: I1098fc1a8f6fb880d5c36ebd2eaeec4415c75fe1 CRs-Fixed: 662891
-rw-r--r--src/com/android/camera/PhotoModule.java6
-rw-r--r--src/com/android/camera/PhotoUI.java8
2 files changed, 12 insertions, 2 deletions
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java
index ee0f3b273..09e317915 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -1213,6 +1213,12 @@ public class PhotoModule
}
// Animate capture with real jpeg data instead of a preview frame.
if (!mBurstShotInProgress && 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,
(mSnapshotMode == CameraInfo.CAMERA_SUPPORT_MODE_ZSL) &&
(mSceneMode != CameraUtil.SCENE_MODE_HDR));
diff --git a/src/com/android/camera/PhotoUI.java b/src/com/android/camera/PhotoUI.java
index 83a7e474d..2b0f355f9 100644
--- a/src/com/android/camera/PhotoUI.java
+++ b/src/com/android/camera/PhotoUI.java
@@ -74,7 +74,7 @@ public class PhotoUI implements PieListener,
private static final String TAG = "CAM_UI";
private static final String PERSIST_LONG_ENABLE = "persist.camera.longshot.enable";
- private static final int DOWN_SAMPLE_FACTOR = 4;
+ private int mDownSampleFactor = 4;
private final AnimationManager mAnimationManager;
private CameraActivity mActivity;
private PhotoController mController;
@@ -176,7 +176,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) {
@@ -280,6 +280,10 @@ public class PhotoUI implements PieListener,
mPrevOrientationResize = false;
}
+ public void setDownFactor(int factor) {
+ mDownSampleFactor = factor;
+ }
+
public void cameraOrientationPreviewResize(boolean orientation){
mPrevOrientationResize = mOrientationResize;
mOrientationResize = orientation;