| 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 final float | SCALEBACK
Amount for offset when clamping focus. |
| private static final int | |
| private static float[] | |
| private float | trivial
This value represents the solution when focusX == X. |
| Access | Constructor and Description |
|---|---|
| pack-priv | RadialGradientPaintContext(RadialGradientPaint
the paint, ColorModel RadialGradientPaint from which this context
is createdthe cm, Rectangle ColorModel that receives
the Paint data (this is used only as a hint)the device space bounding box of the
graphics primitive being rendered deviceBounds, Rectangle2D the user space bounding box of the
graphics primitive being rendered userBounds, AffineTransform the t, RenderingHints AffineTransform from user
space into device space (gradientTransform should be
concatenated with this)the hints that the context object uses to choose
between rendering alternatives hints, float 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. cx, float 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. cy, float the radius of the circle defining the extents of the
color gradient r, float the X coordinate in user space to which the first color
is mapped fx, float the Y coordinate in user space to which the first color
is mapped fy, float[] the fractions specifying the gradient distribution fractions, Color[] the gradient colors colors, MultipleGradientPaint.either NO_CYCLE, REFLECT, or REPEAT cycleMethod,which colorspace to use for interpolation,
either SRGB or LINEAR_RGB colorSpaceConstructor for RadialGradientPaintContext. |
| 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)
Implements abstract java. 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). |
| centerX | back to summary |
|---|---|
| private float centerX Variables representing center and focus points. | |
| centerY | back to summary |
|---|---|
| private float centerY Variables representing center and focus points. | |
| constA | back to summary |
|---|---|
| private float constA Constant part of X, Y user space coordinates. | |
| constB | back to summary |
|---|---|
| private float constB Constant part of X, Y user space coordinates. | |
| focusX | back to summary |
|---|---|
| private float focusX Variables representing center and focus points. | |
| focusY | back to summary |
|---|---|
| private float focusY Variables representing center and focus points. | |
| gDeltaDelta | back to summary |
|---|---|
| private float gDeltaDelta Constant second order delta for simple loop. | |
| isNonCyclic | back to summary |
|---|---|
| private boolean isNonCyclic True when (cycleMethod == NO_CYCLE). | |
| isSimpleFocus | back to summary |
|---|---|
| private boolean isSimpleFocus True when (focus == center). | |
| radius | back to summary |
|---|---|
| private float radius Radius of the outermost circle defining the 100% gradient stop. | |
| radiusSq | back to summary |
|---|---|
| private float radiusSq Radius of the gradient circle squared. | |
| SCALEBACK | back to summary |
|---|---|
| private static final float SCALEBACK Amount for offset when clamping focus. | |
| SQRT_LUT_SIZE | back to summary |
|---|---|
| private static final int SQRT_LUT_SIZE | |
| sqrtLut | back to summary |
|---|---|
| private static float[] sqrtLut | |
| trivial | back to summary |
|---|---|
| private float trivial This value represents the solution when focusX == X. It is called trivial because it is easier to calculate than the general case. | |
| RadialGradientPaintContext | back to summary |
|---|---|
| pack-priv RadialGradientPaintContext(RadialGradientPaint paint, ColorModel cm, Rectangle deviceBounds, Rectangle2D userBounds, AffineTransform t, RenderingHints hints, float cx, float cy, float r, float fx, float fy, float[] fractions, Color[] colors, MultipleGradientPaint. Constructor for RadialGradientPaintContext.
| |
| cyclicCircularGradientFillRaster | back to summary |
|---|---|
| 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. This calculation first computes the intersection point of the line from the focus through the current point in the raster, and the perimeter of the gradient circle. Then it determines the percentage distance of the current point along that line (focus is 0%, perimeter is 100%). Equation of a circle centered at (a,b) with radius r: (x-a)^2 + (y-b)^2 = r^2 Equation of a line with slope m and y-intercept b: y = mx + b Replacing y in the circle equation and solving using the quadratic formula produces the following set of equations. Constant factors have been extracted out of the inner loop. | |
| fillRaster | back to summary |
|---|---|
| protected void fillRaster(int[] pixels, int off, int adjust, int x, int y, int w, int h) Implements abstract java. Return a Raster containing the colors generated for the graphics operation. | |
| simpleNonCyclicFillRaster | back to summary |
|---|---|
| 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). | |