Class PDFShader
java.lang.Object
org.openpdf.renderer.pattern.PDFShader
- Direct Known Subclasses:
DummyShader, ShaderType2
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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intprivate PDFPaintthe background colorprivate Rectangle2Dthe bounding box of the patternprivate PDFColorSpacethe colorspacestatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic floatThe tolerance for reevaluating the shading function againprivate final intthe type of the shading (1 through 7) -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the background colorgetBBox()Get the bounding boxGet the color spaceabstract PDFPaintgetPaint()Returns paint that represents the selected shaderstatic PDFShaderParse a pdf shader into a shader objectintgetType()Get the typeabstract voidParse the shader-specific dataprotected voidsetBackground(PDFPaint background) Set the background colorprotected voidsetBBox(Rectangle2D bbox) Set the bounding boxprotected voidsetColorSpace(PDFColorSpace colorSpace) Set the color space
-
Field Details
-
FUNCTION_SHADING
public static final int FUNCTION_SHADING- See Also:
-
AXIAL_SHADING
public static final int AXIAL_SHADING- See Also:
-
RADIAL_SHADING
public static final int RADIAL_SHADING- See Also:
-
FREE_FORM_SHADING
public static final int FREE_FORM_SHADING- See Also:
-
LATTICE_SHADING
public static final int LATTICE_SHADING- See Also:
-
COONS_PATCH_MESH_SHADING
public static final int COONS_PATCH_MESH_SHADING- See Also:
-
TENSOR_PRODUCTS_MESH_SHADING
public static final int TENSOR_PRODUCTS_MESH_SHADING- See Also:
-
TOLERANCE
public static float TOLERANCEThe tolerance for reevaluating the shading function again -
type
private final int typethe type of the shading (1 through 7) -
colorSpace
the colorspace -
background
the background color -
bbox
the bounding box of the pattern
-
-
Constructor Details
-
PDFShader
protected PDFShader(int type) Creates a new instance of PDFShader
-
-
Method Details
-
getShader
Parse a pdf shader into a shader object- Throws:
IOException
-
getType
public int getType()Get the type -
getColorSpace
Get the color space -
setColorSpace
Set the color space -
getBackground
Get the background color -
setBackground
Set the background color -
getBBox
Get the bounding box -
setBBox
Set the bounding box -
parse
Parse the shader-specific data- Throws:
IOException
-
getPaint
Returns paint that represents the selected shader
-