final class RadialGradientPaintContext extends MultipleGradientPaintContext
Modifier and Type | Field and Description |
---|---|
private static int |
ANTI_ALIAS_IMPL |
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 static int |
DEFAULT_IMPL |
private int |
fillMethod |
private static int |
FIXED_POINT_IMPL |
private float |
focusX
Variables representing center and focus points.
|
private float |
focusY
Variables representing center and focus points.
|
private float |
invSqStepFloat
Length of a square distance intervale in the lookup table
|
private boolean |
isNonCyclic
True when (cycleMethod == NO_CYCLE)
|
private boolean |
isSimpleFocus
True when (focus == center)
|
private static int |
MAX_PRECISION
Used to limit the size of the square root lookup table
|
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 int[] |
sqrtLutFixed
Square root lookup table
|
private float |
trivial
This value represents the solution when focusX == X.
|
a00, a01, a02, a10, a11, a12, cached, cachedModel, colorSpace, cycleMethod, dataModel, DEBUG, fastGradientArraySize, fractions, gradient, GRADIENT_SIZE, GRADIENT_SIZE_INDEX, gradientAverage, gradientOverflow, gradients, gradientsLength, gradientUnderflow, hasDiscontinuity, isSimpleLookup, model, normalizedIntervals, saved
Constructor and Description |
---|
RadialGradientPaintContext(java.awt.image.ColorModel cm,
java.awt.Rectangle deviceBounds,
java.awt.geom.Rectangle2D userBounds,
java.awt.geom.AffineTransform t,
java.awt.RenderingHints hints,
float cx,
float cy,
float r,
float fx,
float fy,
float[] fractions,
java.awt.Color[] colors,
MultipleGradientPaint.CycleMethodEnum cycleMethod,
MultipleGradientPaint.ColorSpaceEnum colorSpace)
Constructor for RadialGradientPaintContext.
|
Modifier and Type | Method and Description |
---|---|
private void |
antiAliasFillRaster(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.
|
private void |
calculateFixedPointSqrtLookupTable()
Build square root lookup table
|
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 |
fixedPointSimplestCaseNonCyclicFillRaster(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).
|
calculateGradientFractions, dispose, getCachedRaster, getColorModel, getRaster, indexGradientAntiAlias, indexIntoGradientsArrays, putCachedRaster
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 trivial
private static final int FIXED_POINT_IMPL
private static final int DEFAULT_IMPL
private static final int ANTI_ALIAS_IMPL
private int fillMethod
private static final float SCALEBACK
private float invSqStepFloat
private static final int MAX_PRECISION
private int[] sqrtLutFixed
public RadialGradientPaintContext(java.awt.image.ColorModel cm, java.awt.Rectangle deviceBounds, java.awt.geom.Rectangle2D userBounds, java.awt.geom.AffineTransform t, java.awt.RenderingHints hints, float cx, float cy, float r, float fx, float fy, float[] fractions, java.awt.Color[] colors, MultipleGradientPaint.CycleMethodEnum cycleMethod, MultipleGradientPaint.ColorSpaceEnum colorSpace) throws java.awt.geom.NoninvertibleTransformException
cm
- ColorModel
that receives
the Paint
data. This is used only as a hint.deviceBounds
- the device space bounding box of the
graphics primitive being rendereduserBounds
- the user space bounding box of the
graphics primitive being renderedt
- the AffineTransform
from user
space into device space (gradientTransform should be
concatenated with this)hints
- the hints that the context object uses to choose
between rendering alternativescx
- the center point in user space of the circle defining
the gradient. The last color of the gradient is mapped to the
perimeter of this circle X coordinatecy
- the center point in user space of the circle defining
the gradient. The last color of the gradient is mapped to the
perimeter of this circle Y coordinater
- the radius of the circle defining the extents of the
color gradientfx
- the point in user space to which the first color is mapped
X coordinatefy
- the point in user space to which the first color is mapped
Y coordinatefractions
- the fractions specifying the gradient distributioncolors
- the gradient colorscycleMethod
- either NO_CYCLE, REFLECT, or REPEATcolorSpace
- which colorspace to use for interpolation,
either SRGB or LINEAR_RGBjava.awt.geom.NoninvertibleTransformException
protected void fillRaster(int[] pixels, int off, int adjust, int x, int y, int w, int h)
fillRaster
in class MultipleGradientPaintContext
x
- The x coordinate of the area in device space for which colors
are generated.y
- The y coordinate of the area in device space for which colors
are generated.w
- The width of the area in device space for which colors
are generated.h
- The height of the area in device space for which colors
are generated.private void fixedPointSimplestCaseNonCyclicFillRaster(int[] pixels, int off, int adjust, int x, int y, int w, int h)
private void calculateFixedPointSqrtLookupTable()
private void cyclicCircularGradientFillRaster(int[] pixels, int off, int adjust, int x, int y, int w, int h)
private void antiAliasFillRaster(int[] pixels, int off, int adjust, int x, int y, int w, int h)