Loading src/com/android/gallery3d/filtershow/ui/ImageCurves.java +5 −5 Original line number Original line Diff line number Diff line Loading @@ -221,7 +221,6 @@ public class ImageCurves extends ImageSlave { } } if (spline.isPointContained(posX, pick)) { if (spline.isPointContained(posX, pick)) { spline.didMovePoint(mCurrentControlPoint); spline.movePoint(pick, posX, posY); spline.movePoint(pick, posX, posY); } else if (pick != -1 && spline.getNbPoints() > 2) { } else if (pick != -1 && spline.getNbPoints() > 2) { spline.deletePoint(pick); spline.deletePoint(pick); Loading Loading @@ -279,8 +278,9 @@ public class ImageCurves extends ImageSlave { max = histogram[i]; max = histogram[i]; } } } } float w = getWidth(); float w = getWidth() - Spline.curveHandleSize(); float h = getHeight(); float h = getHeight() - Spline.curveHandleSize() / 2.0f; float dx = Spline.curveHandleSize() / 2.0f; float wl = w / histogram.length; float wl = w / histogram.length; float wh = (0.3f * h) / max; float wh = (0.3f * h) / max; Paint paint = new Paint(); Paint paint = new Paint(); Loading @@ -292,12 +292,12 @@ public class ImageCurves extends ImageSlave { paint2.setStrokeWidth(6); paint2.setStrokeWidth(6); paint2.setXfermode(new PorterDuffXfermode(mode)); paint2.setXfermode(new PorterDuffXfermode(mode)); gHistoPath.reset(); gHistoPath.reset(); gHistoPath.moveTo(0, h); gHistoPath.moveTo(dx, h); boolean firstPointEncountered = false; boolean firstPointEncountered = false; float prev = 0; float prev = 0; float last = 0; float last = 0; for (int i = 0; i < histogram.length; i++) { for (int i = 0; i < histogram.length; i++) { float x = i * wl; float x = i * wl + dx; float l = histogram[i] * wh; float l = histogram[i] * wh; if (l != 0) { if (l != 0) { float v = h - (l + prev) / 2.0f; float v = h - (l + prev) / 2.0f; Loading src/com/android/gallery3d/filtershow/ui/Spline.java +7 −2 Original line number Original line Diff line number Diff line Loading @@ -49,7 +49,11 @@ public class Spline { mPoints = new Vector<ControlPoint>(); mPoints = new Vector<ControlPoint>(); for (int i = 0; i < spline.mPoints.size(); i++) { for (int i = 0; i < spline.mPoints.size(); i++) { ControlPoint p = spline.mPoints.elementAt(i); ControlPoint p = spline.mPoints.elementAt(i); mPoints.add(new ControlPoint(p)); ControlPoint newPoint = new ControlPoint(p); mPoints.add(newPoint); if (spline.mCurrentControlPoint == p) { mCurrentControlPoint = newPoint; } } } Collections.sort(mPoints); Collections.sort(mPoints); } } Loading Loading @@ -79,7 +83,7 @@ public class Spline { return Color.WHITE; return Color.WHITE; } } public void didMovePoint(ControlPoint point) { private void didMovePoint(ControlPoint point) { mCurrentControlPoint = point; mCurrentControlPoint = point; } } Loading @@ -90,6 +94,7 @@ public class Spline { ControlPoint point = mPoints.elementAt(pick); ControlPoint point = mPoints.elementAt(pick); point.x = x; point.x = x; point.y = y; point.y = y; didMovePoint(point); } } public boolean isOriginal() { public boolean isOriginal() { Loading Loading
src/com/android/gallery3d/filtershow/ui/ImageCurves.java +5 −5 Original line number Original line Diff line number Diff line Loading @@ -221,7 +221,6 @@ public class ImageCurves extends ImageSlave { } } if (spline.isPointContained(posX, pick)) { if (spline.isPointContained(posX, pick)) { spline.didMovePoint(mCurrentControlPoint); spline.movePoint(pick, posX, posY); spline.movePoint(pick, posX, posY); } else if (pick != -1 && spline.getNbPoints() > 2) { } else if (pick != -1 && spline.getNbPoints() > 2) { spline.deletePoint(pick); spline.deletePoint(pick); Loading Loading @@ -279,8 +278,9 @@ public class ImageCurves extends ImageSlave { max = histogram[i]; max = histogram[i]; } } } } float w = getWidth(); float w = getWidth() - Spline.curveHandleSize(); float h = getHeight(); float h = getHeight() - Spline.curveHandleSize() / 2.0f; float dx = Spline.curveHandleSize() / 2.0f; float wl = w / histogram.length; float wl = w / histogram.length; float wh = (0.3f * h) / max; float wh = (0.3f * h) / max; Paint paint = new Paint(); Paint paint = new Paint(); Loading @@ -292,12 +292,12 @@ public class ImageCurves extends ImageSlave { paint2.setStrokeWidth(6); paint2.setStrokeWidth(6); paint2.setXfermode(new PorterDuffXfermode(mode)); paint2.setXfermode(new PorterDuffXfermode(mode)); gHistoPath.reset(); gHistoPath.reset(); gHistoPath.moveTo(0, h); gHistoPath.moveTo(dx, h); boolean firstPointEncountered = false; boolean firstPointEncountered = false; float prev = 0; float prev = 0; float last = 0; float last = 0; for (int i = 0; i < histogram.length; i++) { for (int i = 0; i < histogram.length; i++) { float x = i * wl; float x = i * wl + dx; float l = histogram[i] * wh; float l = histogram[i] * wh; if (l != 0) { if (l != 0) { float v = h - (l + prev) / 2.0f; float v = h - (l + prev) / 2.0f; Loading
src/com/android/gallery3d/filtershow/ui/Spline.java +7 −2 Original line number Original line Diff line number Diff line Loading @@ -49,7 +49,11 @@ public class Spline { mPoints = new Vector<ControlPoint>(); mPoints = new Vector<ControlPoint>(); for (int i = 0; i < spline.mPoints.size(); i++) { for (int i = 0; i < spline.mPoints.size(); i++) { ControlPoint p = spline.mPoints.elementAt(i); ControlPoint p = spline.mPoints.elementAt(i); mPoints.add(new ControlPoint(p)); ControlPoint newPoint = new ControlPoint(p); mPoints.add(newPoint); if (spline.mCurrentControlPoint == p) { mCurrentControlPoint = newPoint; } } } Collections.sort(mPoints); Collections.sort(mPoints); } } Loading Loading @@ -79,7 +83,7 @@ public class Spline { return Color.WHITE; return Color.WHITE; } } public void didMovePoint(ControlPoint point) { private void didMovePoint(ControlPoint point) { mCurrentControlPoint = point; mCurrentControlPoint = point; } } Loading @@ -90,6 +94,7 @@ public class Spline { ControlPoint point = mPoints.elementAt(pick); ControlPoint point = mPoints.elementAt(pick); point.x = x; point.x = x; point.y = y; point.y = y; didMovePoint(point); } } public boolean isOriginal() { public boolean isOriginal() { Loading