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

pack-priv abstract Class PatchMeshesShadingContext

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

This class is extended in Type6ShadingContext and Type7ShadingContext. This was done as part of GSoC2014, Tilman Hausherr is the mentor.
Author
Shaola Ren

Field Summary

Modifier and TypeField and Description
private List<Patch>
patchList

patch list

Constructor Summary

AccessConstructor and Description
protected
PatchMeshesShadingContext(PDMeshBasedShadingType
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
,
Rectangle
device bounds
deviceBounds
,
int
number of control points, 12 for type 6 shading and 16 for type 7 shading
controlPoints
)

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.

Inherited from org.apache.pdfbox.pdmodel.graphics.shading.TriangleBasedShadingContext:
calcPixelTablecalcPixelTablecreatePixelTablegetRaster

Field Detail

patchListback to summary
private List<Patch> patchList

patch list

Constructor Detail

PatchMeshesShadingContextback to summary
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:PDMeshBasedShadingType

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

deviceBounds:Rectangle

device bounds

controlPoints:int

number of control points, 12 for type 6 shading and 16 for type 7 shading

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