final class RadialGradientContext extends MultipleGradientContext
Modifier and Type | Field and Description |
---|---|
private float |
centerX
Variables representing center and focus points.
|
private float |
centerY
Variables representing center and focus points.
|
private float |
constA
Constant part of X, Y user space coordinates.
|
private float |
constB
Constant part of X, Y user space coordinates.
|
private float |
focusX
Variables representing center and focus points.
|
private float |
focusY
Variables representing center and focus points.
|
private float |
gDeltaDelta
Constant second order delta for simple loop.
|
private boolean |
isNonCyclic
True when (cycleMethod == NO_CYCLE).
|
private boolean |
isSimpleFocus
True when (focus == center).
|
private float |
radius
Radius of the outermost circle defining the 100% gradient stop.
|
private float |
radiusSq
Radius of the gradient circle squared.
|
private static float |
SCALEBACK
Amount for offset when clamping focus.
|
private static int |
SQRT_LUT_SIZE |
private static float[] |
sqrtLut |
private float |
trivial
This value represents the solution when focusX == X.
|
a00, a01, a02, a10, a11, a12, cycleMethod, fastGradientArraySize, gradient, GRADIENT_SIZE, GRADIENT_SIZE_INDEX, isSimpleLookup
Constructor and Description |
---|
RadialGradientContext(RadialGradient paint,
BaseTransform t,
float cx,
float cy,
float r,
float fx,
float fy,
float[] fractions,
Color[] colors,
int cycleMethod)
Constructor for RadialGradientContext.
|
Modifier and Type | Method and Description |
---|---|
private void |
cyclicCircularGradientFillRaster(int[] pixels,
int off,
int adjust,
int x,
int y,
int w,
int h)
Fill the raster, cycling the gradient colors when a point falls outside
of the perimeter of the 100% stop circle.
|
protected void |
fillRaster(int[] pixels,
int off,
int adjust,
int x,
int y,
int w,
int h)
Return a Raster containing the colors generated for the graphics
operation.
|
private void |
simpleNonCyclicFillRaster(int[] pixels,
int off,
int adjust,
int x,
int y,
int w,
int h)
This code works in the simplest of cases, where the focus == center
point, the gradient is noncyclic, and the gradient lookup method is
fast (single array index, no conversion necessary).
|
indexIntoGradientsArrays
private boolean isSimpleFocus
private boolean isNonCyclic
private float radius
private float centerX
private float centerY
private float focusX
private float focusY
private float radiusSq
private float constA
private float constB
private float gDeltaDelta
private float trivial
private static final float SCALEBACK
private static final int SQRT_LUT_SIZE
private static float[] sqrtLut
RadialGradientContext(RadialGradient paint, BaseTransform t, float cx, float cy, float r, float fx, float fy, float[] fractions, Color[] colors, int cycleMethod)
paint
- the RadialGradientPaint
from which this context
is createdt
- the AffineTransform
from user
space into device space (gradientTransform should be
concatenated with this)cx
- the center X coordinate in user space of the circle defining
the gradient. The last color of the gradient is mapped to
the perimeter of this circle.cy
- the center Y coordinate in user space of the circle defining
the gradient. The last color of the gradient is mapped to
the perimeter of this circle.r
- the radius of the circle defining the extents of the
color gradientfx
- the X coordinate in user space to which the first color
is mappedfy
- the Y coordinate in user space to which the first color
is mappedfractions
- the fractions specifying the gradient distributioncolors
- the gradient colorscycleMethod
- either NO_CYCLE, REFLECT, or REPEATprotected void fillRaster(int[] pixels, int off, int adjust, int x, int y, int w, int h)
fillRaster
in class MultipleGradientContext
x,y,w,h
- the area in device space for which colors are
generated.private void simpleNonCyclicFillRaster(int[] pixels, int off, int adjust, int x, int y, int w, int h)
private void cyclicCircularGradientFillRaster(int[] pixels, int off, int adjust, int x, int y, int w, int h)