abstract class TriangleBasedShadingContext extends ShadingContext implements java.awt.PaintContext
Modifier and Type | Field and Description |
---|---|
protected int |
bitsPerColorComponent |
protected int |
bitsPerCoordinate |
private boolean |
hasFunction |
private static org.apache.commons.logging.Log |
LOG |
protected int |
numberOfColorComponents |
private java.util.Map<java.awt.Point,java.lang.Integer> |
pixelTable |
Constructor and Description |
---|
TriangleBasedShadingContext(PDShading shading,
java.awt.image.ColorModel cm,
java.awt.geom.AffineTransform xform,
Matrix matrix)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
calcPixelTable(java.util.List<ShadedTriangle> triangleList,
java.util.Map<java.awt.Point,java.lang.Integer> map,
java.awt.Rectangle deviceBounds)
Get the points from the triangles, calculate their color and add point-color mappings.
|
(package private) abstract 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.
|
protected void |
createPixelTable(java.awt.Rectangle deviceBounds)
Creates the pixel table.
|
void |
dispose() |
private int |
evalFunctionAndConvertToRGB(float[] values)
Convert color to RGB color value, using function if required, then convert from the shading
color space to an RGB value, which is encoded into an integer.
|
java.awt.image.ColorModel |
getColorModel() |
java.awt.image.Raster |
getRaster(int x,
int y,
int w,
int h) |
(package private) abstract boolean |
isDataEmpty()
Returns true if the shading has an empty data stream.
|
convertToRGB, getBackground, getRgbBackground, getShading, getShadingColorSpace
private static final org.apache.commons.logging.Log LOG
protected int bitsPerCoordinate
protected int bitsPerColorComponent
protected int numberOfColorComponents
private final boolean hasFunction
private java.util.Map<java.awt.Point,java.lang.Integer> pixelTable
TriangleBasedShadingContext(PDShading shading, java.awt.image.ColorModel cm, java.awt.geom.AffineTransform xform, Matrix matrix) throws java.io.IOException
shading
- the shading type to be usedcm
- the color model to be usedxform
- transformation for user to device spacematrix
- the pattern matrix concatenated with that of the parent content streamjava.io.IOException
- if there is an error getting the color space or doing background color conversion.protected final void createPixelTable(java.awt.Rectangle deviceBounds) throws java.io.IOException
java.io.IOException
abstract java.util.Map<java.awt.Point,java.lang.Integer> calcPixelTable(java.awt.Rectangle deviceBounds) throws java.io.IOException
java.io.IOException
protected void calcPixelTable(java.util.List<ShadedTriangle> triangleList, java.util.Map<java.awt.Point,java.lang.Integer> map, java.awt.Rectangle deviceBounds) throws java.io.IOException
java.io.IOException
private int evalFunctionAndConvertToRGB(float[] values) throws java.io.IOException
java.io.IOException
abstract boolean isDataEmpty()
public final java.awt.image.ColorModel getColorModel()
getColorModel
in interface java.awt.PaintContext
getColorModel
in class ShadingContext
public void dispose()
dispose
in interface java.awt.PaintContext
dispose
in class ShadingContext
public final java.awt.image.Raster getRaster(int x, int y, int w, int h)
getRaster
in interface java.awt.PaintContext