public class CanvasHelper
extends java.lang.Object
Constructor and Description |
---|
CanvasHelper() |
Modifier and Type | Method and Description |
---|---|
static float |
angleTo(android.graphics.PointF start,
android.graphics.PointF end) |
static void |
buildArrow(android.graphics.Path path,
android.graphics.PointF source,
float deg,
float len,
float tipLen,
float tipDeg) |
static void |
buildArrow(android.graphics.Path path,
android.graphics.PointF tail,
android.graphics.PointF head,
float tipLen,
float tipDeg)
Setup an arrow on a path
|
static void |
clampToLine(android.graphics.PointF p,
android.graphics.PointF... l) |
static double |
deg360(double deg) |
static float |
degCos(double deg) |
static android.graphics.PointF |
degOffset(double deg,
float len) |
static android.graphics.PointF |
degOffset(double deg,
float xLen,
float yLen) |
static android.graphics.PointF |
degOffset(android.graphics.PointF start,
double deg,
float len) |
static android.graphics.PointF |
degOffset(android.graphics.PointF start,
double deg,
float xLen,
float yLen) |
static float |
degSin(double deg) |
static void |
drawPathBorder(android.graphics.Canvas can,
android.graphics.Path path,
float weight,
android.graphics.Paint paint) |
static void |
drawPathBorder(android.graphics.Canvas can,
android.graphics.Path path,
float weight,
android.graphics.Paint paint,
int borderColor) |
static void |
drawRectBorder(android.graphics.Canvas can,
android.graphics.Paint paint,
float weight,
android.graphics.RectF rect) |
static void |
drawRectBorder(android.graphics.Canvas can,
android.graphics.Paint paint,
float weight,
android.graphics.RectF rect,
int borderColor) |
static void |
drawTextBorder(android.graphics.Canvas can,
java.lang.String text,
float x,
float y,
float weight,
android.graphics.Paint textPaint) |
static void |
drawTextBorder(android.graphics.Canvas can,
java.lang.String text,
float x,
float y,
float weight,
android.graphics.Paint textPaint,
int borderColor) |
static java.util.List<android.graphics.PointF> |
findIntersectionPoints(android.graphics.RectF r,
android.graphics.PointF sp,
android.graphics.PointF ep)
Provides the top and the bottom most intersection points on a line
clipped with a rectangle
|
static boolean |
intersecting(CapturePP cap,
android.graphics.PointF[] line)
Return true if the capture canvas and the line intersect.
|
static float |
length(android.graphics.PointF... points) |
static void |
lineToOffset(android.graphics.Path path,
android.graphics.PointF origin,
float deg,
float len) |
static void |
lineToPoint(android.graphics.Path path,
android.graphics.PointF p1,
android.graphics.PointF p2) |
static void |
rLineToAng(android.graphics.Path path,
float x,
float y,
float deg,
float len) |
static float |
validate(float num,
float fallback) |
public static void drawRectBorder(android.graphics.Canvas can, android.graphics.Paint paint, float weight, android.graphics.RectF rect, int borderColor)
public static void drawRectBorder(android.graphics.Canvas can, android.graphics.Paint paint, float weight, android.graphics.RectF rect)
public static void drawPathBorder(android.graphics.Canvas can, android.graphics.Path path, float weight, android.graphics.Paint paint, int borderColor)
public static void drawPathBorder(android.graphics.Canvas can, android.graphics.Path path, float weight, android.graphics.Paint paint)
public static void drawTextBorder(android.graphics.Canvas can, java.lang.String text, float x, float y, float weight, android.graphics.Paint textPaint, int borderColor)
public static void drawTextBorder(android.graphics.Canvas can, java.lang.String text, float x, float y, float weight, android.graphics.Paint textPaint)
public static void buildArrow(android.graphics.Path path, android.graphics.PointF tail, android.graphics.PointF head, float tipLen, float tipDeg)
path
- Path to usetail
- Arrow tail positionhead
- Arrow head positiontipLen
- Tip/head lengthpublic static void buildArrow(android.graphics.Path path, android.graphics.PointF source, float deg, float len, float tipLen, float tipDeg)
public static void rLineToAng(android.graphics.Path path, float x, float y, float deg, float len)
public static void lineToOffset(android.graphics.Path path, android.graphics.PointF origin, float deg, float len)
public static void lineToPoint(android.graphics.Path path, android.graphics.PointF p1, android.graphics.PointF p2)
public static float degCos(double deg)
public static float degSin(double deg)
public static android.graphics.PointF degOffset(double deg, float xLen, float yLen)
public static android.graphics.PointF degOffset(double deg, float len)
public static android.graphics.PointF degOffset(android.graphics.PointF start, double deg, float xLen, float yLen)
public static android.graphics.PointF degOffset(android.graphics.PointF start, double deg, float len)
public static float angleTo(android.graphics.PointF start, android.graphics.PointF end)
public static float length(android.graphics.PointF... points)
public static boolean intersecting(CapturePP cap, android.graphics.PointF[] line)
cap
- the capture canvasline
- the linepublic static void clampToLine(android.graphics.PointF p, android.graphics.PointF... l)
public static float validate(float num, float fallback)
public static double deg360(double deg)
public static java.util.List<android.graphics.PointF> findIntersectionPoints(android.graphics.RectF r, android.graphics.PointF sp, android.graphics.PointF ep)
r
- The rectangle to clip the line tosp
- The start point on the line segmentep
- The end point on the line segment