![]() |
#include <GState.h>
Public Types | |
enum | GStateAttribute { e_transform = 0, e_rendering_intent, e_stroke_cs, e_stroke_color, e_fill_cs, e_fill_color, e_line_width, e_line_cap, e_line_join, e_flatness, e_miter_limit, e_dash_pattern, e_char_spacing, e_word_spacing, e_horizontal_scale, e_leading, e_font, e_font_size, e_text_render_mode, e_text_rise, e_text_knockout, e_text_pos_offset, e_blend_mode, e_opacity_fill, e_opacity_stroke, e_alpha_is_shape, e_soft_mask, e_smoothnes, e_auto_stoke_adjust, e_stroke_overprint, e_fill_overprint, e_overprint_mode, e_transfer_funct, e_BG_funct, e_UCR_funct, e_halftone, e_null } |
enum | LineCap { e_butt_cap = 0, e_round_cap, e_square_cap } |
enum | LineJoin { e_miter_join = 0, e_round_join, e_bevel_join } |
enum | TextRenderingMode { e_fill_text = 0, e_stroke_text, e_fill_stroke_text, e_invisible_text, e_fill_clip_text, e_stroke_clip_text, e_fill_stroke_clip_text, e_clip_text } |
enum | RenderingIntent { e_absolute_colorimetric, e_relative_colorimetric, e_saturation, e_perceptual } |
enum | BlendMode { e_bl_compatible = 0, e_bl_normal, e_bl_multiply, e_bl_screen, e_bl_difference, e_bl_darken, e_bl_lighten, e_bl_color_dodge, e_bl_color_burn, e_bl_exclusion, e_bl_hard_light, e_bl_overlay, e_bl_soft_light, e_bl_luminosity, e_bl_hue, e_bl_saturation, e_bl_color } |
Public Member Functions | |
GState () | |
GState (const GState &c) | |
GState & | operator= (const GState &c) |
Common::Matrix2D | GetTransform () |
ColorSpace | GetStrokeColorSpace () |
ColorSpace | GetFillColorSpace () |
ColorPt | GetStrokeColor () |
PatternColor | GetStrokePattern () |
ColorPt | GetFillColor () |
PatternColor | GetFillPattern () |
double | GetFlatness () const |
LineCap | GetLineCap () const |
LineJoin | GetLineJoin () const |
double | GetLineWidth () const |
double | GetMiterLimit () const |
void | GetDashes (std::vector< double > &dashes) const |
double | GetPhase () const |
double | GetCharSpacing () const |
double | GetWordSpacing () const |
double | GetHorizontalScale () const |
double | GetLeading () const |
Font | GetFont () const |
double | GetFontSize () const |
TextRenderingMode | GetTextRenderMode () const |
double | GetTextRise () const |
bool | IsTextKnockout () const |
RenderingIntent | GetRenderingIntent () const |
BlendMode | GetBlendMode () |
double | GetFillOpacity () const |
double | GetStrokeOpacity () const |
bool | GetAISFlag () const |
SDF::Obj | GetSoftMask () |
bool | GetStrokeOverprint () const |
bool | GetFillOverprint () const |
int | GetOverprintMode () const |
bool | GetAutoStrokeAdjust () const |
double | GetSmoothnessTolerance () const |
SDF::Obj | GetTransferFunct () |
SDF::Obj | GetBlackGenFunct () |
SDF::Obj | GetUCRFunct () |
SDF::Obj | GetHalftone () |
void | SetTransform (const Common::Matrix2D &mtx) |
Set the transformation matrix associated with this element. | |
void | SetTransform (double a, double b, double c, double d, double h, double v) |
Sets the transformation matrix for this element. | |
void | Concat (const Common::Matrix2D &mtx) |
Concatenate the given matrix to the transformation matrix of this element. | |
void | Concat (double a, double b, double c, double d, double h, double v) |
void | SetStrokeColorSpace (ColorSpace cs) |
Sets the color space used for stroking operations. | |
void | SetFillColorSpace (ColorSpace cs) |
Sets the color space used for filling operations. | |
void | SetStrokeColor (const ColorPt &c) |
Sets the color value/point used for stroking operations. | |
void | SetStrokeColor (PatternColor pattern) |
Set the stroke color to the given tiling pattern. | |
void | SetStrokeColor (PatternColor pattern, const ColorPt &c) |
Set the stroke color to the given uncolored tiling pattern. | |
void | SetFillColor (const ColorPt &c) |
Sets the color value/point used for filling operations. | |
void | SetFillColor (PatternColor pattern) |
Set the fill color to the given tiling pattern. | |
void | SetFillColor (PatternColor pattern, const ColorPt &c) |
Set the fill color to the given uncolored tiling pattern. | |
void | SetFlatness (double flatness) |
Sets the value of flatness tolerance. | |
void | SetLineCap (LineCap cap) |
Sets LineCap style property. | |
void | SetLineJoin (LineJoin join) |
Sets LineJoin style property. | |
void | SetLineWidth (double width) |
Sets the thickness of the line used to stroke a path. | |
void | SetMiterLimit (double miter_limit) |
Sets miter limit. | |
void | SetDashPattern (const std::vector< double > &dash_array, double phase) |
Sets the dash pattern used to stroke paths. | |
void | SetCharSpacing (double char_spacing) |
Sets character spacing. | |
void | SetWordSpacing (double word_spacing) |
Sets word spacing. | |
void | SetHorizontalScale (double hscale) |
Sets horizontal scale. | |
void | SetLeading (double leading) |
Sets the leading parameter. | |
void | SetFont (Font font, double font_sz) |
Sets the font and font size used to draw text. | |
void | SetTextRenderMode (TextRenderingMode rmode) |
Sets text rendering mode. | |
void | SetTextRise (double rise) |
Sets text rise. | |
void | SetTextKnockout (bool knockout) |
Mark the object as elementary for purposes of color compositing in the transparent imaging model. | |
void | SetRenderingIntent (RenderingIntent intent) |
Sets the color intent to be used for rendering the Element. | |
void | SetBlendMode (BlendMode BM) |
Sets the current blend mode to be used in the transparent imaging model. | |
void | SetFillOpacity (double ca) |
Sets the opacity value for painting operations other than stroking. | |
void | SetStrokeOpacity (double CA) |
Sets opacity value for stroke painting operations for paths and glyph outlines. | |
void | SetAISFlag (bool AIS) |
Specifies if the alpha is to be interpreted as a shape or opacity mask. | |
void | SetSoftMask (SDF::Obj SM) |
Sets the soft mask of the extended graphics state. | |
void | SetStrokeOverprint (bool OP) |
Specifies if overprint is enabled for stroke operations. | |
void | SetFillOverprint (bool op) |
Specifies if overprint is enabled for fill operations. | |
void | SetOverprintMode (int OPM) |
Sets the overprint mode. | |
void | SetAutoStrokeAdjust (bool SA) |
Specify whether to apply automatic stroke adjustment. | |
void | SetSmoothnessTolerance (double SM) |
Sets the smoothness tolerance used to control the quality of smooth shading. | |
void | SetBlackGenFunct (SDF::Obj BG) |
Sets black-generation function used during conversion between DeviceRGB and DeviceCMYK. | |
void | SetUCRFunct (SDF::Obj UCR) |
Sets undercolor-removal function used during conversion between DeviceRGB and DeviceCMYK. | |
void | SetTransferFunct (SDF::Obj TR) |
Sets transfer function used during color conversion process. | |
void | SetHalftone (SDF::Obj HT) |
Static Public Member Functions | |
static RenderingIntent | GetRenderingIntentType (const char *name) |
A utility function that maps a string representing a rendering intent to RenderingIntent type. |
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 | ) |
Common::Matrix2D pdftron::PDF::GState::GetTransform | ( | ) |
ColorSpace pdftron::PDF::GState::GetStrokeColorSpace | ( | ) |
ColorSpace pdftron::PDF::GState::GetFillColorSpace | ( | ) |
ColorPt pdftron::PDF::GState::GetStrokeColor | ( | ) |
PatternColor pdftron::PDF::GState::GetStrokePattern | ( | ) |
ColorPt pdftron::PDF::GState::GetFillColor | ( | ) |
PatternColor pdftron::PDF::GState::GetFillPattern | ( | ) |
double pdftron::PDF::GState::GetFlatness | ( | ) | const |
The flatness tolerance controls the maximum permitted distance in device pixels between the mathematically correct path and an approximation constructed from straight line segments.
LineCap pdftron::PDF::GState::GetLineCap | ( | ) | const |
LineJoin pdftron::PDF::GState::GetLineJoin | ( | ) | const |
double pdftron::PDF::GState::GetLineWidth | ( | ) | const |
double pdftron::PDF::GState::GetMiterLimit | ( | ) | const |
void pdftron::PDF::GState::GetDashes | ( | std::vector< double > & | dashes | ) | const |
double pdftron::PDF::GState::GetPhase | ( | ) | const |
double pdftron::PDF::GState::GetCharSpacing | ( | ) | const |
double pdftron::PDF::GState::GetWordSpacing | ( | ) | const |
double pdftron::PDF::GState::GetHorizontalScale | ( | ) | const |
double pdftron::PDF::GState::GetLeading | ( | ) | const |
Font pdftron::PDF::GState::GetFont | ( | ) | const |
double pdftron::PDF::GState::GetFontSize | ( | ) | const |
TextRenderingMode pdftron::PDF::GState::GetTextRenderMode | ( | ) | const |
double pdftron::PDF::GState::GetTextRise | ( | ) | const |
bool pdftron::PDF::GState::IsTextKnockout | ( | ) | const |
RenderingIntent pdftron::PDF::GState::GetRenderingIntent | ( | ) | const |
static RenderingIntent pdftron::PDF::GState::GetRenderingIntentType | ( | const char * | name | ) | [static] |
A utility function that maps a string representing a rendering intent to RenderingIntent type.
BlendMode pdftron::PDF::GState::GetBlendMode | ( | ) |
double pdftron::PDF::GState::GetFillOpacity | ( | ) | const |
double pdftron::PDF::GState::GetStrokeOpacity | ( | ) | const |
bool pdftron::PDF::GState::GetAISFlag | ( | ) | const |
SDF::Obj pdftron::PDF::GState::GetSoftMask | ( | ) |
bool pdftron::PDF::GState::GetStrokeOverprint | ( | ) | const |
bool pdftron::PDF::GState::GetFillOverprint | ( | ) | const |
int pdftron::PDF::GState::GetOverprintMode | ( | ) | const |
bool pdftron::PDF::GState::GetAutoStrokeAdjust | ( | ) | const |
double pdftron::PDF::GState::GetSmoothnessTolerance | ( | ) | const |
SDF::Obj pdftron::PDF::GState::GetTransferFunct | ( | ) |
SDF::Obj pdftron::PDF::GState::GetBlackGenFunct | ( | ) |
SDF::Obj pdftron::PDF::GState::GetUCRFunct | ( | ) |
SDF::Obj pdftron::PDF::GState::GetHalftone | ( | ) |
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 | |||
) |
Sets the transformation matrix for this element.
This method accepts text transformation matrix components directly.
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 | - vertical 'scaling' component of the new text matrix. | |
d | - 'rotation' 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::Concat | ( | const Common::Matrix2D & | mtx | ) |
Concatenate the given matrix to the transformation matrix of this element.
void pdftron::PDF::GState::Concat | ( | double | a, | |
double | b, | |||
double | c, | |||
double | d, | |||
double | h, | |||
double | v | |||
) |
void pdftron::PDF::GState::SetStrokeColorSpace | ( | ColorSpace | cs | ) |
Sets the color space used for stroking operations.
void pdftron::PDF::GState::SetFillColorSpace | ( | ColorSpace | cs | ) |
Sets the color space used for filling operations.
void pdftron::PDF::GState::SetStrokeColor | ( | const ColorPt & | c | ) |
Sets the color value/point used for stroking operations.
The color value must be represented in the currently selected color space used for stroking.
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.
SDF | pattern (PatternType = 1 and PaintType = 2) object. | |
c | is a color in the pattern’s underlying color space. |
void pdftron::PDF::GState::SetFillColor | ( | const ColorPt & | c | ) |
Sets the color value/point 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.
SDF | pattern (PatternType = 1 and PaintType = 2) object. | |
c | is a color in the pattern’s underlying color space. |
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. |
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::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 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::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::SetWordSpacing | ( | double | word_spacing | ) |
Sets word spacing.
word_spacing | - a number specified in unscaled text space units. Word spacing works the same way as character spacing, but applies only to the space character (char code 32). See Section 5.2.2 in PDF Reference Manual for details. |
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.
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.
void pdftron::PDF::GState::SetFont | ( | Font | font, | |
double | font_sz | |||
) |
Sets the font and font size used to draw text.
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
void pdftron::PDF::GState::SetTextKnockout | ( | bool | knockout | ) |
Mark the object as elementary for purposes of color compositing in the transparent imaging model.
void pdftron::PDF::GState::SetRenderingIntent | ( | RenderingIntent | intent | ) |
Sets the color intent to be used for rendering the Element.
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. |
// C# gs.SetBlendMode(GState.BlendMode.e_lighten); // C++ gs->SetBlendMode(GState::e_lighten);
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.
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.
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).
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.
BG | - SDF/Cos black-generation function or name |
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.
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.
void pdftron::PDF::GState::SetOverprintMode | ( | int | OPM | ) |
Sets the overprint mode.
Corresponds to the /OPM key within the ExtGState's dictionary.
void pdftron::PDF::GState::SetAutoStrokeAdjust | ( | bool | SA | ) |
Specify whether to apply automatic stroke adjustment.
Corresponds to the /SA key within the ExtGState's dictionary.
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::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::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::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::SetHalftone | ( | SDF::Obj | HT | ) |
HT | - SDF/Cos halftone dictionary, stream, or name |