summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Wichner <cwichner@google.com>2013-05-27 10:24:54 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-05-27 10:24:55 +0000
commitd3a3f93f30714117254bf8f4fdf4f797ddde7bcd (patch)
treed50888c5a3bf8088801784677440e52babd19bc1
parent5e6613eed7cff25d4685ddd48be735682d27a7b5 (diff)
parentbd769d3ea522f0d6f62f6746c007f624eb7840ce (diff)
downloadandroid_packages_apps_Snap-d3a3f93f30714117254bf8f4fdf4f797ddde7bcd.tar.gz
android_packages_apps_Snap-d3a3f93f30714117254bf8f4fdf4f797ddde7bcd.tar.bz2
android_packages_apps_Snap-d3a3f93f30714117254bf8f4fdf4f797ddde7bcd.zip
Merge "functionality added to transport filter parameter values to following filters. e.g. FixedFrames use the style from Retrolux or Film to tinting the frame." into gb-ub-photos-carlsbad
-rw-r--r--src/com/android/gallery3d/filtershow/presets/FilterEnvironment.java24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/com/android/gallery3d/filtershow/presets/FilterEnvironment.java b/src/com/android/gallery3d/filtershow/presets/FilterEnvironment.java
index 47f8dfccb..8d59c9f54 100644
--- a/src/com/android/gallery3d/filtershow/presets/FilterEnvironment.java
+++ b/src/com/android/gallery3d/filtershow/presets/FilterEnvironment.java
@@ -50,6 +50,9 @@ public class FilterEnvironment {
private HashMap<Long, WeakReference<Bitmap>>
bitmapCach = new HashMap<Long, WeakReference<Bitmap>>();
+ private HashMap<Integer, Integer>
+ generalParameters = new HashMap<Integer, Integer>();
+
public void cache(Bitmap bitmap) {
if (bitmap == null) {
return;
@@ -116,6 +119,7 @@ public class FilterEnvironment {
if (filter.supportsAllocationInput()) {
filter.apply(in, out);
}
+ filter.setGeneralParameters();
filter.setEnvironment(null);
}
@@ -124,6 +128,7 @@ public class FilterEnvironment {
filter.useRepresentation(representation);
filter.setEnvironment(this);
Bitmap ret = filter.apply(bitmap, mScaleFactor, mQuality);
+ filter.setGeneralParameters();
filter.setEnvironment(null);
return ret;
}
@@ -136,4 +141,23 @@ public class FilterEnvironment {
mPipeline = cachingPipeline;
}
+ public synchronized void clearGeneralParameters() {
+ generalParameters = null;
+ }
+
+ public synchronized Integer getGeneralParameter(int id) {
+ if (generalParameters == null || !generalParameters.containsKey(id)) {
+ return null;
+ }
+ return generalParameters.get(id);
+ }
+
+ public synchronized void setGeneralParameter(int id, int value) {
+ if (generalParameters == null) {
+ generalParameters = new HashMap<Integer, Integer>();
+ }
+
+ generalParameters.put(id, value);
+ }
+
}