final class Helpers
extends java.lang.Object
Modifier | Constructor and Description |
---|---|
private |
Helpers() |
Modifier and Type | Method and Description |
---|---|
(package private) static int |
cubicRootsInAB(float d,
float a,
float b,
float c,
float[] pts,
int off,
float A,
float B) |
(package private) static float |
evalCubic(float a,
float b,
float c,
float d,
float t) |
(package private) static float |
evalQuad(float a,
float b,
float c,
float t) |
(package private) static int |
filterOutNotInAB(float[] nums,
int off,
int len,
float a,
float b) |
(package private) static void |
isort(float[] a,
int off,
int len) |
(package private) static float |
linelen(float x1,
float y1,
float x2,
float y2) |
(package private) static float |
polyLineLength(float[] poly,
int off,
int nCoords) |
(package private) static int |
quadraticRoots(float a,
float b,
float c,
float[] zeroes,
int off) |
(package private) static void |
subdivide(float[] src,
int srcoff,
float[] left,
int leftoff,
float[] right,
int rightoff,
int type) |
(package private) static void |
subdivideAt(float t,
float[] src,
int srcoff,
float[] left,
int leftoff,
float[] right,
int rightoff,
int size) |
(package private) static void |
subdivideCubic(float[] src,
int srcoff,
float[] left,
int leftoff,
float[] right,
int rightoff)
Subdivides the cubic curve specified by the coordinates
stored in the
src array at indices srcoff
through (srcoff + 7) and stores the
resulting two subdivided curves into the two result arrays at the
corresponding indices. |
(package private) static void |
subdivideCubicAt(float t,
float[] src,
int srcoff,
float[] left,
int leftoff,
float[] right,
int rightoff) |
(package private) static void |
subdivideQuad(float[] src,
int srcoff,
float[] left,
int leftoff,
float[] right,
int rightoff) |
(package private) static void |
subdivideQuadAt(float t,
float[] src,
int srcoff,
float[] left,
int leftoff,
float[] right,
int rightoff) |
(package private) static float[] |
widenArray(float[] in,
int cursize,
int numToAdd) |
(package private) static int[] |
widenArray(int[] in,
int cursize,
int numToAdd) |
(package private) static boolean |
within(double x,
double y,
double err) |
(package private) static boolean |
within(float x,
float y,
float err) |
static boolean within(float x, float y, float err)
static boolean within(double x, double y, double err)
static int quadraticRoots(float a, float b, float c, float[] zeroes, int off)
static int cubicRootsInAB(float d, float a, float b, float c, float[] pts, int off, float A, float B)
static float[] widenArray(float[] in, int cursize, int numToAdd)
static int[] widenArray(int[] in, int cursize, int numToAdd)
static float evalCubic(float a, float b, float c, float d, float t)
static float evalQuad(float a, float b, float c, float t)
static int filterOutNotInAB(float[] nums, int off, int len, float a, float b)
static float polyLineLength(float[] poly, int off, int nCoords)
static float linelen(float x1, float y1, float x2, float y2)
static void subdivide(float[] src, int srcoff, float[] left, int leftoff, float[] right, int rightoff, int type)
static void isort(float[] a, int off, int len)
static void subdivideCubic(float[] src, int srcoff, float[] left, int leftoff, float[] right, int rightoff)
src
array at indices srcoff
through (srcoff
+ 7) and stores the
resulting two subdivided curves into the two result arrays at the
corresponding indices.
Either or both of the left
and right
arrays may be null
or a reference to the same array
as the src
array.
Note that the last point in the first subdivided curve is the
same as the first point in the second subdivided curve. Thus,
it is possible to pass the same array for left
and right
and to use offsets, such as rightoff
equals (leftoff
+ 6), in order
to avoid allocating extra storage for this common point.src
- the array holding the coordinates for the source curvesrcoff
- the offset into the array of the beginning of the
the 6 source coordinatesleft
- the array for storing the coordinates for the first
half of the subdivided curveleftoff
- the offset into the array of the beginning of the
the 6 left coordinatesright
- the array for storing the coordinates for the second
half of the subdivided curverightoff
- the offset into the array of the beginning of the
the 6 right coordinatesstatic void subdivideCubicAt(float t, float[] src, int srcoff, float[] left, int leftoff, float[] right, int rightoff)
static void subdivideQuad(float[] src, int srcoff, float[] left, int leftoff, float[] right, int rightoff)
static void subdivideQuadAt(float t, float[] src, int srcoff, float[] left, int leftoff, float[] right, int rightoff)
static void subdivideAt(float t, float[] src, int srcoff, float[] left, int leftoff, float[] right, int rightoff, int size)