Class PatchMeshesShadingContext
- java.lang.Object
-
- org.apache.pdfbox.pdmodel.graphics.shading.ShadingContext
-
- org.apache.pdfbox.pdmodel.graphics.shading.TriangleBasedShadingContext
-
- org.apache.pdfbox.pdmodel.graphics.shading.PatchMeshesShadingContext
-
- All Implemented Interfaces:
java.awt.PaintContext
- Direct Known Subclasses:
Type6ShadingContext,Type7ShadingContext
abstract class PatchMeshesShadingContext extends TriangleBasedShadingContext
This class is extended in Type6ShadingContext and Type7ShadingContext. This was done as part of GSoC2014, Tilman Hausherr is the mentor.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedPatchMeshesShadingContext(PDMeshBasedShadingType 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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.protected int[][]calcPixelTableArray(java.awt.Rectangle deviceBounds)Calculate every point and its color and store them in a two-dimensional array.voiddispose()protected booleanisDataEmpty()Returns true if the shading has an empty data stream.-
Methods inherited from class org.apache.pdfbox.pdmodel.graphics.shading.TriangleBasedShadingContext
calcPixelTable, calcPixelTable, createPixelTable, getRaster
-
Methods inherited from class org.apache.pdfbox.pdmodel.graphics.shading.ShadingContext
convertToRGB, getBackground, getColorModel, getRgbBackground, getShading, getShadingColorSpace
-
-
-
-
Field Detail
-
patchList
private java.util.List<Patch> patchList
patch list
-
-
Constructor Detail
-
PatchMeshesShadingContext
protected PatchMeshesShadingContext(PDMeshBasedShadingType shading, java.awt.image.ColorModel colorModel, java.awt.geom.AffineTransform xform, Matrix matrix, java.awt.Rectangle deviceBounds, int controlPoints) throws java.io.IOException
Constructor creates an instance to be used for fill operations.- Parameters:
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 shading- Throws:
java.io.IOException- if something went wrong
-
-
Method Detail
-
calcPixelTable
protected java.util.Map<java.awt.Point,java.lang.Integer> calcPixelTable(java.awt.Rectangle deviceBounds) throws java.io.IOExceptionDescription copied from class:TriangleBasedShadingContextCalculate every point and its color and store them in a Hash table.- Specified by:
calcPixelTablein classTriangleBasedShadingContext- Returns:
- a Hash table which contains all the points' positions and colors of one image
- Throws:
java.io.IOException
-
calcPixelTableArray
protected int[][] calcPixelTableArray(java.awt.Rectangle deviceBounds) throws java.io.IOExceptionDescription copied from class:TriangleBasedShadingContextCalculate every point and its color and store them in a two-dimensional array.- Specified by:
calcPixelTableArrayin classTriangleBasedShadingContext- Returns:
- an array which contains all the points' positions and colors of one image
- Throws:
java.io.IOException
-
dispose
public void dispose()
- Specified by:
disposein interfacejava.awt.PaintContext- Overrides:
disposein classShadingContext
-
isDataEmpty
protected boolean isDataEmpty()
Description copied from class:TriangleBasedShadingContextReturns true if the shading has an empty data stream.- Specified by:
isDataEmptyin classTriangleBasedShadingContext
-
-