com.pdftron.pdf
Class PatternColor

java.lang.Object
  extended by com.pdftron.pdf.PatternColor

public class PatternColor
extends java.lang.Object

Patterns are quite general, and have many uses; for example, they can be used to create various graphical textures, such as weaves, brick walls, sunbursts, and similar geometrical and chromatic effects. Patterns are specified in a special family of color spaces named Pattern, whose 'color values' are PatternColor objects instead of the numeric component values used with other spaces. Therefore PatternColor is to pattern color space what is ColorPt to all other color spaces. A tiling pattern consists of a small graphical figure called a pattern cell. Painting with the pattern replicates the cell at fixed horizontal and vertical intervals to fill an area. The effect is as if the figure were painted on the surface of a clear glass tile, identical copies of which were then laid down in an array covering the area and trimmed to its boundaries. This is called tiling the area. The pattern cell can include graphical elements such as filled areas, text, and sampled images. Its shape need not be rectangular, and the spacing of tiles can differ from the dimensions of the cell itself. The order in which individual tiles (instances of the cell) are painted is unspecified and unpredictable; it is inadvisable for the figures on adjacent tiles to overlap.


Field Summary
static int e_colored_tiling_pattern
          The Constant e_colored_tiling_pattern.
static int e_constant_spacing
          The Constant e_constant_spacing.
static int e_constant_spacing_fast_fill
          The Constant e_constant_spacing_fast_fill.
static int e_no_distortion
          The Constant e_no_distortion.
static int e_null
          The Constant e_null.
static int e_shading
          The Constant e_shading.
static int e_uncolored_tiling_pattern
          The Constant e_uncolored_tiling_pattern.
 
Constructor Summary
PatternColor(Obj pattern)
          Create a PatternColor from the given SDF/Cos object listed under Pattern entry in page Resource dictionary.
 
Method Summary
 Rect getBBox()
          Get the bounding box.
 Matrix2D getMatrix()
          Get the matrix.
 Obj getSDFObj()
          Get the SDFObj.
 Shading getShading()
          Get the shading pattern's gradient fill.
 int getTilingType()
          Get the PatternColor tiling type.
 int getType()
          Get the PatternColor type.
static int getType(Obj pattern)
          Get the type from given PatternColor
 double getXStep()
          Get the horizontal spacing between pattern cells
 double getYStep()
          Get the vertical spacing between pattern cells
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

e_uncolored_tiling_pattern

public static final int e_uncolored_tiling_pattern
The Constant e_uncolored_tiling_pattern.

See Also:
Constant Field Values

e_colored_tiling_pattern

public static final int e_colored_tiling_pattern
The Constant e_colored_tiling_pattern.

See Also:
Constant Field Values

e_shading

public static final int e_shading
The Constant e_shading.

See Also:
Constant Field Values

e_null

public static final int e_null
The Constant e_null.

See Also:
Constant Field Values

e_constant_spacing

public static final int e_constant_spacing
The Constant e_constant_spacing.

See Also:
Constant Field Values

e_no_distortion

public static final int e_no_distortion
The Constant e_no_distortion.

See Also:
Constant Field Values

e_constant_spacing_fast_fill

public static final int e_constant_spacing_fast_fill
The Constant e_constant_spacing_fast_fill.

See Also:
Constant Field Values
Constructor Detail

PatternColor

public PatternColor(Obj pattern)
Create a PatternColor from the given SDF/Cos object listed under Pattern entry in page Resource dictionary.

Parameters:
pattern - the pattern
Method Detail

getType

public static int getType(Obj pattern)
                   throws PDFNetException
Get the type from given PatternColor

Parameters:
pattern - the given PatternColor
Returns:
The Type of a given SDF/Cos color space, or e_null for if SDF object is not a valid pattern object
Throws:
PDFNetException

getType

public int getType()
            throws PDFNetException
Get the PatternColor type.

Returns:
the PatternColor type
Throws:
PDFNetException

getSDFObj

public Obj getSDFObj()
              throws PDFNetException
Get the SDFObj.

Returns:
the underlying SDF/Cos object
Throws:
PDFNetException

getMatrix

public Matrix2D getMatrix()
                   throws PDFNetException
Get the matrix.

Returns:
pattern matrix, a transformation matrix that maps the pattern's internal coordinate system to the default coordinate system of the pattern's parent content stream (the content stream in which the pattern is defined as a resource). The concatenation of the pattern matrix with that of the parent content stream establishes the pattern coordinate space, within which all graphics objects in the pattern are interpreted.
Throws:
PDFNetException

getShading

public Shading getShading()
                   throws PDFNetException
Get the shading pattern's gradient fill.

Note: for patterns other than Shading this method throws an exception.

Returns:
The shading object defining the shading pattern's gradient fill.
Throws:
PDFNetException

getTilingType

public int getTilingType()
                  throws PDFNetException
Get the PatternColor tiling type.

Note: for patterns other than Tiling this method throws an exception.

Returns:
the tiling type identifier that controls adjustments to the spacing of tiles relative to the device pixel grid:
Throws:
PDFNetException

getBBox

public Rect getBBox()
             throws PDFNetException
Get the bounding box.

Note: for patterns other than Tiling this method throws an exception.

Returns:
A rectangle in the pattern coordinate system giving the coordinates of the left, bottom, right, and top edges, respectively, of the pattern cell's bounding box. These boundaries are used to clip the pattern cell.
Throws:
PDFNetException

getXStep

public double getXStep()
                throws PDFNetException
Get the horizontal spacing between pattern cells

Note: that XStep and YStep may differ from the dimensions of the pattern cell implied by the BBox entry. This allows tiling with irregularly shaped figures. XStep and YStep may be either positive or negative, but not zero.

Note: for patterns other than Tiling this method throws an exception.

Returns:
the desired horizontal spacing between pattern cells, measured in the pattern coordinate system.
Throws:
PDFNetException

getYStep

public double getYStep()
                throws PDFNetException
Get the vertical spacing between pattern cells

Note: for patterns other than Tiling this method throws an exception.

Returns:
the desired vertical spacing between pattern cells, measured in the pattern coordinate system.
Throws:
PDFNetException


© 2002-2018 PDFTron Systems Inc.