abstract class PatchMeshesShadingContext extends TriangleBasedShadingContext
Modifier and Type | Field and Description |
---|---|
private static org.apache.commons.logging.Log |
LOG |
private java.util.List<Patch> |
patchList
patch list
|
bitsPerColorComponent, bitsPerCoordinate, numberOfColorComponents
Modifier | Constructor and Description |
---|---|
protected |
PatchMeshesShadingContext(PDShadingType6 shading,
java.awt.image.ColorModel colorModel,
java.awt.geom.AffineTransform xform,
Matrix matrix,
java.awt.Rectangle deviceBounds,
int controlPoints)
Constructor creates an instance to be used for fill operations.
|
Modifier and Type | Method and Description |
---|---|
protected java.util.Map<java.awt.Point,java.lang.Integer> |
calcPixelTable(java.awt.Rectangle deviceBounds)
Calculate every point and its color and store them in a Hash table.
|
(package private) java.util.List<Patch> |
collectPatches(PDShadingType6 shadingType,
java.awt.geom.AffineTransform xform,
Matrix matrix,
int controlPoints)
Create a patch list from a data stream, the returned list contains all the patches contained
in the data stream.
|
void |
dispose() |
(package private) abstract Patch |
generatePatch(java.awt.geom.Point2D[] points,
float[][] color)
Create a patch using control points and 4 corner color values, in
Type6ShadingContext, a CoonsPatch is returned; in Type6ShadingContext, a
TensorPatch is returned.
|
private float |
interpolate(float x,
long maxValue,
float rangeMin,
float rangeMax)
Get a point coordinate on a line by linear interpolation.
|
protected boolean |
isDataEmpty()
Returns true if the shading has an empty data stream.
|
protected Patch |
readPatch(javax.imageio.stream.ImageInputStream input,
boolean isFree,
java.awt.geom.Point2D[] implicitEdge,
float[][] implicitCornerColor,
long maxSrcCoord,
long maxSrcColor,
PDRange rangeX,
PDRange rangeY,
PDRange[] colRange,
Matrix matrix,
java.awt.geom.AffineTransform xform,
int controlPoints)
Read a single patch from a data stream, a patch contains information of its coordinates and
color parameters.
|
calcPixelTable, createPixelTable, getColorModel, getRaster
convertToRGB, getBackground, getRgbBackground, getShading, getShadingColorSpace
private static final org.apache.commons.logging.Log LOG
private java.util.List<Patch> patchList
protected PatchMeshesShadingContext(PDShadingType6 shading, java.awt.image.ColorModel colorModel, java.awt.geom.AffineTransform xform, Matrix matrix, java.awt.Rectangle deviceBounds, int controlPoints) throws java.io.IOException
shading
- the shading type to be usedcolorModel
- the color model to be usedxform
- transformation for user to device spacematrix
- the pattern matrix concatenated with that of the parent content streamdeviceBounds
- device boundscontrolPoints
- number of control points, 12 for type 6 shading and 16 for type 7 shadingjava.io.IOException
- if something went wrongfinal java.util.List<Patch> collectPatches(PDShadingType6 shadingType, java.awt.geom.AffineTransform xform, Matrix matrix, int controlPoints) throws java.io.IOException
shadingType
- the shading typexform
- transformation for user to device spacematrix
- the pattern matrix concatenated with that of the parent content streamcontrolPoints
- number of control points, 12 for type 6 shading and 16 for type 7 shadingjava.io.IOException
- when something went wrongprotected Patch readPatch(javax.imageio.stream.ImageInputStream input, boolean isFree, java.awt.geom.Point2D[] implicitEdge, float[][] implicitCornerColor, long maxSrcCoord, long maxSrcColor, PDRange rangeX, PDRange rangeY, PDRange[] colRange, Matrix matrix, java.awt.geom.AffineTransform xform, int controlPoints) throws java.io.IOException
input
- the image source data streamisFree
- whether this is a free patchimplicitEdge
- implicit edge when a patch is not free, otherwise it's not usedimplicitCornerColor
- implicit colors when a patch is not free, otherwise it's not usedmaxSrcCoord
- the maximum coordinate value calculated from source datamaxSrcColor
- the maximum color value calculated from source datarangeX
- range for coordinate xrangeY
- range for coordinate ycolRange
- range for colormatrix
- the pattern matrix concatenated with that of the parent content streamxform
- transformation for user to device spacecontrolPoints
- number of control points, 12 for type 6 shading and 16 for type 7 shadingjava.io.IOException
- when something went wrongabstract Patch generatePatch(java.awt.geom.Point2D[] points, float[][] color)
points
- 12 or 16 control pointscolor
- 4 corner colorsprivate float interpolate(float x, long maxValue, float rangeMin, float rangeMax)
protected java.util.Map<java.awt.Point,java.lang.Integer> calcPixelTable(java.awt.Rectangle deviceBounds) throws java.io.IOException
TriangleBasedShadingContext
calcPixelTable
in class TriangleBasedShadingContext
java.io.IOException
public void dispose()
dispose
in interface java.awt.PaintContext
dispose
in class TriangleBasedShadingContext
protected boolean isDataEmpty()
TriangleBasedShadingContext
isDataEmpty
in class TriangleBasedShadingContext