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:
PaintContext
- Direct Known Subclasses:
Type6ShadingContext,Type7ShadingContext
This class is extended in Type6ShadingContext and Type7ShadingContext. This
was done as part of GSoC2014, Tilman Hausherr is the mentor.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedPatchMeshesShadingContext(PDMeshBasedShadingType shading, ColorModel colorModel, AffineTransform xform, Matrix matrix, Rectangle deviceBounds, int controlPoints) Constructor creates an instance to be used for fill operations. -
Method Summary
Modifier and TypeMethodDescriptioncalcPixelTable(Rectangle deviceBounds) Calculate every point and its color and store them in a Hash table.voiddispose()protected booleanReturns true if the shading has an empty data stream.Methods inherited from class org.apache.pdfbox.pdmodel.graphics.shading.TriangleBasedShadingContext
calcPixelTable, createPixelTable, getColorModel, getRasterMethods inherited from class org.apache.pdfbox.pdmodel.graphics.shading.ShadingContext
convertToRGB, getBackground, getRgbBackground, getShading, getShadingColorSpace
-
Field Details
-
patchList
patch list
-
-
Constructor Details
-
PatchMeshesShadingContext
protected PatchMeshesShadingContext(PDMeshBasedShadingType shading, ColorModel colorModel, AffineTransform xform, Matrix matrix, Rectangle deviceBounds, int controlPoints) throws 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:
IOException- if something went wrong
-
-
Method Details
-
calcPixelTable
Description 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:
IOException
-
dispose
public void dispose()- Specified by:
disposein interfacePaintContext- Overrides:
disposein classTriangleBasedShadingContext
-
isDataEmpty
protected boolean isDataEmpty()Description copied from class:TriangleBasedShadingContextReturns true if the shading has an empty data stream.- Specified by:
isDataEmptyin classTriangleBasedShadingContext
-