<item
android:id="@+id/draw_menu_color"
android:title="@string/draw_color"/>
+ <item
+ android:id="@+id/draw_menu_clear"
+ android:title="@string/draw_clear"/>
</group>
</menu>
\ No newline at end of file
<string name="draw_style_brush_spatter">Marker</string>
<!-- Label for the Spatter brush style of drawing in [CHAR LIMIT=14] -->
<string name="draw_style_brush_marker">Spatter</string>
+ <!-- Label for the removing drawing from screen [CHAR LIMIT=14] -->
+ <string name="draw_clear">Clear</string>
<!-- Label for the select the color [CHAR LIMIT=30] -->
<string name="color_pick_select">Choose custom color</string>
package com.android.gallery3d.filtershow.filters;
import android.graphics.Path;
+import android.util.Log;
+
import com.android.gallery3d.R;
import com.android.gallery3d.filtershow.editors.EditorDraw;
public Path mPath;
public float mRadius;
public int mColor;
-
+ public int noPoints = 0;
@Override
public String toString() {
return "stroke(" + mType + ", path(" + (mPath) + "), " + mRadius + " , "
@Override
public String toString() {
return getName() + " : strokes=" + mDrawing.size()
- + ((mCurrent == null) ? " no current " : ("current=" + mCurrent.mType));
+ + ((mCurrent == null) ? " no current "
+ : ("draw=" + mCurrent.mType + " " + mCurrent.noPoints));
}
public Vector<StrokeData> getDrawing() {
} catch (CloneNotSupportedException e) {
e.printStackTrace();
}
+ } else {
+ Log.v(LOGTAG, "cannot use parameters from " + a);
}
}
return false;
}
if (representation instanceof FilterDrawRepresentation) {
- // FIXME!
- return true;
+ FilterDrawRepresentation fdRep = (FilterDrawRepresentation) representation;
+ if (fdRep.mDrawing.size() != mDrawing.size())
+ return false;
+ if (fdRep.mCurrent == null && mCurrent.mPath == null) {
+ return true;
+ }
+ if (fdRep.mCurrent != null && mCurrent.mPath != null) {
+ if (fdRep.mCurrent.noPoints == mCurrent.noPoints) {
+ return true;
+ }
+ return false;
+ }
}
return false;
}
mCurrent.mType = type;
mCurrent.mPath = new Path();
mCurrent.mPath.moveTo(x, y);
+ mCurrent.noPoints = 0;
}
public void addPoint(float x, float y) {
+ mCurrent.noPoints++;
mCurrent.mPath.lineTo(x, y);
}
public void endSection(float x, float y) {
mCurrent.mPath.lineTo(x, y);
+ mCurrent.noPoints++;
mDrawing.add(mCurrent);
mCurrent = null;
}
private FilterRepresentation mBorder = null;
private float mScaleFactor = 1.0f;
- private boolean mIsHighQuality = false;
+ public static final int QUALITY_ICON = 0;
+ public static final int QUALITY_PREVIEW = 1;
+ public static final int QUALITY_FINAL = 2;
+ private int mQuality = QUALITY_PREVIEW;
private ImageLoader mImageLoader = null;
private Vector<FilterRepresentation> mFilters = new Vector<FilterRepresentation>();
public Bitmap applyGeometry(Bitmap bitmap) {
// Apply any transform -- 90 rotate, flip, straighten, crop
// Returns a new bitmap.
- return mGeoData.apply(bitmap, mScaleFactor, mIsHighQuality);
+ return mGeoData.apply(bitmap, mScaleFactor, mQuality);
}
public Bitmap applyBorder(Bitmap bitmap) {
if (mBorder != null && mDoApplyGeometry) {
ImageFilter filter = FiltersManager.getManager().getFilterForRepresentation(mBorder);
filter.useRepresentation(mBorder);
- bitmap = filter.apply(bitmap, mScaleFactor, mIsHighQuality);
+ bitmap = filter.apply(bitmap, mScaleFactor, mQuality);
}
return bitmap;
}
}
ImageFilter filter = FiltersManager.getManager().getFilterForRepresentation(representation);
filter.useRepresentation(representation);
- bitmap = filter.apply(bitmap, mScaleFactor, mIsHighQuality);
+ bitmap = filter.apply(bitmap, mScaleFactor, mQuality);
}
}
return mScaleFactor;
}
- public boolean isHighQuality() {
- return mIsHighQuality;
+ public int getQuality() {
+ return mQuality;
}
- public void setIsHighQuality(boolean value) {
- mIsHighQuality = value;
+ public void setQuality(int value) {
+ mQuality = value;
}
public void setScaleFactor(float value) {