|
#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 () |
| |
| SDF::Obj | GetStrokePattern () |
| |
| ColorPt | GetFillColor () |
| |
| SDF::Obj | 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 (SDF::Obj pattern) |
| Set the stroke color to the given tiling pattern. | |
| void | SetStrokeColor (SDF::Obj 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 (SDF::Obj pattern) |
| Set the fill color to the given tiling pattern. | |
| void | SetFillColor (SDF::Obj 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 | ( | ) |
| SDF::Obj pdftron::PDF::GState::GetStrokePattern | ( | ) |
| ColorPt pdftron::PDF::GState::GetFillColor | ( | ) |
| SDF::Obj 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.
| 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.
| void pdftron::PDF::GState::GetDashes | ( | std::vector< double > & | dashes | ) | 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.
| double pdftron::PDF::GState::GetPhase | ( | ) | const |
dash phase is expressed in user space units.
| 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.
| double pdftron::PDF::GState::GetWordSpacing | ( | ) | const |
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.
| 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.
| Font pdftron::PDF::GState::GetFont | ( | ) | const |
| double pdftron::PDF::GState::GetFontSize | ( | ) | const |
| 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
| 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 | ( | ) |
Corresponds to the /BM key within the ExtGState's dictionary.
| double pdftron::PDF::GState::GetFillOpacity | ( | ) | const |
Returns the value of the /ca key in the ExtGState dictionary. If the value is not found, the default value of 1 is returned.
| double pdftron::PDF::GState::GetStrokeOpacity | ( | ) | const |
Returns the value of the /CA key in the ExtGState dictionary. If the value is not found, the default value of 1 is returned.
| bool pdftron::PDF::GState::GetAISFlag | ( | ) | const |
| SDF::Obj pdftron::PDF::GState::GetSoftMask | ( | ) |
NULL if the soft mask is not selected or SDF dictionary representing the soft mask otherwise.
| bool pdftron::PDF::GState::GetStrokeOverprint | ( | ) | const |
Corresponds to the /OP key within the ExtGState's dictionary.
| bool pdftron::PDF::GState::GetFillOverprint | ( | ) | const |
Corresponds to the /op key within the ExtGState's dictionary.
| int pdftron::PDF::GState::GetOverprintMode | ( | ) | const |
Corresponds to the /OPM key within the ExtGState's dictionary.
| bool pdftron::PDF::GState::GetAutoStrokeAdjust | ( | ) | const |
Corresponds to the /SA key within the ExtGState's dictionary.
| double pdftron::PDF::GState::GetSmoothnessTolerance | ( | ) | const |
Corresponds to the /SM key within the ExtGState's dictionary. The allowable error (or tolerance) is expressed as a fraction of the range of the color component, from 0.0 to 1.0.
| SDF::Obj pdftron::PDF::GState::GetTransferFunct | ( | ) |
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.
| SDF::Obj pdftron::PDF::GState::GetBlackGenFunct | ( | ) |
Corresponds to the /BG key within the ExtGState's dictionary.
| SDF::Obj pdftron::PDF::GState::GetUCRFunct | ( | ) |
Corresponds to the /UCR key within the ExtGState's dictionary.
| SDF::Obj pdftron::PDF::GState::GetHalftone | ( | ) |
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.
| 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 | ( | SDF::Obj | pattern | ) |
Set the stroke color to the given tiling pattern.
| pattern | SDF pattern object. |
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. |