diff options
author | Linux Build Service Account <lnxbuild@quicinc.com> | 2017-04-25 18:08:23 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-04-25 18:08:23 -0700 |
commit | d72b5762c1a4be9d8818d88b138182721bad3eca (patch) | |
tree | 03782f3cae12ac14e3e4a7100cff82f827e5333e /src | |
parent | 3e13cf29d7f684e6b116a315a7684c0a747b8bc2 (diff) | |
parent | 5d35734b41ca5a21e74ee8d10a217dc77257c17c (diff) | |
download | android_packages_apps_Snap-d72b5762c1a4be9d8818d88b138182721bad3eca.tar.gz android_packages_apps_Snap-d72b5762c1a4be9d8818d88b138182721bad3eca.tar.bz2 android_packages_apps_Snap-d72b5762c1a4be9d8818d88b138182721bad3eca.zip |
Merge "SnapdragonCamera: add method nativeConfigureStillmore" into camera.lnx.1.0-dev.1.0
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/camera/imageprocessor/filter/StillmoreFilter.java | 12 | ||||
-rw-r--r--[-rwxr-xr-x] | src/com/android/camera/util/PersistUtil.java | 36 |
2 files changed, 44 insertions, 4 deletions
diff --git a/src/com/android/camera/imageprocessor/filter/StillmoreFilter.java b/src/com/android/camera/imageprocessor/filter/StillmoreFilter.java index 2f483bfdc..34784faa0 100644 --- a/src/com/android/camera/imageprocessor/filter/StillmoreFilter.java +++ b/src/com/android/camera/imageprocessor/filter/StillmoreFilter.java @@ -38,13 +38,14 @@ import android.util.Log; import android.util.Range; import com.android.camera.CaptureModule; +import com.android.camera.util.PersistUtil; import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.List; public class StillmoreFilter implements ImageFilter{ - public static final int NUM_REQUIRED_IMAGE = 5; + public static final int NUM_REQUIRED_IMAGE = PersistUtil.getStillmoreNumRequiredImages(); private int mWidth; private int mHeight; private int mStrideY; @@ -99,6 +100,13 @@ public class StillmoreFilter implements ImageFilter{ Log("width: "+mWidth+" height: "+mHeight+" strideY: "+mStrideY+" strideVU: "+mStrideVU); nativeInit(mWidth, mHeight, mStrideY, mStrideVU, 0, 0, mWidth, mHeight, NUM_REQUIRED_IMAGE); + float brColor = PersistUtil.getStillmoreBrColor(); + float brIntensity = PersistUtil.getStillmoreBrIntensity(); + float smoothingintensity = PersistUtil.getStillmoreSmoothingIntensity(); + nativeConfigureStillMore(brColor, brIntensity, smoothingintensity); + Log("ConfigureStillmore brColor: " + brColor + " brIntensity: " + + brIntensity + " smoothingintensity: " + smoothingintensity + + " NUM_REQUIRED_IMAGE: " + NUM_REQUIRED_IMAGE); } @Override @@ -156,6 +164,8 @@ public class StillmoreFilter implements ImageFilter{ return mIsSupported; } + private native int nativeConfigureStillMore(float brColor, float brIntensity, + float smoothingintensity); private native int nativeInit(int width, int height, int yStride, int vuStride, int roiX, int roiY, int roiW, int roiH, int numImages); private native int nativeDeinit(); diff --git a/src/com/android/camera/util/PersistUtil.java b/src/com/android/camera/util/PersistUtil.java index 69860491e..c22df6263 100755..100644 --- a/src/com/android/camera/util/PersistUtil.java +++ b/src/com/android/camera/util/PersistUtil.java @@ -46,8 +46,16 @@ public class PersistUtil { SystemProperties.getBoolean("persist.camera.zsl.disabled", false); private static final int PERSIST_CAMERA_CANCEL_TOUCHFOCUS_DELAY = SystemProperties.getInt("persist.camera.focus_delay", 5000); - private static final int PERSIST_CAMERA2_DEBUG = - SystemProperties.getInt("persist.camera2.debug", 0); + private static final int PERSIST_CAMERA_DEBUG = + SystemProperties.getInt("persist.camera.debug", 0); + private static final String PERSIST_CAMERA_STILLMORE_BRCOLR = + SystemProperties.get("persist.camera.stm_brcolor", "0.5"); + private static final String PERSIST_CAMERA_STILLMORE_BRINTENSITY = + SystemProperties.get("persist.camera.stm_brintensity", "0.6"); + private static final String PERSIST_CAMERA_STILLMORE_SMOOTHINGINTENSITY = + SystemProperties.get("persist.camera.stm_smooth", "0"); + private static final int PERSIST_CAMERA_STILLMORE_NUM_REQUIRED_IMAGE = + SystemProperties.getInt("persist.camera.stm_img_nums", 5); public static final int CAMERA2_DEBUG_DUMP_IMAGE = 1; public static final int CAMERA2_DEBUG_DUMP_LOG = 2; @@ -78,7 +86,29 @@ public class PersistUtil { } public static int getCamera2Debug() { - return PERSIST_CAMERA2_DEBUG; + return PERSIST_CAMERA_DEBUG; + } + + public static float getStillmoreBrColor(){ + float brColor = Float.parseFloat(PERSIST_CAMERA_STILLMORE_BRCOLR); + return brColor = (brColor < 0 || brColor > 1) ? 0.5f : brColor; + } + + public static float getStillmoreBrIntensity(){ + float brIntensity = Float.parseFloat(PERSIST_CAMERA_STILLMORE_BRINTENSITY); + return brIntensity = (brIntensity < 0 || brIntensity > 1) ? 0.6f : brIntensity; + } + + public static float getStillmoreSmoothingIntensity(){ + float smoothingIntensity = Float.parseFloat(PERSIST_CAMERA_STILLMORE_SMOOTHINGINTENSITY); + return smoothingIntensity = (smoothingIntensity < 0 || smoothingIntensity > 1) ? + 0f : smoothingIntensity; + } + + public static int getStillmoreNumRequiredImages() { + return (PERSIST_CAMERA_STILLMORE_NUM_REQUIRED_IMAGE < 3 || + PERSIST_CAMERA_STILLMORE_NUM_REQUIRED_IMAGE > 5) ? + 5 : PERSIST_CAMERA_STILLMORE_NUM_REQUIRED_IMAGE; } public static int getCancelTouchFocusDelay() { |