summaryrefslogtreecommitdiffstats
path: root/src/org/codeaurora
diff options
context:
space:
mode:
authorJay Wang <jaywang@codeaurora.org>2016-08-26 14:55:12 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2016-09-15 15:07:25 -0700
commitfece21321499f4ff95d4141f268f10acce2ae23a (patch)
tree3e876fec38b04641ed7e568c38aad903f73a2920 /src/org/codeaurora
parent459f906d451019d862738951b4e7c756d3fe25ae (diff)
downloadandroid_packages_apps_Snap-fece21321499f4ff95d4141f268f10acce2ae23a.tar.gz
android_packages_apps_Snap-fece21321499f4ff95d4141f268f10acce2ae23a.tar.bz2
android_packages_apps_Snap-fece21321499f4ff95d4141f268f10acce2ae23a.zip
SnapdragonCamera: Fix cropping issues with CS output
Fix cropping issues with CS output for scenes +6ft. CRs-Fixed: 1058843 Change-Id: I03f9dda175cbba2cdbb5ec1d4933136525feef4a
Diffstat (limited to 'src/org/codeaurora')
-rw-r--r--src/org/codeaurora/snapcam/filter/ClearSightImageProcessor.java15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/org/codeaurora/snapcam/filter/ClearSightImageProcessor.java b/src/org/codeaurora/snapcam/filter/ClearSightImageProcessor.java
index a968e3bc6..15240ca23 100644
--- a/src/org/codeaurora/snapcam/filter/ClearSightImageProcessor.java
+++ b/src/org/codeaurora/snapcam/filter/ClearSightImageProcessor.java
@@ -213,7 +213,7 @@ public class ClearSightImageProcessor {
CameraCharacteristics cc = cm.getCameraCharacteristics("0");
byte[] blob = cc.get(OTP_CALIB_BLOB);
ClearSightNativeEngine.getInstance().init(mNumFrameCount*2,
- width, height, CamSystemCalibrationData.createFromBytes(blob));
+ maxWidth, maxHeight, CamSystemCalibrationData.createFromBytes(blob));
} catch (CameraAccessException e) {
e.printStackTrace();
}
@@ -715,6 +715,12 @@ public class ClearSightImageProcessor {
mImageProcessHandler.removeMessages(MSG_NEW_CAPTURE_FAIL);
mCaptureDone = true;
+
+ if(mReprocessingPairCount == 0) {
+ // No matching pairs
+ Log.w(TAG, "processFinalPair - no matching pairs found");
+ if(mCallback != null) mCallback.onClearSightFailure(null);
+ }
}
private void processNewReprocessImage(Message msg) {
@@ -1194,22 +1200,25 @@ public class ClearSightImageProcessor {
// if ratios are different, adjust crop rect to fit ratio
// if ratios are same, no need to adjust crop
+ Log.d(TAG, "getFinalCropRect - rect: " + rect.toString());
+ Log.d(TAG, "getFinalCropRect - ratios: " + rectRatio + ", " + mFinalPictureRatio);
if(rectRatio > mFinalPictureRatio) {
// ratio indicates need for horizontal crop
// add .5 to round up if necessary
int newWidth = (int)(((float)rect.height() * mFinalPictureRatio) + .5f);
- int newXoffset = (rect.width() - newWidth)/2;
+ int newXoffset = (rect.width() - newWidth)/2 + rect.left;
finalRect.left = newXoffset;
finalRect.right = newXoffset + newWidth;
} else if(rectRatio < mFinalPictureRatio) {
// ratio indicates need for vertical crop
// add .5 to round up if necessary
int newHeight = (int)(((float)rect.width() / mFinalPictureRatio) + .5f);
- int newYoffset = (rect.height() - newHeight)/2;
+ int newYoffset = (rect.height() - newHeight)/2 + rect.top;
finalRect.top = newYoffset;
finalRect.bottom = newYoffset + newHeight;
}
+ Log.d(TAG, "getFinalCropRect - final rect: " + finalRect.toString());
return finalRect;
}
}