Class PDFShader
- Direct Known Subclasses:
DummyShader
,ShaderType2
,ShaderType3
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:
Function-based shadings (type 1) define the color of every point in the domain using a mathematical function (not necessarily smooth or continuous).
Axial shadings (type 2) define a color blend along a pne between two points, optionally extended beyond the boundary points by continuing the boundary colors.
Radial shadings (type 3) define a blend between two circles, optionally extended beyond the boundary circles by continuing the boundary colors. This type of shading is commonly used to represent three-dimensional spheres and cones.
Free-form Gouraud-shaded triangle meshes (type 4) define a common construct used by many three-dimensional apppcations to represent complex colored and shaded shapes. Vertices are specified in free-form geometry.
Lattice-form Gouraud-shaded triangle meshes (type 5) are based on the same geometrical construct as type 4 but with vertices specified as a pseudorectangular lattice.
Coons patch meshes (type 6) construct a shading from one or more color patches, each bounded by four cubic Bézier curves.
Tensor-product patch meshes (type 7) are similar to type 6 but with additional control points in each patch, affording greater control over color mapping.
Table 4.28 shows the entries that all shading dictionaries share in common; entries specific to particular shading types are described in the relevant sections below.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
ConstantAXIAL_SHADING=2
static final int
ConstantCOONS_PATCH_MESH_SHADING=6
static final int
ConstantFREE_FORM_SHADING=4
static final int
ConstantFUNCTION_SHADING=1
static final int
ConstantLATTICE_SHADING=5
static final int
ConstantRADIAL_SHADING=3
static final int
ConstantTENSOR_PRODUCTS_MESH_SHADING=7
static final float
The tolerance for reevaluating the shading function again -
Constructor Summary
-
Method Summary
-
Field Details
-
FUNCTION_SHADING
public static final int FUNCTION_SHADINGConstantFUNCTION_SHADING=1
- See Also:
-
AXIAL_SHADING
public static final int AXIAL_SHADINGConstantAXIAL_SHADING=2
- See Also:
-
RADIAL_SHADING
public static final int RADIAL_SHADINGConstantRADIAL_SHADING=3
- See Also:
-
FREE_FORM_SHADING
public static final int FREE_FORM_SHADINGConstantFREE_FORM_SHADING=4
- See Also:
-
LATTICE_SHADING
public static final int LATTICE_SHADINGConstantLATTICE_SHADING=5
- See Also:
-
COONS_PATCH_MESH_SHADING
public static final int COONS_PATCH_MESH_SHADINGConstantCOONS_PATCH_MESH_SHADING=6
- See Also:
-
TENSOR_PRODUCTS_MESH_SHADING
public static final int TENSOR_PRODUCTS_MESH_SHADINGConstantTENSOR_PRODUCTS_MESH_SHADING=7
- See Also:
-
TOLERANCE
public static final float TOLERANCEThe tolerance for reevaluating the shading function again- See Also:
-
-
Constructor Details
-
PDFShader
protected PDFShader(int type) Creates a new instance of PDFShader- Parameters:
type
- aInteger
object.
-
-
Method Details
-
getShader
Parse a pdf shader into a shader object- Parameters:
shaderObj
- aPDFObject
object.resources
- aMap
object.- Returns:
- a
PDFShader
object. - Throws:
IOException
- if any.
-
parse
Parse the shader-specific data- Parameters:
shareObj
- aPDFObject
object.- Throws:
IOException
- if any.
-
getPaint
Returns paint that represents the selected shader- Returns:
- a
PDFPaint
object.
-