#include <GState.h>
Static Public Member Functions | |
static RenderingIntent | GetRenderingIntentType (const char *name) |
GState is a class that keeps track of a number of style attributes used to visually define graphical Elements. Each PDF::Element has an associated GState that can be used to query or set various graphics properties.
pdftron::PDF::GState::GState | ( | ) |
pdftron::PDF::GState::GState | ( | const GState & | c | ) |
void pdftron::PDF::GState::Concat | ( | const Common::Matrix2D & | mtx | ) |
Concatenate the given matrix to the transformation matrix of this element.
mtx | Matrix2D object to concatenate the current matrix with. |
void pdftron::PDF::GState::Concat | ( | double | a, |
double | b, | ||
double | c, | ||
double | d, | ||
double | h, | ||
double | v | ||
) |
Concatenate the given matrix expressed in its values to the transformation matrix of this element.
a | - horizontal 'scaling' component of the new text matrix. |
b | - 'rotation' component of the new text matrix. |
c | - 'rotation' component of the new text matrix. |
d | - vertical 'scaling' component of the new text matrix. |
h | - horizontal translation component of the new text matrix. |
v | - vertical translation component of the new text matrix. |
bool pdftron::PDF::GState::GetAISFlag | ( | ) | const |
bool pdftron::PDF::GState::GetAutoStrokeAdjust | ( | ) | const |
SDF::Obj pdftron::PDF::GState::GetBlackGenFunct | ( | ) |
BlendMode pdftron::PDF::GState::GetBlendMode | ( | ) |
double pdftron::PDF::GState::GetCharSpacing | ( | ) | const |
The character spacing parameter is a number specified in unscaled text space units. When the glyph for each character in the string is rendered, the character spacing is added to the horizontal or vertical component of the glyph's displacement, depending on the writing mode. See Section 5.2.1 in PDF Reference Manual for details.
std::vector<double> pdftron::PDF::GState::GetDashes | ( | ) | const |
The line dash pattern controls the pattern of dashes and gaps used to stroke paths. It is specified by a dash array and a dash phase. The dash array's elements are numbers that specify the lengths of alternating dashes and gaps; the dash phase specifies the distance into the dash pattern at which to start the dash. The elements of both the dash array and the dash phase are expressed in user space units.
void pdftron::PDF::GState::GetDashes | ( | std::vector< double > & | dashes | ) | const |
ColorPt pdftron::PDF::GState::GetFillColor | ( | ) |
ColorSpace pdftron::PDF::GState::GetFillColorSpace | ( | ) |
double pdftron::PDF::GState::GetFillOpacity | ( | ) | const |
bool pdftron::PDF::GState::GetFillOverprint | ( | ) | const |
PatternColor pdftron::PDF::GState::GetFillPattern | ( | ) |
double pdftron::PDF::GState::GetFlatness | ( | ) | const |
Flatness is a number in the range 0 to 100; a value of 0 specifies the output device's default flatness tolerance.
The flatness tolerance controls the maximum permitted distance in device pixels between the mathematically correct path and an approximation constructed from straight line segments.
Font pdftron::PDF::GState::GetFont | ( | ) | const |
double pdftron::PDF::GState::GetFontSize | ( | ) | const |
SDF::Obj pdftron::PDF::GState::GetHalftone | ( | ) |
double pdftron::PDF::GState::GetHorizontalScale | ( | ) | const |
The horizontal scaling parameter adjusts the width of glyphs by stretching or compressing them in the horizontal direction. Its value is specified as a percentage of the normal width of the glyphs, with 100 being the normal width. The scaling always applies to the horizontal coordinate in text space, independently of the writing mode. See Section 5.2.3 in PDF Reference Manual for details.
double pdftron::PDF::GState::GetLeading | ( | ) | const |
The leading parameter is measured in unscaled text space units. It specifies the vertical distance between the baselines of adjacent lines of text. See Section 5.2.4 in PDF Reference Manual for details.
LineCap pdftron::PDF::GState::GetLineCap | ( | ) | const |
The line cap style specifies the shape to be used at the ends of open sub-paths (and dashes, if any) when they are stroked.
LineJoin pdftron::PDF::GState::GetLineJoin | ( | ) | const |
The line join style specifies the shape to be used at the corners of paths that are stroked.
double pdftron::PDF::GState::GetLineWidth | ( | ) | const |
double pdftron::PDF::GState::GetMiterLimit | ( | ) | const |
The miter limit imposes a maximum on the ratio of the miter length to the line width. When the limit is exceeded, the join is converted from a miter to a bevel.
int pdftron::PDF::GState::GetOverprintMode | ( | ) | const |
double pdftron::PDF::GState::GetPhase | ( | ) | const |
RenderingIntent pdftron::PDF::GState::GetRenderingIntent | ( | ) | const |
|
static |
A utility function that maps a string representing a rendering intent to RenderingIntent type.
name | string that represents the rendering intent to get. |
double pdftron::PDF::GState::GetSmoothnessTolerance | ( | ) | const |
SDF::Obj pdftron::PDF::GState::GetSoftMask | ( | ) |
Common::Matrix2D pdftron::PDF::GState::GetSoftMaskTransform | ( | ) |
ColorPt pdftron::PDF::GState::GetStrokeColor | ( | ) |
ColorSpace pdftron::PDF::GState::GetStrokeColorSpace | ( | ) |
double pdftron::PDF::GState::GetStrokeOpacity | ( | ) | const |
bool pdftron::PDF::GState::GetStrokeOverprint | ( | ) | const |
PatternColor pdftron::PDF::GState::GetStrokePattern | ( | ) |
TextRenderingMode pdftron::PDF::GState::GetTextRenderMode | ( | ) | const |
The text rendering mode determines whether showing text causes glyph outlines to be stroked, filled, used as a clipping boundary, or some combination of the three. See Section 5.2.5 in PDF Reference Manual for details..
double pdftron::PDF::GState::GetTextRise | ( | ) | const |
Text rise specifies the distance, in unscaled text space units, to move the baseline up or down from its default location. Positive values of text rise move the baseline up
SDF::Obj pdftron::PDF::GState::GetTransferFunct | ( | ) |
Common::Matrix2D pdftron::PDF::GState::GetTransform | ( | ) |
SDF::Obj pdftron::PDF::GState::GetUCRFunct | ( | ) |
double pdftron::PDF::GState::GetWordSpacing | ( | ) | const |
bool pdftron::PDF::GState::IsTextKnockout | ( | ) | const |
void pdftron::PDF::GState::SetAISFlag | ( | bool | AIS | ) |
Specifies if the alpha is to be interpreted as a shape or opacity mask. The alpha source flag ('alpha is shape'), specifies whether the current soft mask and alpha constant are to be interpreted as shape values (true) or opacity values (false).
AIS | true for interpretation as shape values or false for opacity values |
void pdftron::PDF::GState::SetAutoStrokeAdjust | ( | bool | SA | ) |
Specify whether to apply automatic stroke adjustment. Corresponds to the /SA key within the ExtGState's dictionary.
SA | if true automatic stroke adjustment will be applied. |
void pdftron::PDF::GState::SetBlackGenFunct | ( | SDF::Obj | BG | ) |
Sets black-generation function used during conversion between DeviceRGB and DeviceCMYK. Corresponds to the /BG key within the ExtGState's dictionary.
BG | - SDF/Cos black-generation function or name |
void pdftron::PDF::GState::SetBlendMode | ( | BlendMode | BM | ) |
Sets the current blend mode to be used in the transparent imaging model. Corresponds to the /BM key within the ExtGState's dictionary.
BM | - New blending mode type. |
void pdftron::PDF::GState::SetCharSpacing | ( | double | char_spacing | ) |
Sets character spacing.
char_spacing | a number specified in unscaled text space units. When the glyph for each character in the string is rendered, the character spacing is added to the horizontal or vertical component of the glyph's displacement, depending on the writing mode. See Section 5.2.1 in PDF Reference Manual for details. |
void pdftron::PDF::GState::SetDashPattern | ( | const std::vector< double > & | dash_array, |
double | phase | ||
) |
Sets the dash pattern used to stroke paths. The line dash pattern controls the pattern of dashes and gaps used to stroke paths. It is specified by a dash array and a dash phase. The elements of both the dash array and the dash phase are expressed in user space units.
dash_array | the numbers that specify the lengths of alternating dashes and gaps. |
phase | specifies the distance into the dash pattern at which to start the dash. |
void pdftron::PDF::GState::SetFillColor | ( | const ColorPt & | c | ) |
Sets the color value/point used for filling operations.
c | the color used for filling operations The color value must be represented in the currently selected color space used for filling. |
void pdftron::PDF::GState::SetFillColor | ( | PatternColor | pattern | ) |
Set the fill color to the given tiling pattern.
pattern | New pattern color. |
void pdftron::PDF::GState::SetFillColor | ( | PatternColor | pattern, |
const ColorPt & | c | ||
) |
Set the fill color to the given uncolored tiling pattern.
pattern | PatternColor (PatternType = 1 and PaintType = 2) object. |
c | is a color in the pattern's underlying color space. |
void pdftron::PDF::GState::SetFillColorSpace | ( | ColorSpace | cs | ) |
Sets the color space used for filling operations
cs | ColorSpace object to use for filling operations |
void pdftron::PDF::GState::SetFillOpacity | ( | double | ca | ) |
Sets the opacity value for painting operations other than stroking. Corresponds to the value of the /ca key in the ExtGState dictionary.
ca | value to set fill opacity to |
void pdftron::PDF::GState::SetFillOverprint | ( | bool | op | ) |
Specifies if overprint is enabled for fill operations. Corresponds to the /op key within the ExtGState's dictionary.
op | true to enable overprint for fill, false to disable. |
void pdftron::PDF::GState::SetFlatness | ( | double | flatness | ) |
Sets the value of flatness tolerance.
flatness | is a number in the range 0 to 100; a value of 0 specifies the output device's default flatness tolerance. |
The flatness tolerance controls the maximum permitted distance in device pixels between the mathematically correct path and an approximation constructed from straight line segments.
void pdftron::PDF::GState::SetFont | ( | Font | font, |
double | font_sz | ||
) |
Sets the font and font size used to draw text.
font | Font to draw the text with |
font_sz | size of the font to draw the text with |
void pdftron::PDF::GState::SetHalftone | ( | SDF::Obj | HT | ) |
Sets currently selected halftone dictionary or stream (NULL by default). Corresponds to the /HT key within the ExtGState's dictionary. Halftoning is a process by which continuous-tone colors are approximated on an output device that can achieve only a limited number of discrete colors.
HT | - SDF/Cos halftone dictionary, stream, or name |
void pdftron::PDF::GState::SetHorizontalScale | ( | double | hscale | ) |
Sets horizontal scale. The horizontal scaling parameter adjusts the width of glyphs by stretching or compressing them in the horizontal direction. Its value is specified as a percentage of the normal width of the glyphs, with 100 being the normal width. The scaling always applies to the horizontal coordinate in text space, independently of the writing mode. See Section 5.2.3 in PDF Reference Manual for details.
hscale | value to set horizontal scale to. |
void pdftron::PDF::GState::SetLeading | ( | double | leading | ) |
Sets the leading parameter.
The leading parameter is measured in unscaled text space units. It specifies the vertical distance between the baselines of adjacent lines of text. See Section 5.2.4 in PDF Reference Manual for details.
leading | number representing vertical distance between lines of text |
void pdftron::PDF::GState::SetLineCap | ( | LineCap | cap | ) |
Sets LineCap style property.
The line cap style specifies the shape to be used at the ends of open subpaths (and dashes, if any) when they are stroked.
void pdftron::PDF::GState::SetLineJoin | ( | LineJoin | join | ) |
Sets LineJoin style property.
The line join style specifies the shape to be used at the corners of paths that are stroked.
void pdftron::PDF::GState::SetLineWidth | ( | double | width | ) |
Sets the thickness of the line used to stroke a path.
width | a non-negative number expressed in user space units. A line width of 0 denotes the thinnest line that can be rendered at device resolution: 1 device pixel wide. |
void pdftron::PDF::GState::SetMiterLimit | ( | double | miter_limit | ) |
Sets miter limit.
miter_limit | A number that imposes a maximum on the ratio of the miter length to the line width. When the limit is exceeded, the join is converted from a miter to a bevel. |
void pdftron::PDF::GState::SetOverprintMode | ( | int | OPM | ) |
Sets the overprint mode. Corresponds to the /OPM key within the ExtGState's dictionary.
OPM | overprint mode. |
void pdftron::PDF::GState::SetRenderingIntent | ( | RenderingIntent | intent | ) |
Sets the color intent to be used for rendering the Element.
void pdftron::PDF::GState::SetSmoothnessTolerance | ( | double | SM | ) |
Sets the smoothness tolerance used to control the quality of smooth shading. Corresponds to the /SM key within the ExtGState's dictionary.
void pdftron::PDF::GState::SetSoftMask | ( | SDF::Obj | SM | ) |
Sets the soft mask of the extended graphics state. Corresponds to the /SMask key within the ExtGState's dictionary.
SM | - SDF/Cos black-generation function or name |
void pdftron::PDF::GState::SetStrokeColor | ( | const ColorPt & | c | ) |
Sets the color value/point used for stroking operations.
c | is the color used for stroking operations |
void pdftron::PDF::GState::SetStrokeColor | ( | PatternColor | pattern | ) |
Set the stroke color to the given tiling pattern.
pattern | SDF pattern object. |
void pdftron::PDF::GState::SetStrokeColor | ( | PatternColor | pattern, |
const ColorPt & | c | ||
) |
Set the stroke color to the given uncolored tiling pattern.
pattern | pattern (PatternType = 1 and PaintType = 2) object. |
c | is a color in the pattern's underlying color space. |
void pdftron::PDF::GState::SetStrokeColorSpace | ( | ColorSpace | cs | ) |
Sets the color space used for stroking operations
cs | ColorSpace object to use for stroking operations |
void pdftron::PDF::GState::SetStrokeOpacity | ( | double | ca | ) |
Sets opacity value for stroke painting operations for paths and glyph outlines. Corresponds to the value of the /CA key in the ExtGState dictionary.
ca | value to set stroke opacity to |
void pdftron::PDF::GState::SetStrokeOverprint | ( | bool | OP | ) |
Specifies if overprint is enabled for stroke operations. Corresponds to the /OP key within the ExtGState's dictionary.
OP | true to enable overprint for stroke, false to disable. |
void pdftron::PDF::GState::SetTextKnockout | ( | bool | knockout | ) |
Mark the object as elementary for purposes of color compositing in the transparent imaging model.
knockout | Whether an object is elementary or not. |
void pdftron::PDF::GState::SetTextRenderMode | ( | TextRenderingMode | rmode | ) |
Sets text rendering mode. The text rendering mode determines whether showing text causes glyph outlines to be stroked, filled, used as a clipping boundary, or some combination of the three. See Section 5.2.5 in PDF Reference Manual for details..
void pdftron::PDF::GState::SetTextRise | ( | double | rise | ) |
Sets text rise. Text rise specifies the distance, in unscaled text space units, to move the baseline up or down from its default location. Positive values of text rise move the baseline up
rise | distance to move baseline up. Negative values move baseline down. |
void pdftron::PDF::GState::SetTransferFunct | ( | SDF::Obj | TR | ) |
Sets transfer function used during color conversion process. A transfer function adjusts the values of color components to compensate for nonlinear response in an output device and in the human eye. Corresponds to the /TR key within the ExtGState's dictionary.
TR | - SDF/Cos transfer function, array, or name |
void pdftron::PDF::GState::SetTransform | ( | const Common::Matrix2D & | mtx | ) |
Set the transformation matrix associated with this element.
mtx | The new transformation for this text element. |
void pdftron::PDF::GState::SetTransform | ( | double | a, |
double | b, | ||
double | c, | ||
double | d, | ||
double | h, | ||
double | v | ||
) |
Set the transformation matrix associated with this element.
A transformation matrix in PDF is specified by six numbers, usually in the form of an array containing six elements. In its most general form, this array is denoted [a b c d h v]; it can represent any linear transformation from one coordinate system to another. For more information about PDF matrices please refer to section 4.2.2 'Common Transformations' in PDF Reference Manual, and to documentation for pdftron::Common::Matrix2D class.
a | - horizontal 'scaling' component of the new text matrix. |
b | - 'rotation' component of the new text matrix. |
c | - 'rotation' component of the new text matrix. |
d | - vertical 'scaling' component of the new text matrix. |
h | - horizontal translation component of the new text matrix. |
v | - vertical translation component of the new text matrix. |
void pdftron::PDF::GState::SetUCRFunct | ( | SDF::Obj | UCR | ) |
Sets undercolor-removal function used during conversion between DeviceRGB and DeviceCMYK. Corresponds to the /UCR key within the ExtGState's dictionary.
UCR | - SDF/Cos undercolor-removal function or name |
void pdftron::PDF::GState::SetWordSpacing | ( | double | word_spacing | ) |