Class GouraudShadingContext
java.lang.Object
org.apache.pdfbox.pdmodel.graphics.shading.ShadingContext
org.apache.pdfbox.pdmodel.graphics.shading.TriangleBasedShadingContext
org.apache.pdfbox.pdmodel.graphics.shading.GouraudShadingContext
- All Implemented Interfaces:
PaintContext
- Direct Known Subclasses:
Type4ShadingContext
,Type5ShadingContext
Shades Gouraud triangles for Type4ShadingContext and Type5ShadingContext.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
GouraudShadingContext
(PDShading shading, ColorModel colorModel, AffineTransform xform, Matrix matrix) 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.void
dispose()
protected boolean
Returns true if the shading has an empty data stream.(package private) final void
setTriangleList
(List<ShadedTriangle> triangleList) Methods inherited from class org.apache.pdfbox.pdmodel.graphics.shading.TriangleBasedShadingContext
calcPixelTable, createPixelTable, getColorModel, getRaster
Methods inherited from class org.apache.pdfbox.pdmodel.graphics.shading.ShadingContext
convertToRGB, getBackground, getRgbBackground, getShading, getShadingColorSpace
-
Field Details
-
triangleList
triangle list.
-
-
Constructor Details
-
GouraudShadingContext
protected GouraudShadingContext(PDShading shading, ColorModel colorModel, AffineTransform xform, Matrix matrix) 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 stream- Throws:
IOException
- if something went wrong
-
-
Method Details
-
setTriangleList
-
calcPixelTable
Description copied from class:TriangleBasedShadingContext
Calculate every point and its color and store them in a Hash table.- Specified by:
calcPixelTable
in classTriangleBasedShadingContext
- Returns:
- a Hash table which contains all the points' positions and colors of one image
- Throws:
IOException
-
dispose
public void dispose()- Specified by:
dispose
in interfacePaintContext
- Overrides:
dispose
in classTriangleBasedShadingContext
-
isDataEmpty
protected boolean isDataEmpty()Description copied from class:TriangleBasedShadingContext
Returns true if the shading has an empty data stream.- Specified by:
isDataEmpty
in classTriangleBasedShadingContext
-