public class PDFShading extends PDFObject
Modifier and Type | Field and Description |
---|---|
protected boolean |
antiAlias
Optional: A flag whether or not to filter the shading function
to prevent aliasing artifacts.
|
protected java.util.List |
background
The background color.
|
protected java.util.List |
bBox
Optional: A List specifying the clipping rectangle
|
protected int |
bitsPerComponent
Required for Type 4,5,6, and 7: Specifies the number of bits used
to represent each color coordinate.
|
protected int |
bitsPerCoordinate
Required for Type 4,5,6, and 7: Specifies the number of bits used
to represent each vertex coordinate.
|
protected int |
bitsPerFlag
Required for Type 4,5,6, and 7: Specifies the number of bits used
to represent the edge flag for each vertex.
|
protected PDFDeviceColorSpace |
colorSpace
A ColorSpace representing the colorspace.
|
protected java.util.List |
coords
Required for Type 2: An Array of four numbers specifying
the starting and ending coordinate pairs
Required for Type 3: An Array of six numbers [x0,y0,r0,x1,y1,r1]
specifying the centers and radii of
the starting and ending circles.
|
protected java.util.List |
decode
Required for Type 4,5,6, and 7: Array of Doubles which specifies
how to decode coordinate and color component values.
|
protected java.util.List |
domain
Optional for Type 1: Array of four numbers, xmin, xmax, ymin, ymax.
|
protected java.util.List |
extend
Required for Type 2+3: An Array of two boolean values specifying
whether to extend the start and end colors past the start
and end points, respectively.
|
protected PDFFunction |
function
Required for Type 1, 2, and 3:
The object of the color mapping function (usually type 2 or 3).
|
protected java.util.List |
matrix
Optional for Type 1: A transformation matrix
|
protected java.lang.String |
shadingName
The name of the Shading e.g.
|
protected int |
shadingType
Required: The Type of shading (1,2,3,4,5,6,7)
|
protected int |
verticesPerRow
Required for Type 5:The number of vertices in each "row" of
the lattice; it must be greater than or equal to 2.
|
DATE_FORMAT, log
Constructor and Description |
---|
PDFShading(int theShadingType,
PDFDeviceColorSpace theColorSpace,
java.util.List theBackground,
java.util.List theBBox,
boolean theAntiAlias,
int theBitsPerCoordinate,
int theBitsPerComponent,
int theBitsPerFlag,
java.util.List theDecode,
PDFFunction theFunction)
Constructor for Type 4,6, or 7
|
PDFShading(int theShadingType,
PDFDeviceColorSpace theColorSpace,
java.util.List theBackground,
java.util.List theBBox,
boolean theAntiAlias,
int theBitsPerCoordinate,
int theBitsPerComponent,
java.util.List theDecode,
int theVerticesPerRow,
PDFFunction theFunction)
Constructor for type 5
|
PDFShading(int theShadingType,
PDFDeviceColorSpace theColorSpace,
java.util.List theBackground,
java.util.List theBBox,
boolean theAntiAlias,
java.util.List theDomain,
java.util.List theMatrix,
PDFFunction theFunction)
Constructor for type function based shading
|
PDFShading(int theShadingType,
PDFDeviceColorSpace theColorSpace,
java.util.List theBackground,
java.util.List theBBox,
boolean theAntiAlias,
java.util.List theCoords,
java.util.List theDomain,
PDFFunction theFunction,
java.util.List theExtend)
Constructor for Type 2 and 3
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
contentEquals(PDFObject obj)
Check if the other PDFObject has the same content as the current object.
|
java.lang.String |
getName()
Get the name of this shading.
|
void |
setName(java.lang.String name)
Sets the name of the shading
|
java.lang.String |
toPDFString()
represent as PDF.
|
encode, encodeBinaryToHexString, encodeString, encodeText, formatDateTime, formatDateTime, formatObject, getDocument, getDocumentSafely, getGeneration, getObjectID, getObjectNumber, getParent, hasObjectNumber, makeReference, output, outputInline, referencePDF, setDocument, setObjectNumber, setParent, toPDF
protected java.lang.String shadingName
protected int shadingType
protected PDFDeviceColorSpace colorSpace
protected java.util.List background
protected java.util.List bBox
protected boolean antiAlias
protected java.util.List domain
protected java.util.List matrix
protected PDFFunction function
protected java.util.List coords
protected java.util.List extend
protected int bitsPerCoordinate
protected int bitsPerFlag
protected java.util.List decode
protected int bitsPerComponent
protected int verticesPerRow
public PDFShading(int theShadingType, PDFDeviceColorSpace theColorSpace, java.util.List theBackground, java.util.List theBBox, boolean theAntiAlias, java.util.List theDomain, java.util.List theMatrix, PDFFunction theFunction)
theShadingType
- The type of shading object, which should be 1 for function
based shading.theColorSpace
- The colorspace is 'DeviceRGB' or something similar.theBackground
- An array of color components appropriate to the
colorspace key specifying a single color value.
This key is used by the f operator buy ignored by the sh operator.theBBox
- List of double's representing a rectangle
in the coordinate space that is current at the
time of shading is imaged. Temporary clipping
boundary.theAntiAlias
- Whether or not to anti-alias.theDomain
- Optional vector of Doubles specifying the domain.theMatrix
- List of Doubles specifying the matrix.
If it's a pattern, then the matrix maps it to pattern space.
If it's a shading, then it maps it to current user space.
It's optional, the default is the identity matrixtheFunction
- The PDF Function that maps an (x,y) location to a colorpublic PDFShading(int theShadingType, PDFDeviceColorSpace theColorSpace, java.util.List theBackground, java.util.List theBBox, boolean theAntiAlias, java.util.List theCoords, java.util.List theDomain, PDFFunction theFunction, java.util.List theExtend)
theShadingType
- 2 or 3 for axial or radial shadingtheColorSpace
- "DeviceRGB" or similar.theBackground
- theBackground An array of color components appropriate to the
colorspace key specifying a single color value.
This key is used by the f operator buy ignored by the sh operator.theBBox
- List of double's representing a rectangle
in the coordinate space that is current at the
time of shading is imaged. Temporary clipping
boundary.theAntiAlias
- Default is falsetheCoords
- List of four (type 2) or 6 (type 3) DoubletheDomain
- List of Doubles specifying the domaintheFunction
- the Stitching (PDFfunction type 3) function,
even if it's stitching a single functiontheExtend
- List of Booleans of whether to extend the start
and end colors past the start and end points
The default is [false, false]public PDFShading(int theShadingType, PDFDeviceColorSpace theColorSpace, java.util.List theBackground, java.util.List theBBox, boolean theAntiAlias, int theBitsPerCoordinate, int theBitsPerComponent, int theBitsPerFlag, java.util.List theDecode, PDFFunction theFunction)
theShadingType
- 4, 6, or 7 depending on whether it's
Free-form gouraud-shaded triangle meshes, coons patch meshes,
or tensor product patch meshes, respectively.theColorSpace
- "DeviceRGB" or similar.theBackground
- theBackground An array of color components appropriate to the
colorspace key specifying a single color value.
This key is used by the f operator buy ignored by the sh operator.theBBox
- List of double's representing a rectangle
in the coordinate space that is current at the
time of shading is imaged. Temporary clipping
boundary.theAntiAlias
- Default is falsetheBitsPerCoordinate
- 1,2,4,8,12,16,24 or 32.theBitsPerComponent
- 1,2,4,8,12, and 16theBitsPerFlag
- 2,4,8.theDecode
- List of Doubles see PDF 1.3 spec pages 303 to 312.theFunction
- the PDFFunctionpublic PDFShading(int theShadingType, PDFDeviceColorSpace theColorSpace, java.util.List theBackground, java.util.List theBBox, boolean theAntiAlias, int theBitsPerCoordinate, int theBitsPerComponent, java.util.List theDecode, int theVerticesPerRow, PDFFunction theFunction)
theShadingType
- 5 for lattice-Form Gouraud shaded-triangle meshtheColorSpace
- "DeviceRGB" or similar.theBackground
- theBackground An array of color components appropriate to the
colorspace key specifying a single color value.
This key is used by the f operator buy ignored by the sh operator.theBBox
- List of double's representing a rectangle
in the coordinate space that is current at the
time of shading is imaged. Temporary clipping
boundary.theAntiAlias
- Default is falsetheBitsPerCoordinate
- 1,2,4,8,12,16, 24, or 32theBitsPerComponent
- 1,2,4,8,12,24,32theDecode
- List of Doubles. See page 305 in PDF 1.3 spec.theVerticesPerRow
- number of vertices in each "row" of the lattice.theFunction
- The PDFFunction that's mapped on to this shapepublic java.lang.String getName()
public void setName(java.lang.String name)
name
- the name of the shading pattern. Can be anything
without spaces. "Shading1" or "Sh1" are good examples.public java.lang.String toPDFString()
toPDFString
in class PDFObject
protected boolean contentEquals(PDFObject obj)
Note: This function has a contract which is less binding than
Object.equals(Object)
. Whereas equals would require all values to be
identical, this method is not required to check everything. In the case
of PDFObjects, this means that the overriding function does not have to
check for PDFObject.getObjectID()
.
contentEquals
in class PDFObject
obj
- object to compare to.Copyright 1999-2010 The Apache Software Foundation. All Rights Reserved.