public abstract class PDShading extends Object implements COSObjectable
Modifier and Type | Field and Description |
---|---|
static int |
SHADING_TYPE1
shading type 1 = function based shading.
|
static int |
SHADING_TYPE2
shading type 2 = axial shading.
|
static int |
SHADING_TYPE3
shading type 3 = radial shading.
|
static int |
SHADING_TYPE4
shading type 4 = Free-Form Gouraud-Shaded Triangle Meshes.
|
static int |
SHADING_TYPE5
shading type 5 = Lattice-Form Gouraud-Shaded Triangle Meshes.
|
static int |
SHADING_TYPE6
shading type 6 = Coons Patch Meshes.
|
static int |
SHADING_TYPE7
shading type 7 = Tensor-Product Patch Meshes.
|
Constructor and Description |
---|
PDShading()
Default constructor.
|
PDShading(COSDictionary shadingDictionary)
Constructor using the given shading dictionary.
|
Modifier and Type | Method and Description |
---|---|
static PDShading |
create(COSDictionary resourceDictionary)
Create the correct PD Model shading based on the COS base shading.
|
float[] |
evalFunction(float inputValue)
Convert the input value using the functions of the shading dictionary.
|
float[] |
evalFunction(float[] input)
Convert the input values using the functions of the shading dictionary.
|
boolean |
getAntiAlias()
This will return the AntiAlias value.
|
COSArray |
getBackground()
This will return the background.
|
PDRectangle |
getBBox()
An array of four numbers in the form coordinate system (see below),
giving the coordinates of the left, bottom, right, and top edges,
respectively, of the shading's bounding box.
|
PDColorSpace |
getColorSpace()
This will get the color space or null if none exists.
|
COSDictionary |
getCOSObject()
This will get the underlying dictionary.
|
PDFunction |
getFunction()
This will return the function used to convert the color values.
|
abstract int |
getShadingType()
This will return the shading type.
|
String |
getType()
This will return the type.
|
void |
setAntiAlias(boolean antiAlias)
This will set the AntiAlias value.
|
void |
setBackground(COSArray newBackground)
This will set the background.
|
void |
setBBox(PDRectangle newBBox)
This will set the BBox (bounding box) for this Shading.
|
void |
setColorSpace(PDColorSpace colorSpace)
This will set the color space for the shading.
|
void |
setFunction(COSArray newFunctions)
This will set the functions COSArray for the color conversion.
|
void |
setFunction(PDFunction newFunction)
This will set the function for the color conversion.
|
void |
setShadingType(int shadingType)
This will set the shading type.
|
abstract Paint |
toPaint(Matrix matrix)
Returns an AWT paint which corresponds to this shading
|
public static final int SHADING_TYPE1
public static final int SHADING_TYPE2
public static final int SHADING_TYPE3
public static final int SHADING_TYPE4
public static final int SHADING_TYPE5
public static final int SHADING_TYPE6
public static final int SHADING_TYPE7
public PDShading()
public PDShading(COSDictionary shadingDictionary)
shadingDictionary
- the dictionary for this shadingpublic COSDictionary getCOSObject()
getCOSObject
in interface COSObjectable
public String getType()
public void setShadingType(int shadingType)
shadingType
- the new shading typepublic abstract int getShadingType()
public void setBackground(COSArray newBackground)
newBackground
- the new backgroundpublic COSArray getBackground()
public PDRectangle getBBox()
public void setBBox(PDRectangle newBBox)
newBBox
- the new BBoxpublic void setAntiAlias(boolean antiAlias)
antiAlias
- the new AntiAlias valuepublic boolean getAntiAlias()
public PDColorSpace getColorSpace() throws IOException
IOException
- if there is an error getting the color spacepublic void setColorSpace(PDColorSpace colorSpace)
colorSpace
- the color spacepublic static PDShading create(COSDictionary resourceDictionary) throws IOException
resourceDictionary
- the COS shading dictionaryIOException
- if we are unable to create the PDShading objectpublic void setFunction(PDFunction newFunction)
newFunction
- the new functionpublic void setFunction(COSArray newFunctions)
newFunctions
- the new COSArray containing all functionspublic PDFunction getFunction() throws IOException
IOException
- if we were not able to create the function.public float[] evalFunction(float inputValue) throws IOException
inputValue
- the input valueIOException
- thrown if something went wrongpublic float[] evalFunction(float[] input) throws IOException
input
- the input valuesIOException
- thrown if something went wrongpublic abstract Paint toPaint(Matrix matrix)
matrix
- the pattern matrix concatenated with that of the parent content stream,
this matrix which maps the pattern's internal coordinate system to user spaceCopyright © 2002–2017 The Apache Software Foundation. All rights reserved.