Loading...
Searching...
No Matches
pdftron::PDF::PatternColor Class Reference

`#include <PatternColor.h>`

## Public Types
enum | Type { e_uncolored_tiling_pattern , e_colored_tiling_pattern , e_shading , e_null }
enum | TilingType { e_constant_spacing , e_no_distortion , e_constant_spacing_fast_fill }

## Public Member Functions
| PatternColor (SDF::Obj pattern)
| PatternColor (const PatternColor &)
PatternColor & | operator= (const PatternColor &)
| ~PatternColor ()
Type | GetType () const
SDF::Obj | GetSDFObj ()
Common::Matrix2D | GetMatrix ()
Shading | GetShading ()
TilingType | GetTilingType () const
Rect | GetBBox ()
double | GetXStep ()
double | GetYStep ()
void | Destroy ()

## Detailed Description

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.

Definition at line 42 of file PatternColor.h.

## Member Enumeration Documentation

## ◆ TilingType

enum pdftron::PDF::PatternColor::TilingType

Enumerator
e_constant_spacing |
e_no_distortion |
e_constant_spacing_fast_fill |

Definition at line 100 of file PatternColor.h.

## ◆ Type

enum pdftron::PDF::PatternColor::Type

Enumerator
e_uncolored_tiling_pattern |
e_colored_tiling_pattern |
e_shading |
e_null |

Definition at line 59 of file PatternColor.h.

## Constructor & Destructor Documentation

## ◆ PatternColor() [1/2]

pdftron::PDF::PatternColor::PatternColor | ( | SDF::Obj | pattern | ) |

Create a PatternColor from the given SDF/Cos object listed under Pattern entry in page Resource dictionary

## ◆ PatternColor() [2/2]

pdftron::PDF::PatternColor::PatternColor | ( | const PatternColor & |  | ) |

## ◆ ~PatternColor()

pdftron::PDF::PatternColor::~PatternColor | ( |  | ) |

## Member Function Documentation

## ◆ Destroy()

void pdftron::PDF::PatternColor::Destroy | ( |  | ) |

Frees the native memory of the object.

## ◆ GetBBox()

Rect pdftron::PDF::PatternColor::GetBBox | ( |  | ) |

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.

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

## ◆ GetMatrix()

Common::Matrix2D pdftron::PDF::PatternColor::GetMatrix | ( |  | ) |

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.

## ◆ GetSDFObj()

SDF::Obj pdftron::PDF::PatternColor::GetSDFObj | ( |  | ) |

Returns
  the underlying SDF/Cos object

## ◆ GetShading()

Shading pdftron::PDF::PatternColor::GetShading | ( |  | ) |

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

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

## ◆ GetTilingType()

TilingType pdftron::PDF::PatternColor::GetTilingType | ( |  | ) | const

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

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

## ◆ GetType()

Type pdftron::PDF::PatternColor::GetType | ( |  | ) | const

Returns
  The pattern type

## ◆ GetXStep()

double pdftron::PDF::PatternColor::GetXStep | ( |  | ) |

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

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.
  for patterns other than Tiling this method throws an exception.

## ◆ GetYStep()

double pdftron::PDF::PatternColor::GetYStep | ( |  | ) |

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

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

## ◆ operator=()

PatternColor & pdftron::PDF::PatternColor::operator= | ( | const PatternColor & |  | ) |

The documentation for this class was generated from the following file:

- PDF/PatternColor.h