From 7d9eb158ed637e5cc8fc446fa1266f07ffb04ba9 Mon Sep 17 00:00:00 2001 From: Jay Wang Date: Wed, 3 Aug 2016 18:10:38 -0700 Subject: SnapdragonCamera: support lower resolutions for Clearsight Support different resolutions when capturing in Clearsight mode. Also downscale the mono image to 2MP resolution when bayer size is greater than 2MP. If bayer size is less than 2MP, mono size will match with bayer. CRs-Fixed: 1058843 Change-Id: I8f9ddd81dd640b4efc316dd9ff05c26f339396a5 --- src/com/android/camera/CaptureModule.java | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) (limited to 'src/com/android/camera/CaptureModule.java') diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java index 0ae9c5ef1..a8df9feb1 100644 --- a/src/com/android/camera/CaptureModule.java +++ b/src/com/android/camera/CaptureModule.java @@ -176,6 +176,9 @@ public class CaptureModule implements CameraModule, PhotoController, public static CaptureRequest.Key JpegCropRectKey = new CaptureRequest.Key<>("org.codeaurora.qcamera3.jpeg_encode_crop.rect", int[].class); + public static CaptureRequest.Key JpegRoiRectKey = + new CaptureRequest.Key<>("org.codeaurora.qcamera3.jpeg_encode_crop.roi", + int[].class); public static CameraCharacteristics.Key MetaDataMonoOnlyKey = new CameraCharacteristics.Key<>("org.codeaurora.qcamera3.sensor_meta_data.is_mono_only", Byte.class); @@ -1285,7 +1288,7 @@ public class CaptureModule implements CameraModule, PhotoController, if (isClearSightOn()) { if(i == getMainCameraId()) { - ClearSightImageProcessor.getInstance().init(mPictureSize.getWidth(), + ClearSightImageProcessor.getInstance().init(map, mPictureSize.getWidth(), mPictureSize.getHeight(), mActivity, mOnMediaSavedListener); ClearSightImageProcessor.getInstance().setCallback(this); } @@ -3341,20 +3344,6 @@ public class CaptureModule implements CameraModule, PhotoController, return mUI.getTrackingFocusRenderer(); } - /** - * Compares two {@code Size}s based on their areas. - */ - static class CompareSizesByArea implements Comparator { - - @Override - public int compare(Size lhs, Size rhs) { - // We cast here to ensure the multiplications won't overflow - return Long.signum((long) lhs.getWidth() * lhs.getHeight() - - (long) rhs.getWidth() * rhs.getHeight()); - } - - } - private class MyCameraHandler extends Handler { public MyCameraHandler(Looper looper) { -- cgit v1.2.3