summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/filtershow/filters/ImageFilter.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/gallery3d/filtershow/filters/ImageFilter.java')
-rw-r--r--src/com/android/gallery3d/filtershow/filters/ImageFilter.java57
1 files changed, 45 insertions, 12 deletions
diff --git a/src/com/android/gallery3d/filtershow/filters/ImageFilter.java b/src/com/android/gallery3d/filtershow/filters/ImageFilter.java
index 7f4d5ed2a..b8f0cf84f 100644
--- a/src/com/android/gallery3d/filtershow/filters/ImageFilter.java
+++ b/src/com/android/gallery3d/filtershow/filters/ImageFilter.java
@@ -18,35 +18,64 @@ package com.android.gallery3d.filtershow.filters;
import android.graphics.Bitmap;
+import com.android.gallery3d.R;
import com.android.gallery3d.filtershow.presets.ImagePreset;
public class ImageFilter implements Cloneable {
- protected int mMaxParameter = 100;
- protected int mMinParameter = -100;
+ public static int DEFAULT_MAX_PARAMETER = 100;
+ public static int DEFAULT_MIN_PARAMETER = -100;
+ public static int DEFAULT_INITIAL_PARAMETER = 0;
+
+ protected int mMaxParameter = DEFAULT_MAX_PARAMETER;
+ protected int mMinParameter = DEFAULT_MIN_PARAMETER;
protected int mPreviewParameter = mMaxParameter;
- protected int mDefaultParameter = 0;
- protected int mParameter = 0;
+ protected int mDefaultParameter = DEFAULT_INITIAL_PARAMETER;
+ protected int mParameter = DEFAULT_INITIAL_PARAMETER;
private ImagePreset mImagePreset;
protected String mName = "Original";
private final String LOGTAG = "ImageFilter";
- public static final byte TYPE_BORDER =1;
- public static final byte TYPE_FX = 2;
+ public static final byte TYPE_BORDER = 1;
+ public static final byte TYPE_FX = 2;
public static final byte TYPE_WBALANCE = 3;
public static final byte TYPE_VIGNETTE = 4;
public static final byte TYPE_NORMAL = 5;
public static final byte TYPE_TINYPLANET = 6;
private byte filterType = TYPE_NORMAL;
- public byte getFilterType(){
+ public byte getFilterType() {
return filterType;
}
- protected void setFilterType(byte type){
+ protected void setFilterType(byte type) {
filterType = type;
}
+ public int getButtonId() {
+ return 0;
+ }
+
+ public int getTextId() {
+ return 0;
+ }
+
+ public int getOverlayBitmaps() {
+ return 0;
+ }
+
+ public int getEditingViewId() {
+ return R.id.imageShow;
+ }
+
+ public boolean showEditingControls() {
+ return true;
+ }
+
+ public boolean showParameterValue() {
+ return true;
+ }
+
@Override
public ImageFilter clone() throws CloneNotSupportedException {
ImageFilter filter = (ImageFilter) super.clone();
@@ -61,6 +90,10 @@ public class ImageFilter implements Cloneable {
return filter;
}
+ public void reset() {
+ setParameter(mDefaultParameter);
+ }
+
public boolean isNil() {
if (mParameter == mDefaultParameter) {
return true;
@@ -93,7 +126,7 @@ public class ImageFilter implements Cloneable {
* The maximum allowed value (inclusive)
* @return maximum value allowed as input to this filter
*/
- public int getMaxParameter(){
+ public int getMaxParameter() {
return mMaxParameter;
}
@@ -101,7 +134,7 @@ public class ImageFilter implements Cloneable {
* The parameter value to be used in previews.
* @return parameter value to be used to preview the filter
*/
- public int getPreviewParameter(){
+ public int getPreviewParameter() {
return mPreviewParameter;
}
@@ -109,7 +142,7 @@ public class ImageFilter implements Cloneable {
* The minimum allowed value (inclusive)
* @return minimum value allowed as input to this filter
*/
- public int getMinParameter(){
+ public int getMinParameter() {
return mMinParameter;
}
@@ -117,7 +150,7 @@ public class ImageFilter implements Cloneable {
* Returns the default value returned by this filter.
* @return default value
*/
- public int getDefaultParameter(){
+ public int getDefaultParameter() {
return mDefaultParameter;
}