Loading...
Searching...
No Matches
GState.h
Go to the documentation of this file.
1//---------------------------------------------------------------------------------------
2// Copyright (c) 2001-2025 by Apryse Software Inc. All Rights Reserved.
3// Consult legal.txt regarding legal and license information.
4//---------------------------------------------------------------------------------------
5#ifndef PDFTRON_H_CPPPDFGState
6#define PDFTRON_H_CPPPDFGState
7
8#include <C/PDF/TRN_GState.h>
9#include <Common/Matrix2D.h>
10#include <PDF/ColorSpace.h>
11#include <PDF/Font.h>
12#include <PDF/PatternColor.h>
13
14namespace pdftron {
15 namespace PDF {
16
26class GState
27{
28public:
29
31 GState(const GState& c);
33
34 // GState properties
84
85 // Get Methods ------------------------------------------------------------------
86
93
98
103
108
113
118
123
134 double GetFlatness() const;
135
136
138 {
139 e_butt_cap = 0, // The stroke is squared off at the endpoint of the path.
140 e_round_cap, // A semicircular arc with a diameter equal to the line width.
141 e_square_cap // squared off stroke continues beyond the endpoint of the path.
142 };
143
151
152
154 {
155 e_miter_join = 0, // The two segments are extended until they meet
156 e_round_join, // A circle with a diameter equal to the line width
157 e_bevel_join // The two segments are finished with butt caps
158 };
159
167
173 double GetLineWidth() const;
174
182 double GetMiterLimit() const;
183
193 std::vector<double> GetDashes() const;
194
195#ifndef SWIG
196 void GetDashes(std::vector<double>& dashes) const;
197#endif
198
203 double GetPhase() const;
204
213 double GetCharSpacing() const;
214
221 double GetWordSpacing() const;
222
232 double GetHorizontalScale() const;
233
241 double GetLeading() const;
242
246 Font GetFont() const;
247
251 double GetFontSize() const;
252
254 {
255 e_fill_text = 0, // Fill text.
256 e_stroke_text, // Stroke text.
257 e_fill_stroke_text, // Fill, then stroke text.
258 e_invisible_text, // Neither fill nor stroke text (invisible).
259 e_fill_clip_text, // Fill text and add to path for clipping (see above).
260 e_stroke_clip_text, // Stroke text and add to path for clipping.
261 e_fill_stroke_clip_text, // Fill, then stroke text and add to path for clipping.
262 e_clip_text // Add text to path for clipping.
263 };
264
273
281 double GetTextRise() const;
282
288 bool IsTextKnockout() const;
289
297
302
309 static RenderingIntent GetRenderingIntentType(const char* name);
310
311 // Extended graphics state 'Get' methods ----------------------------------------
312
313 // The standard separable blend modes available in PDF.
334
340
346 double GetFillOpacity() const;
347
353 double GetStrokeOpacity() const;
354
360 bool GetAISFlag() const;
361
367
375
380 bool GetStrokeOverprint() const;
381
386 bool GetFillOverprint() const;
387
392 int GetOverprintMode() const;
393
399
407
415
422
429
437
438 // Set Methods ------------------------------------------------------------------
439
449
468 void SetTransform(double a, double b, double c, double d, double h, double v);
469
474 void Concat(const Common::Matrix2D& mtx);
485 void Concat(double a, double b, double c, double d, double h, double v);
486
492
498
505 void SetStrokeColor(const ColorPt& c);
506
513
520 void SetStrokeColor(PatternColor pattern, const ColorPt& c);
521
528 void SetFillColor(const ColorPt& c);
529
536
543 void SetFillColor(PatternColor pattern, const ColorPt& c);
544
555 void SetFlatness(double flatness);
556
564
572
579 void SetLineWidth(double width);
580
587 void SetMiterLimit(double miter_limit);
588
597 void SetDashPattern(const std::vector<double>& dash_array, double phase);
598
606 void SetCharSpacing(double char_spacing);
607
614 void SetWordSpacing(double word_spacing);
615
625 void SetHorizontalScale(double hscale);
626
635 void SetLeading(double leading);
636
642 void SetFont(Font font, double font_sz);
643
651
659 void SetTextRise(double rise);
660
666 void SetTextKnockout(bool knockout);
667
672
673 // Extended graphics state 'Set' methods ----------------------------------------
674
689
695 void SetFillOpacity(double ca);
696
702 void SetStrokeOpacity(double ca);
703
711 void SetAISFlag(bool AIS);
712
719
725 void SetStrokeOverprint(bool OP);
726
732 void SetFillOverprint(bool op);
733
739 void SetOverprintMode(int OPM);
740
746 void SetAutoStrokeAdjust(bool SA);
747
753 void SetSmoothnessTolerance(double SM);
754
762
770
779
788
789// @cond PRIVATE_DOC
790#ifndef SWIGHIDDEN
791 GState(TRN_GState impl);
792 TRN_GState mp_state;
793#endif
794// @endcond
795};
796
797
798#include <Impl/GState.inl>
799
800 }; // namespace PDF
801}; // namespace pdftron
802
803
804
805// @cond PRIVATE_DOC
806#ifndef SWIGHIDDEN
807#ifdef _WIN32
808 // A forward declaration for GDI+
809 namespace Gdiplus { class Bitmap; };
810#endif
811#endif
812// @endcond
813
814#endif // PDFTRON_H_CPPPDFGState
double GetFontSize() const
Common::Matrix2D GetSoftMaskTransform()
void SetFillColorSpace(ColorSpace cs)
Common::Matrix2D GetTransform()
double GetLeading() const
bool GetAutoStrokeAdjust() const
void SetCharSpacing(double char_spacing)
void SetFillColor(const ColorPt &c)
ColorSpace GetStrokeColorSpace()
void SetTransform(double a, double b, double c, double d, double h, double v)
void SetLineWidth(double width)
PatternColor GetFillPattern()
ColorPt GetStrokeColor()
void Concat(double a, double b, double c, double d, double h, double v)
void SetRenderingIntent(RenderingIntent intent)
void SetFillOpacity(double ca)
double GetPhase() const
void SetUCRFunct(SDF::Obj UCR)
void Concat(const Common::Matrix2D &mtx)
void SetBlendMode(BlendMode BM)
GState(const GState &c)
SDF::Obj GetBlackGenFunct()
void SetSmoothnessTolerance(double SM)
LineCap GetLineCap() const
double GetHorizontalScale() const
SDF::Obj GetTransferFunct()
BlendMode GetBlendMode()
Font GetFont() const
void SetStrokeOpacity(double ca)
double GetMiterLimit() const
std::vector< double > GetDashes() const
void GetDashes(std::vector< double > &dashes) const
double GetFillOpacity() const
void SetFont(Font font, double font_sz)
void SetDashPattern(const std::vector< double > &dash_array, double phase)
void SetTransform(const Common::Matrix2D &mtx)
void SetStrokeColor(const ColorPt &c)
void SetAISFlag(bool AIS)
void SetHorizontalScale(double hscale)
SDF::Obj GetUCRFunct()
void SetSoftMask(SDF::Obj SM)
bool GetAISFlag() const
double GetLineWidth() const
void SetTextRise(double rise)
static RenderingIntent GetRenderingIntentType(const char *name)
PatternColor GetStrokePattern()
SDF::Obj GetHalftone()
void SetBlackGenFunct(SDF::Obj BG)
bool GetStrokeOverprint() const
void SetFlatness(double flatness)
double GetTextRise() const
void SetHalftone(SDF::Obj HT)
GState & operator=(const GState &c)
void SetTransferFunct(SDF::Obj TR)
double GetStrokeOpacity() const
TextRenderingMode GetTextRenderMode() const
void SetFillColor(PatternColor pattern, const ColorPt &c)
void SetAutoStrokeAdjust(bool SA)
void SetTextKnockout(bool knockout)
void SetStrokeOverprint(bool OP)
void SetMiterLimit(double miter_limit)
double GetSmoothnessTolerance() const
SDF::Obj GetSoftMask()
void SetFillOverprint(bool op)
ColorSpace GetFillColorSpace()
void SetStrokeColor(PatternColor pattern)
bool GetFillOverprint() const
void SetStrokeColorSpace(ColorSpace cs)
RenderingIntent GetRenderingIntent() const
void SetLeading(double leading)
void SetLineCap(LineCap cap)
void SetOverprintMode(int OPM)
LineJoin GetLineJoin() const
double GetWordSpacing() const
double GetCharSpacing() const
void SetStrokeColor(PatternColor pattern, const ColorPt &c)
int GetOverprintMode() const
void SetWordSpacing(double word_spacing)
double GetFlatness() const
bool IsTextKnockout() const
void SetFillColor(PatternColor pattern)
void SetLineJoin(LineJoin join)
void SetTextRenderMode(TextRenderingMode rmode)