Loading src/com/android/gallery3d/filtershow/filters/FilterCurvesRepresentation.java +23 −0 Original line number Diff line number Diff line Loading @@ -58,6 +58,7 @@ public class FilterCurvesRepresentation extends FilterRepresentation { mSplines = spline; } @Override public boolean isNil() { for (int i = 0; i < MAX_SPLINE_NUMBER; i++) { if (getSpline(i) != null && !getSpline(i).isOriginal()) { Loading @@ -67,6 +68,27 @@ public class FilterCurvesRepresentation extends FilterRepresentation { return true; } @Override public boolean equals(FilterRepresentation representation) { if (!super.equals(representation)) { return false; } if (!(representation instanceof FilterCurvesRepresentation)) { return false; } else { FilterCurvesRepresentation curve = (FilterCurvesRepresentation) representation; for (int i = 0; i < MAX_SPLINE_NUMBER; i++) { if (!getSpline(i).sameValues(curve.getSpline(i))) { return false; } } } // Every spline matches, therefore they are the same. return true; } public void reset() { Spline spline = new Spline(); Loading @@ -81,6 +103,7 @@ public class FilterCurvesRepresentation extends FilterRepresentation { public void setSpline(int splineIndex, Spline s) { mSplines[splineIndex] = s; } public Spline getSpline(int splineIndex) { return mSplines[splineIndex]; } Loading src/com/android/gallery3d/filtershow/imageshow/MasterImage.java +2 −2 Original line number Diff line number Diff line Loading @@ -198,7 +198,7 @@ public class MasterImage implements RenderingRequestCaller { return false; } int sw = SMALL_BITMAP_DIM; int sh = (int) (sw * (float) mOriginalBitmapLarge.getHeight() / (float) mOriginalBitmapLarge int sh = (int) (sw * (float) mOriginalBitmapLarge.getHeight() / mOriginalBitmapLarge .getWidth()); mOriginalBitmapSmall = Bitmap.createScaledBitmap(mOriginalBitmapLarge, sw, sh, true); mZoomOrientation = mOrientation; Loading Loading @@ -325,7 +325,7 @@ public class MasterImage implements RenderingRequestCaller { if (loadedPreset == null) { return mPreset.hasModifications(); } else { return !mPreset.equals(getLoadedPreset()); return !mPreset.equals(loadedPreset); } } } Loading src/com/android/gallery3d/filtershow/ui/ControlPoint.java +17 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,23 @@ public class ControlPoint implements Comparable { y = point.y; } public boolean sameValues(ControlPoint other) { if (this == other) { return true; } if (other == null) { return false; } if (Float.floatToIntBits(x) != Float.floatToIntBits(other.x)) { return false; } if (Float.floatToIntBits(y) != Float.floatToIntBits(other.y)) { return false; } return true; } public ControlPoint copy() { return new ControlPoint(x, y); } Loading src/com/android/gallery3d/filtershow/ui/Spline.java +22 −0 Original line number Diff line number Diff line Loading @@ -83,6 +83,28 @@ public class Spline { return Color.WHITE; } public boolean sameValues(Spline other) { if (this == other) { return true; } if (other == null) { return false; } if (getNbPoints() != other.getNbPoints()) { return false; } for (int i = 0; i < getNbPoints(); i++) { ControlPoint p = mPoints.elementAt(i); ControlPoint otherPoint = other.mPoints.elementAt(i); if (!p.sameValues(otherPoint)) { return false; } } return true; } private void didMovePoint(ControlPoint point) { mCurrentControlPoint = point; } Loading Loading
src/com/android/gallery3d/filtershow/filters/FilterCurvesRepresentation.java +23 −0 Original line number Diff line number Diff line Loading @@ -58,6 +58,7 @@ public class FilterCurvesRepresentation extends FilterRepresentation { mSplines = spline; } @Override public boolean isNil() { for (int i = 0; i < MAX_SPLINE_NUMBER; i++) { if (getSpline(i) != null && !getSpline(i).isOriginal()) { Loading @@ -67,6 +68,27 @@ public class FilterCurvesRepresentation extends FilterRepresentation { return true; } @Override public boolean equals(FilterRepresentation representation) { if (!super.equals(representation)) { return false; } if (!(representation instanceof FilterCurvesRepresentation)) { return false; } else { FilterCurvesRepresentation curve = (FilterCurvesRepresentation) representation; for (int i = 0; i < MAX_SPLINE_NUMBER; i++) { if (!getSpline(i).sameValues(curve.getSpline(i))) { return false; } } } // Every spline matches, therefore they are the same. return true; } public void reset() { Spline spline = new Spline(); Loading @@ -81,6 +103,7 @@ public class FilterCurvesRepresentation extends FilterRepresentation { public void setSpline(int splineIndex, Spline s) { mSplines[splineIndex] = s; } public Spline getSpline(int splineIndex) { return mSplines[splineIndex]; } Loading
src/com/android/gallery3d/filtershow/imageshow/MasterImage.java +2 −2 Original line number Diff line number Diff line Loading @@ -198,7 +198,7 @@ public class MasterImage implements RenderingRequestCaller { return false; } int sw = SMALL_BITMAP_DIM; int sh = (int) (sw * (float) mOriginalBitmapLarge.getHeight() / (float) mOriginalBitmapLarge int sh = (int) (sw * (float) mOriginalBitmapLarge.getHeight() / mOriginalBitmapLarge .getWidth()); mOriginalBitmapSmall = Bitmap.createScaledBitmap(mOriginalBitmapLarge, sw, sh, true); mZoomOrientation = mOrientation; Loading Loading @@ -325,7 +325,7 @@ public class MasterImage implements RenderingRequestCaller { if (loadedPreset == null) { return mPreset.hasModifications(); } else { return !mPreset.equals(getLoadedPreset()); return !mPreset.equals(loadedPreset); } } } Loading
src/com/android/gallery3d/filtershow/ui/ControlPoint.java +17 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,23 @@ public class ControlPoint implements Comparable { y = point.y; } public boolean sameValues(ControlPoint other) { if (this == other) { return true; } if (other == null) { return false; } if (Float.floatToIntBits(x) != Float.floatToIntBits(other.x)) { return false; } if (Float.floatToIntBits(y) != Float.floatToIntBits(other.y)) { return false; } return true; } public ControlPoint copy() { return new ControlPoint(x, y); } Loading
src/com/android/gallery3d/filtershow/ui/Spline.java +22 −0 Original line number Diff line number Diff line Loading @@ -83,6 +83,28 @@ public class Spline { return Color.WHITE; } public boolean sameValues(Spline other) { if (this == other) { return true; } if (other == null) { return false; } if (getNbPoints() != other.getNbPoints()) { return false; } for (int i = 0; i < getNbPoints(); i++) { ControlPoint p = mPoints.elementAt(i); ControlPoint otherPoint = other.mPoints.elementAt(i); if (!p.sameValues(otherPoint)) { return false; } } return true; } private void didMovePoint(ControlPoint point) { mCurrentControlPoint = point; } Loading