// Path: src/main/java/com/orange/dgil/trail/android/drawingtool/DrawingToolsContext.java
// @RequiredArgsConstructor
// @Getter
// public class DrawingToolsContext {
//   private final View view;
//   private final AnimManager animManager;
//   private final AndroidMetrics androidMetrics;
//   private final TrailOptions trailOptions;
// }
// 
// Path: src/main/java/com/orange/dgil/trail/android/drawingtool/IDrawingTool.java
// public interface IDrawingTool {
//   void reset();
// 
//   void touchDown(int x, int y);
//   void touchMove(int x, int y);
//   void touchUp();
// 
//   void draw(Canvas c);
// 
//   void invalidateAreaOnMove();
//   void invalidatePath();
// 
//   void forceRedrawForAnimation(boolean eraseBitmap);
// 
//   void trimMemory();
// }
// 
// Path: src/main/java/com/orange/dgil/trail/android/drawingtool/InvalidateArea.java
// @Getter
// @Setter
// public class InvalidateArea {
//   private final Rect rect = new Rect();
//   private int radius;
// 
//   public void setOrigin(int x, int y) {
//     rect.set(x - radius, y - radius, x + radius, y + radius);
//   }
//   public void setOrigin(Point p) {
//     setOrigin(p.x, p.y);
//   }
// 
//   public void add(int x, int y) {
//     rect.union(x - radius, y - radius, x + radius, y + radius);
//   }
//   public void add(Point p) {
//     add(p.x, p.y);
//   }
// 
//   public void setEmpty() {
//     rect.setEmpty();
//   }
// }


import android.graphics.Canvas;
import android.graphics.Path;
import android.graphics.Point;
import android.graphics.RectF;
import android.view.View;
import com.orange.dgil.trail.android.drawingtool.DrawingToolsContext;
import com.orange.dgil.trail.android.drawingtool.IDrawingTool;
import com.orange.dgil.trail.android.drawingtool.InvalidateArea;
/**
 * Trail drawing library
 * Copyright (C) 2014 Orange
 * Authors: christophe.maldivi@orange.com, eric.petit@orange.com
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */
package com.orange.dgil.trail.android.drawingtool.markerpen;



public class MarkerPaths implements IDrawingTool {

  private final Path path = new Path();
  private final RectF rectF = new RectF();
  private final InvalidateArea invalidateArea = new InvalidateArea();

  private final View view;
  private final Painters painters;

  private final Point position = new Point();
  private final Point middlePos = new Point();
  private final Point prevPos = new Point();
  private final Point prevMiddlePos = new Point();


// Path: src/main/java/com/orange/dgil/trail/android/drawingtool/DrawingToolsContext.java
// @RequiredArgsConstructor
// @Getter
// public class DrawingToolsContext {
//   private final View view;
//   private final AnimManager animManager;
//   private final AndroidMetrics androidMetrics;
//   private final TrailOptions trailOptions;
// }
// 
// Path: src/main/java/com/orange/dgil/trail/android/drawingtool/IDrawingTool.java
// public interface IDrawingTool {
//   void reset();
// 
//   void touchDown(int x, int y);
//   void touchMove(int x, int y);
//   void touchUp();
// 
//   void draw(Canvas c);
// 
//   void invalidateAreaOnMove();
//   void invalidatePath();
// 
//   void forceRedrawForAnimation(boolean eraseBitmap);
// 
//   void trimMemory();
// }
// 
// Path: src/main/java/com/orange/dgil/trail/android/drawingtool/InvalidateArea.java
// @Getter
// @Setter
// public class InvalidateArea {
//   private final Rect rect = new Rect();
//   private int radius;
// 
//   public void setOrigin(int x, int y) {
//     rect.set(x - radius, y - radius, x + radius, y + radius);
//   }
//   public void setOrigin(Point p) {
//     setOrigin(p.x, p.y);
//   }
// 
//   public void add(int x, int y) {
//     rect.union(x - radius, y - radius, x + radius, y + radius);
//   }
//   public void add(Point p) {
//     add(p.x, p.y);
//   }
// 
//   public void setEmpty() {
//     rect.setEmpty();
//   }
// }


// Path: src/main/java/com/orange/dgil/trail/android/drawingtool/markerpen/MarkerPaths.java
import android.graphics.Canvas;
import android.graphics.Path;
import android.graphics.Point;
import android.graphics.RectF;
import android.view.View;
import com.orange.dgil.trail.android.drawingtool.DrawingToolsContext;
import com.orange.dgil.trail.android.drawingtool.IDrawingTool;
import com.orange.dgil.trail.android.drawingtool.InvalidateArea;

/**
 * Trail drawing library
 * Copyright (C) 2014 Orange
 * Authors: christophe.maldivi@orange.com, eric.petit@orange.com
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */
package com.orange.dgil.trail.android.drawingtool.markerpen;



public class MarkerPaths implements IDrawingTool {

  private final Path path = new Path();
  private final RectF rectF = new RectF();
  private final InvalidateArea invalidateArea = new InvalidateArea();

  private final View view;
  private final Painters painters;

  private final Point position = new Point();
  private final Point middlePos = new Point();
  private final Point prevPos = new Point();
  private final Point prevMiddlePos = new Point();


  public MarkerPaths(DrawingToolsContext drawingToolsContext) {