diff options
author | John Hoford <hoford@google.com> | 2012-10-10 15:46:56 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2012-10-10 15:46:56 -0700 |
commit | dc3e519b570c752d76dc136d7d2e87877372de6b (patch) | |
tree | 7e4a2071354c8472a705e63f7196c2b6c6f1f516 | |
parent | 4a44ff7cf3965bbf61875e4b894d782f1279d7d3 (diff) | |
parent | 35b33ce66ae3fe0abe628da20b1b03242c98e914 (diff) | |
download | android_packages_apps_Snap-dc3e519b570c752d76dc136d7d2e87877372de6b.tar.gz android_packages_apps_Snap-dc3e519b570c752d76dc136d7d2e87877372de6b.tar.bz2 android_packages_apps_Snap-dc3e519b570c752d76dc136d7d2e87877372de6b.zip |
am f8044659: Merge "add White balance & disable UI elements" into gb-ub-photos-arches
* commit 'f8044659db592f49e6e77c8a1d595955f9d206cb':
add White balance & disable UI elements
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; + } +} |