summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohn Hoford <hoford@google.com>2012-10-10 14:17:30 -0700
committerJohn Hoford <hoford@google.com>2012-10-10 15:09:37 -0700
commitf19e1870a01aab99529fc28a586f5190556d302c (patch)
tree27a02f29d315bc78a84cd9cc82fd673a364a9dcb /src
parentaef384c77c316afd4e99946a3cf38c25e200544b (diff)
downloadandroid_packages_apps_Snap-f19e1870a01aab99529fc28a586f5190556d302c.tar.gz
android_packages_apps_Snap-f19e1870a01aab99529fc28a586f5190556d302c.tar.bz2
android_packages_apps_Snap-f19e1870a01aab99529fc28a586f5190556d302c.zip
add White balance & disable UI elements
bug:7234321 Change-Id: Ic44bfe30b5d25e7d4442c4e6d4fd9e0e8410c7af
Diffstat (limited to 'src')
-rw-r--r--src/com/android/gallery3d/filtershow/FilterShowActivity.java12
-rw-r--r--src/com/android/gallery3d/filtershow/PanelController.java13
-rw-r--r--src/com/android/gallery3d/filtershow/filters/ImageFilterWBalance.java24
3 files changed, 38 insertions, 11 deletions
diff --git a/src/com/android/gallery3d/filtershow/FilterShowActivity.java b/src/com/android/gallery3d/filtershow/FilterShowActivity.java
index 505f4608e..aca7f4280 100644
--- a/src/com/android/gallery3d/filtershow/FilterShowActivity.java
+++ b/src/com/android/gallery3d/filtershow/FilterShowActivity.java
@@ -206,10 +206,10 @@ public class FilterShowActivity extends Activity implements OnItemClickListener,
mPanelController.addComponent(mColorsButton, findViewById(R.id.vibranceButton));
mPanelController.addComponent(mColorsButton, findViewById(R.id.contrastButton));
mPanelController.addComponent(mColorsButton, findViewById(R.id.saturationButton));
- mPanelController.addComponent(mColorsButton, findViewById(R.id.tintButton));
+ mPanelController.addComponent(mColorsButton, findViewById(R.id.wbalanceButton));
+ mPanelController.addComponent(mColorsButton, findViewById(R.id.hueButton));
mPanelController.addComponent(mColorsButton, findViewById(R.id.exposureButton));
mPanelController.addComponent(mColorsButton, findViewById(R.id.shadowRecoveryButton));
- mPanelController.addComponent(mColorsButton, findViewById(R.id.redEyeButton));
mPanelController.addView(findViewById(R.id.resetEffect));
mPanelController.addView(findViewById(R.id.applyEffect));
@@ -431,14 +431,6 @@ public class FilterShowActivity extends Activity implements OnItemClickListener,
preset[p++] = new ImagePresetFX(b, getString(fxNameid[i]));
}
- preset[p++] = new ImagePresetSaturated();
- preset[p++] = new ImagePresetOld();
- preset[p++] = new ImagePresetXProcessing();
- preset[p++] = new ImagePresetBW();
- preset[p++] = new ImagePresetBWRed();
- preset[p++] = new ImagePresetBWGreen();
- preset[p++] = new ImagePresetBWBlue();
-
ImageSmallFilter previousFilter = null;
for (int i = 0; i < p; i++) {
ImageSmallFilter filter = new ImageSmallFilter(this);
diff --git a/src/com/android/gallery3d/filtershow/PanelController.java b/src/com/android/gallery3d/filtershow/PanelController.java
index 0c50046df..8da762559 100644
--- a/src/com/android/gallery3d/filtershow/PanelController.java
+++ b/src/com/android/gallery3d/filtershow/PanelController.java
@@ -19,6 +19,7 @@ import com.android.gallery3d.filtershow.filters.ImageFilterShadows;
import com.android.gallery3d.filtershow.filters.ImageFilterSharpen;
import com.android.gallery3d.filtershow.filters.ImageFilterVibrance;
import com.android.gallery3d.filtershow.filters.ImageFilterVignette;
+import com.android.gallery3d.filtershow.filters.ImageFilterWBalance;
import com.android.gallery3d.filtershow.imageshow.ImageShow;
import com.android.gallery3d.filtershow.presets.ImagePreset;
import com.android.gallery3d.filtershow.ui.ImageCurves;
@@ -372,6 +373,9 @@ public class PanelController implements OnClickListener {
if (filter == null && name.equalsIgnoreCase("Redeye")) {
filter = setImagePreset(new ImageFilterRedEye(), name);
}
+ if (filter == null && name.equalsIgnoreCase("WBalance")) {
+ filter = setImagePreset(new ImageFilterWBalance(), name);
+ }
mMasterImage.setCurrentFilter(filter);
}
@@ -456,7 +460,14 @@ public class PanelController implements OnClickListener {
ensureFilter("Saturated");
break;
}
- case R.id.tintButton: {
+ case R.id.wbalanceButton: {
+ mCurrentImage = showImageView(R.id.imageShow).setShowControls(false);
+ mUtilityPanel.setEffectName("White Balance");
+ mUtilityPanel.setGeometryEffect(true);
+ ensureFilter("WBalance");
+ break;
+ }
+ case R.id.hueButton: {
mCurrentImage = showImageView(R.id.imageShow).setShowControls(true);
mUtilityPanel.setEffectName("Hue");
mUtilityPanel.setGeometryEffect(false);
diff --git a/src/com/android/gallery3d/filtershow/filters/ImageFilterWBalance.java b/src/com/android/gallery3d/filtershow/filters/ImageFilterWBalance.java
new file mode 100644
index 000000000..163ed0c65
--- /dev/null
+++ b/src/com/android/gallery3d/filtershow/filters/ImageFilterWBalance.java
@@ -0,0 +1,24 @@
+
+package com.android.gallery3d.filtershow.filters;
+
+import android.graphics.Bitmap;
+import android.util.Log;
+
+public class ImageFilterWBalance extends ImageFilter {
+ private static final String TAG = "ImageFilterWBalance";
+
+ public ImageFilterWBalance() {
+ mName = "WBalance";
+ }
+
+ native protected void nativeApplyFilter(Bitmap bitmap, int w, int h, int locX, int locY);
+
+ @Override
+ public Bitmap apply(Bitmap bitmap, float scaleFactor, boolean highQuality) {
+ int w = bitmap.getWidth();
+ int h = bitmap.getHeight();
+ Log.v(TAG,"White Balance Call");
+ nativeApplyFilter(bitmap, w, h, -1,-1);
+ return bitmap;
+ }
+}