public abstract class PDFShader
extends java.lang.Object
A PDFShader fills a given region with a shading, such as a gradient.
Shading Dictionaries (section 4.6)
A shading dictionary specifies details of a particular gradient fill,
including the type of shading to be used, the geometry of the area to
be shaded, and the geometry of the gradient fill. Various shading types
are available, depending on the value of the dictionary???s ShadingType entry:
Modifier and Type | Field and Description |
---|---|
static int |
AXIAL_SHADING |
static int |
COONS_PATCH_MESH_SHADING |
static int |
FREE_FORM_SHADING |
static int |
FUNCTION_SHADING |
static int |
LATTICE_SHADING |
static int |
RADIAL_SHADING |
static int |
TENSOR_PRODUCTS_MESH_SHADING |
Modifier | Constructor and Description |
---|---|
protected |
PDFShader(int type)
Creates a new instance of PDFShader
|
Modifier and Type | Method and Description |
---|---|
PDFPaint |
getBackground()
Get the background color
|
java.awt.geom.Rectangle2D |
getBBox()
Get the bounding box
|
PDFColorSpace |
getColorSpace()
Get the color space
|
abstract PDFPaint |
getPaint()
Returns paint that represents the selected shader
|
static PDFShader |
getShader(PDFObject shaderObj,
java.util.Map resources)
Parse a pdf shader into a shader object
|
int |
getType()
Get the type
|
abstract void |
parse(PDFObject shareObj)
Parse the shader-specific data
|
protected void |
setBackground(PDFPaint background)
Set the background color
|
protected void |
setBBox(java.awt.geom.Rectangle2D bbox)
Set the bounding box
|
protected void |
setColorSpace(PDFColorSpace colorSpace)
Set the color space
|
public static final int FUNCTION_SHADING
public static final int AXIAL_SHADING
public static final int RADIAL_SHADING
public static final int FREE_FORM_SHADING
public static final int LATTICE_SHADING
public static final int COONS_PATCH_MESH_SHADING
public static final int TENSOR_PRODUCTS_MESH_SHADING
public static PDFShader getShader(PDFObject shaderObj, java.util.Map resources) throws java.io.IOException
java.io.IOException
public int getType()
public PDFColorSpace getColorSpace()
protected void setColorSpace(PDFColorSpace colorSpace)
public PDFPaint getBackground()
protected void setBackground(PDFPaint background)
public java.awt.geom.Rectangle2D getBBox()
protected void setBBox(java.awt.geom.Rectangle2D bbox)
public abstract void parse(PDFObject shareObj) throws java.io.IOException
java.io.IOException
public abstract PDFPaint getPaint()