Package org.apache.batik.ext.awt
Class LinearGradientPaintContext
java.lang.Object
org.apache.batik.ext.awt.MultipleGradientPaintContext
org.apache.batik.ext.awt.LinearGradientPaintContext
- All Implemented Interfaces:
PaintContext
Provides the actual implementation for the LinearGradientPaint
This is where the pixel processing is done.
- Version:
- $Id: LinearGradientPaintContext.java 1733416 2016-03-03 07:07:13Z gadams $
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
private static final int
private float
The following invariants are used to process the gradient value from a device space coordinate, (X, Y): g(X, Y) = dgdX*X + dgdY*Y + gcprivate float
The following invariants are used to process the gradient value from a device space coordinate, (X, Y): g(X, Y) = dgdX*X + dgdY*Y + gcprivate int
private float
The following invariants are used to process the gradient value from a device space coordinate, (X, Y): g(X, Y) = dgdX*X + dgdY*Y + gcprivate float
The following invariants are used to process the gradient value from a device space coordinate, (X, Y): g(X, Y) = dgdX*X + dgdY*Y + gcFields inherited from class org.apache.batik.ext.awt.MultipleGradientPaintContext
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 Summary
ConstructorsConstructorDescriptionLinearGradientPaintContext
(ColorModel cm, Rectangle deviceBounds, Rectangle2D userBounds, AffineTransform t, RenderingHints hints, Point2D dStart, Point2D dEnd, float[] fractions, Color[] colors, MultipleGradientPaint.CycleMethodEnum cycleMethod, MultipleGradientPaint.ColorSpaceEnum colorSpace) Constructor for LinearGradientPaintContext. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
fillHardNoCycle
(int[] pixels, int off, int adjust, int x, int y, int w, int h) 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.protected void
fillSimpleNoCycle
(int[] pixels, int off, int adjust, int x, int y, int w, int h) protected void
fillSimpleReflect
(int[] pixels, int off, int adjust, int x, int y, int w, int h) protected void
fillSimpleRepeat
(int[] pixels, int off, int adjust, int x, int y, int w, int h) Methods inherited from class org.apache.batik.ext.awt.MultipleGradientPaintContext
calculateGradientFractions, dispose, getCachedRaster, getColorModel, getRaster, indexGradientAntiAlias, indexIntoGradientsArrays, putCachedRaster
-
Field Details
-
dgdX
private float dgdXThe following invariants are used to process the gradient value from a device space coordinate, (X, Y): g(X, Y) = dgdX*X + dgdY*Y + gc -
dgdY
private float dgdYThe following invariants are used to process the gradient value from a device space coordinate, (X, Y): g(X, Y) = dgdX*X + dgdY*Y + gc -
gc
private float gcThe following invariants are used to process the gradient value from a device space coordinate, (X, Y): g(X, Y) = dgdX*X + dgdY*Y + gc -
pixSz
private float pixSzThe following invariants are used to process the gradient value from a device space coordinate, (X, Y): g(X, Y) = dgdX*X + dgdY*Y + gc -
DEFAULT_IMPL
private static final int DEFAULT_IMPL- See Also:
-
ANTI_ALIAS_IMPL
private static final int ANTI_ALIAS_IMPL- See Also:
-
fillMethod
private int fillMethod
-
-
Constructor Details
-
LinearGradientPaintContext
public LinearGradientPaintContext(ColorModel cm, Rectangle deviceBounds, Rectangle2D userBounds, AffineTransform t, RenderingHints hints, Point2D dStart, Point2D dEnd, float[] fractions, Color[] colors, MultipleGradientPaint.CycleMethodEnum cycleMethod, MultipleGradientPaint.ColorSpaceEnum colorSpace) throws NoninvertibleTransformException Constructor for LinearGradientPaintContext.- Parameters:
cm
-ColorModel
that receives thePaint
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
- theAffineTransform
from user space into device space (gradientTransform should be concatenated with this)hints
- the hints that the context object uses to choose between rendering alternativesdStart
- gradient start point, in user spacedEnd
- gradient end point, in user spacefractions
- 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_RGB- Throws:
NoninvertibleTransformException
-
-
Method Details
-
fillHardNoCycle
protected void fillHardNoCycle(int[] pixels, int off, int adjust, int x, int y, int w, int h) -
fillSimpleNoCycle
protected void fillSimpleNoCycle(int[] pixels, int off, int adjust, int x, int y, int w, int h) -
fillSimpleRepeat
protected void fillSimpleRepeat(int[] pixels, int off, int adjust, int x, int y, int w, int h) -
fillSimpleReflect
protected void fillSimpleReflect(int[] pixels, int off, int adjust, int x, int y, int w, int h) -
fillRaster
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. This is where the area is filled with colors distributed linearly.- Specified by:
fillRaster
in classMultipleGradientPaintContext
- Parameters:
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.
-