summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com/android/camera/CaptureModule.java6
-rw-r--r--src/org/codeaurora/snapcam/filter/ClearSightImageProcessor.java10
2 files changed, 16 insertions, 0 deletions
diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java
index baace39..ee4bcc7 100644
--- a/src/com/android/camera/CaptureModule.java
+++ b/src/com/android/camera/CaptureModule.java
@@ -162,6 +162,12 @@ public class CaptureModule implements CameraModule, PhotoController,
CaptureRequest.Key<Integer> BayerMonoLinkSessionIdKey =
new CaptureRequest.Key<>("org.codeaurora.qcamera3.dualcam_link_meta_data" +
".related_camera_id", Integer.class);
+ public static CaptureRequest.Key<Byte> JpegCropEnableKey =
+ new CaptureRequest.Key<>("org.codeaurora.qcamera3.jpeg_encode_crop.enable",
+ Byte.class);
+ public static CaptureRequest.Key<int[]> JpegCropRectKey =
+ new CaptureRequest.Key<>("org.codeaurora.qcamera3.jpeg_encode_crop.rect",
+ int[].class);
public static CameraCharacteristics.Key<Byte> MetaDataMonoOnlyKey =
new CameraCharacteristics.Key<>("org.codeaurora.qcamera3.sensor_meta_data.is_mono_only",
Byte.class);
diff --git a/src/org/codeaurora/snapcam/filter/ClearSightImageProcessor.java b/src/org/codeaurora/snapcam/filter/ClearSightImageProcessor.java
index bafbbb8..c64a0de 100644
--- a/src/org/codeaurora/snapcam/filter/ClearSightImageProcessor.java
+++ b/src/org/codeaurora/snapcam/filter/ClearSightImageProcessor.java
@@ -64,6 +64,7 @@ import android.os.SystemProperties;
import android.util.Log;
import android.view.Surface;
+import com.android.camera.CaptureModule;
import com.android.camera.MediaSaveService;
import com.android.camera.MediaSaveService.OnMediaSavedListener;
import com.android.camera.PhotoModule.NamedImages;
@@ -712,6 +713,15 @@ public class ClearSightImageProcessor {
reprocRequest.set(CaptureRequest.NOISE_REDUCTION_MODE,
CaptureRequest.NOISE_REDUCTION_MODE_OFF);
+ Rect cropRect = image.mImage.getCropRect();
+ if(cropRect != null &&
+ !cropRect.isEmpty()) {
+ // has crop rect. apply to jpeg request
+ reprocRequest.set(CaptureModule.JpegCropEnableKey, (byte)1);
+ reprocRequest.set(CaptureModule.JpegCropRectKey,
+ new int[] {cropRect.left, cropRect.top, cropRect.width(), cropRect.height()});
+ }
+
mImageWriter[camType].queueInputImage(image.mImage);
session.capture(reprocRequest.build(),