]>
git.ipfire.org Git - thirdparty/cups.git/blob - pdftops/Gfx.h
1 //========================================================================
5 // Copyright 1996 Derek B. Noonburg
7 //========================================================================
27 struct GfxFontEncoding16
;
30 class GfxAxialShading
;
35 //------------------------------------------------------------------------
37 //------------------------------------------------------------------------
48 tchkNum
, // number (integer or real)
52 tchkProps
, // properties (dictionary or name)
53 tchkSCN
, // scn/SCN args (number of name)
54 tchkNone
// used to avoid empty initializer lists
62 TchkType tchk
[maxArgs
];
63 void (Gfx::*func
)(Object args
[], int numArgs
);
69 GfxResources(XRef
*xref
, Dict
*resDict
, GfxResources
*nextA
);
72 GfxFont
*lookupFont(char *name
);
73 GBool
lookupXObject(char *name
, Object
*obj
);
74 GBool
lookupXObjectNF(char *name
, Object
*obj
);
75 void lookupColorSpace(char *name
, Object
*obj
);
76 GfxPattern
*lookupPattern(char *name
);
77 GfxShading
*lookupShading(char *name
);
78 GBool
lookupGState(char *name
, Object
*obj
);
80 GfxResources
*getNext() { return next
; }
86 Object colorSpaceDict
;
96 // Constructor for regular output.
97 Gfx(XRef
*xrefA
, OutputDev
*outA
, int pageNum
, Dict
*resDict
, double dpi
,
98 PDFRectangle
*box
, GBool crop
, PDFRectangle
*cropBox
, int rotate
,
99 GBool printCommandsA
);
104 // Interpret a stream or array of streams.
105 void display(Object
*obj
, GBool topLevel
= gTrue
);
107 void doWidgetForm(Object
*str
, double xMin
, double yMin
,
108 double xMax
, double yMax
);
112 XRef
*xref
; // the xref table for this PDF file
113 OutputDev
*out
; // output device
114 GBool printCommands
; // print the drawing commands (for debugging)
115 GfxResources
*res
; // resource stack
117 GfxState
*state
; // current graphics state
118 GBool fontChanged
; // set if font or text matrix has changed
119 GfxClipType clip
; // do a clip?
120 int ignoreUndef
; // current BX/EX nesting level
121 double baseMatrix
[6]; // default matrix for most recent
124 Parser
*parser
; // parser for page content stream(s)
126 static Operator opTab
[]; // table of operators
128 void go(GBool topLevel
);
129 void execOp(Object
*cmd
, Object args
[], int numArgs
);
130 Operator
*findOp(char *name
);
131 GBool
checkArg(Object
*arg
, TchkType type
);
134 // graphics state operators
135 void opSave(Object args
[], int numArgs
);
136 void opRestore(Object args
[], int numArgs
);
137 void opConcat(Object args
[], int numArgs
);
138 void opSetDash(Object args
[], int numArgs
);
139 void opSetFlat(Object args
[], int numArgs
);
140 void opSetLineJoin(Object args
[], int numArgs
);
141 void opSetLineCap(Object args
[], int numArgs
);
142 void opSetMiterLimit(Object args
[], int numArgs
);
143 void opSetLineWidth(Object args
[], int numArgs
);
144 void opSetExtGState(Object args
[], int numArgs
);
145 void opSetRenderingIntent(Object args
[], int numArgs
);
148 void opSetFillGray(Object args
[], int numArgs
);
149 void opSetStrokeGray(Object args
[], int numArgs
);
150 void opSetFillCMYKColor(Object args
[], int numArgs
);
151 void opSetStrokeCMYKColor(Object args
[], int numArgs
);
152 void opSetFillRGBColor(Object args
[], int numArgs
);
153 void opSetStrokeRGBColor(Object args
[], int numArgs
);
154 void opSetFillColorSpace(Object args
[], int numArgs
);
155 void opSetStrokeColorSpace(Object args
[], int numArgs
);
156 void opSetFillColor(Object args
[], int numArgs
);
157 void opSetStrokeColor(Object args
[], int numArgs
);
158 void opSetFillColorN(Object args
[], int numArgs
);
159 void opSetStrokeColorN(Object args
[], int numArgs
);
161 // path segment operators
162 void opMoveTo(Object args
[], int numArgs
);
163 void opLineTo(Object args
[], int numArgs
);
164 void opCurveTo(Object args
[], int numArgs
);
165 void opCurveTo1(Object args
[], int numArgs
);
166 void opCurveTo2(Object args
[], int numArgs
);
167 void opRectangle(Object args
[], int numArgs
);
168 void opClosePath(Object args
[], int numArgs
);
170 // path painting operators
171 void opEndPath(Object args
[], int numArgs
);
172 void opStroke(Object args
[], int numArgs
);
173 void opCloseStroke(Object args
[], int numArgs
);
174 void opFill(Object args
[], int numArgs
);
175 void opEOFill(Object args
[], int numArgs
);
176 void opFillStroke(Object args
[], int numArgs
);
177 void opCloseFillStroke(Object args
[], int numArgs
);
178 void opEOFillStroke(Object args
[], int numArgs
);
179 void opCloseEOFillStroke(Object args
[], int numArgs
);
180 void doPatternFill(GBool eoFill
);
181 void opShFill(Object args
[], int numArgs
);
182 void doAxialShFill(GfxAxialShading
*shading
);
185 // path clipping operators
186 void opClip(Object args
[], int numArgs
);
187 void opEOClip(Object args
[], int numArgs
);
189 // text object operators
190 void opBeginText(Object args
[], int numArgs
);
191 void opEndText(Object args
[], int numArgs
);
193 // text state operators
194 void opSetCharSpacing(Object args
[], int numArgs
);
195 void opSetFont(Object args
[], int numArgs
);
196 void opSetTextLeading(Object args
[], int numArgs
);
197 void opSetTextRender(Object args
[], int numArgs
);
198 void opSetTextRise(Object args
[], int numArgs
);
199 void opSetWordSpacing(Object args
[], int numArgs
);
200 void opSetHorizScaling(Object args
[], int numArgs
);
202 // text positioning operators
203 void opTextMove(Object args
[], int numArgs
);
204 void opTextMoveSet(Object args
[], int numArgs
);
205 void opSetTextMatrix(Object args
[], int numArgs
);
206 void opTextNextLine(Object args
[], int numArgs
);
208 // text string operators
209 void opShowText(Object args
[], int numArgs
);
210 void opMoveShowText(Object args
[], int numArgs
);
211 void opMoveSetShowText(Object args
[], int numArgs
);
212 void opShowSpaceText(Object args
[], int numArgs
);
213 void doShowText(GString
*s
);
214 int getNextChar16(GfxFontEncoding16
*enc
, Guchar
*p
, int *c16
);
217 void opXObject(Object args
[], int numArgs
);
218 void doImage(Object
*ref
, Stream
*str
, GBool inlineImg
);
219 void doForm(Object
*str
);
220 void doForm1(Object
*str
, Dict
*resDict
, double *matrix
, double *bbox
);
222 // in-line image operators
223 void opBeginImage(Object args
[], int numArgs
);
224 Stream
*buildImageStream();
225 void opImageData(Object args
[], int numArgs
);
226 void opEndImage(Object args
[], int numArgs
);
228 // type 3 font operators
229 void opSetCharWidth(Object args
[], int numArgs
);
230 void opSetCacheDevice(Object args
[], int numArgs
);
232 // compatibility operators
233 void opBeginIgnoreUndef(Object args
[], int numArgs
);
234 void opEndIgnoreUndef(Object args
[], int numArgs
);
236 // marked content operators
237 void opBeginMarkedContent(Object args
[], int numArgs
);
238 void opEndMarkedContent(Object args
[], int numArgs
);
239 void opMarkPoint(Object args
[], int numArgs
);