Click or drag to resize

Shading Class

Shading is a class that represents a flat interface around all PDF shading types:
  • In Function-based (type 1) shadings, the color at every point in the domain is defined by a specified mathematical function. The function need not be smooth or continuous. This is the most general of the available shading types, and is useful for shadings that cannot be adequately described with any of the other types.
  • Axial shadings (type 2) define a color blend along a line between two points, optionally extended beyond the boundary points by continuing the boundary colors.
  • Radial shadings (type 3) define a color blend that varies between two circles. Shadings of this type are commonly used to depict three-dimensional spheres and cones.
  • Free-form Gouraud-shaded triangle mesh shadings (type 4) and lattice gouraud shadings (type 5) are commonly used to represent complex colored and shaded three-dimensional shapes. The area to be shaded is defined by a path composed entirely of triangles. The color at each vertex of the triangles is specified, and a technique known as Gouraud interpolation is used to color the interiors. The interpolation functions defining the shading may be linear or nonlinear.
Coons patch mesh shadings (type 6) are constructed from one or more color patches, each bounded by four cubic Bézier curves. A Coons patch generally has two independent aspects:
  • Colors are specified for each corner of the unit square, and bilinear interpolation is used to fill in colors over the entire unit square
  • Coordinates are mapped from the unit square into a four-sided patch whose sides are not necessarily linear. The mapping is continuous: the corners of the unit square map to corners of the patch and the sides of the unit square map to sides of the patch.
  • Tensor-product patch mesh shadings (type 7) are identical to type 6 (Coons mesh), except that they are based on a bicubic tensor-product patch defined by 16 control points, instead of the 12 control points that define a Coons patch. The shading Patterns dictionaries representing the two patch types differ only in the value of the Type entry and in the number of control points specified for each patch in the data stream. Although the Coons patch is more concise and easier to use, the tensor- product patch affords greater control over color mapping.
Inheritance Hierarchy

Namespace:  pdftron.PDF
Assembly:  pdftron (in pdftron.dll) Version:
public sealed class Shading : IClosable

The Shading type exposes the following members.

Public methodShading
Create a Shading from the given SDF/Cos object listed under /Shading entry in the page Resource dictionary.
Public methodClose
Public methodStatic memberCreate
Create a Shading from the given SDF/Cos object listed under /Shading entry in the page Resource dictionary.
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodGetAntialias
Gets the antialias.
Public methodGetBackground
An color point represented in base color space specifying a single background color value. If present, this color is used before any painting operation involving the shading, to fill those portions of the area to be painted that lie outside the bounds of the shading object itself. In the opaque imaging model, the effect is as if the painting operation were performed twice: first with the background color and then again with the shading.
Public methodGetBaseColorSpace
Gets the base color space.
Public methodGetBBox
Gets the bounding box.
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetSDFObj
Gets the SDFObj.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodStatic memberGetType(Obj)
Gets shading type from shading dictionary.
Public methodHasBackground
Checks for background.
Public methodHasBBox
Checks for bounding box.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
See Also