Top Description Fields Constructors Methods
org.apache.pdfbox.pdmodel.graphics.shading

pack-priv abstract Class GouraudShadingContext

extends TriangleBasedShadingContext
Class Inheritance
Known Direct Subclasses
org.apache.pdfbox.pdmodel.graphics.shading.Type4ShadingContext, org.apache.pdfbox.pdmodel.graphics.shading.Type5ShadingContext
Imports
java.awt.Point, .Rectangle, java.awt.geom.AffineTransform, java.awt.image.ColorModel, java.io.IOException, java.util.ArrayList, .Arrays, .Collections, .List, .Map, org.apache.pdfbox.util.Matrix

Shades Gouraud triangles for Type4ShadingContext and Type5ShadingContext.
Authors
Tilman Hausherr, Shaola Ren

Field Summary

Modifier and TypeField and Description
private List<ShadedTriangle>
triangleList

triangle list.

Constructor Summary

AccessConstructor and Description
protected
GouraudShadingContext(PDShading
the shading type to be used
shading
,
ColorModel
the color model to be used
colorModel
,
AffineTransform
transformation for user to device space
xform
,
Matrix
the pattern matrix concatenated with that of the parent content stream
matrix
)

Constructor creates an instance to be used for fill operations.

Method Summary

Modifier and TypeMethod and Description
protected Map<Point, Integer>
calcPixelTable(Rectangle deviceBounds)

Implements abstract org.apache.pdfbox.pdmodel.graphics.shading.TriangleBasedShadingContext.calcPixelTable.

Calculate every point and its color and store them in a Hash table.

protected int[][]
calcPixelTableArray(Rectangle deviceBounds)

Implements abstract org.apache.pdfbox.pdmodel.graphics.shading.TriangleBasedShadingContext.calcPixelTableArray.

Calculate every point and its color and store them in a two-dimensional array.

public void
dispose()

Overrides org.apache.pdfbox.pdmodel.graphics.shading.ShadingContext.dispose.

Implements java.awt.PaintContext.dispose.

Releases the resources allocated for the operation.

protected boolean
isDataEmpty()

Implements abstract org.apache.pdfbox.pdmodel.graphics.shading.TriangleBasedShadingContext.isDataEmpty.

Returns true if the shading has an empty data stream.

pack-priv final void
Inherited from org.apache.pdfbox.pdmodel.graphics.shading.TriangleBasedShadingContext:
calcPixelTablecalcPixelTablecreatePixelTablegetRaster

Field Detail

triangleListback to summary
private List<ShadedTriangle> triangleList

triangle list.

Constructor Detail

GouraudShadingContextback to summary
protected GouraudShadingContext(PDShading shading, ColorModel colorModel, AffineTransform xform, Matrix matrix) throws IOException

Constructor creates an instance to be used for fill operations.

Parameters
shading:PDShading

the shading type to be used

colorModel:ColorModel

the color model to be used

xform:AffineTransform

transformation for user to device space

matrix:Matrix

the pattern matrix concatenated with that of the parent content stream

Exceptions
IOException:
if something went wrong

Method Detail

calcPixelTableback to summary
protected Map<Point, Integer> calcPixelTable(Rectangle deviceBounds) throws IOException

Implements abstract org.apache.pdfbox.pdmodel.graphics.shading.TriangleBasedShadingContext.calcPixelTable.

Doc from org.apache.pdfbox.pdmodel.graphics.shading.TriangleBasedShadingContext.calcPixelTable.

Calculate every point and its color and store them in a Hash table.

Returns:Map<Point, Integer>

a Hash table which contains all the points' positions and colors of one image

Annotations
@Override
calcPixelTableArrayback to summary
protected int[][] calcPixelTableArray(Rectangle deviceBounds) throws IOException

Implements abstract org.apache.pdfbox.pdmodel.graphics.shading.TriangleBasedShadingContext.calcPixelTableArray.

Doc from org.apache.pdfbox.pdmodel.graphics.shading.TriangleBasedShadingContext.calcPixelTableArray.

Calculate every point and its color and store them in a two-dimensional array.

Returns:int[][]

an array which contains all the points' positions and colors of one image

Annotations
@Override
disposeback to summary
public void dispose()

Overrides org.apache.pdfbox.pdmodel.graphics.shading.ShadingContext.dispose.

Implements java.awt.PaintContext.dispose.

Doc from java.awt.PaintContext.dispose.

Releases the resources allocated for the operation.

Annotations
@Override
isDataEmptyback to summary
protected boolean isDataEmpty()

Implements abstract org.apache.pdfbox.pdmodel.graphics.shading.TriangleBasedShadingContext.isDataEmpty.

Doc from org.apache.pdfbox.pdmodel.graphics.shading.TriangleBasedShadingContext.isDataEmpty.

Returns true if the shading has an empty data stream.

Annotations
@Override
setTriangleListback to summary
pack-priv final void setTriangleList(List<ShadedTriangle> triangleList)