1 //========================================================================
5 // Copyright 1996 Derek B. Noonburg
7 //========================================================================
21 class GfxImageColorMap;
26 //------------------------------------------------------------------------
28 //------------------------------------------------------------------------
37 virtual ~OutputDev() {}
39 //----- get info about output device
41 // Does this device use upside-down coordinates?
42 // (Upside-down means (0,0) is the top left corner of the page.)
43 virtual GBool upsideDown() = 0;
45 // Does this device use drawChar() or drawString()?
46 virtual GBool useDrawChar() = 0;
48 //----- initialization and control
50 // Set default transform matrix.
51 virtual void setDefaultCTM(double *ctm1);
54 virtual void startPage(int pageNum, GfxState *state) {}
57 virtual void endPage() {}
59 // Dump page contents to display.
60 virtual void dump() {}
62 //----- coordinate conversion
64 // Convert between device and user coordinates.
65 virtual void cvtDevToUser(int dx, int dy, double *ux, double *uy);
66 virtual void cvtUserToDev(double ux, double uy, int *dx, int *dy);
69 virtual void drawLink(Link *link, Catalog *catalog) {}
71 //----- save/restore graphics state
72 virtual void saveState(GfxState *state) {}
73 virtual void restoreState(GfxState *state) {}
75 //----- update graphics state
76 virtual void updateAll(GfxState *state);
77 virtual void updateCTM(GfxState *state, double m11, double m12,
78 double m21, double m22, double m31, double m32) {}
79 virtual void updateLineDash(GfxState *state) {}
80 virtual void updateFlatness(GfxState *state) {}
81 virtual void updateLineJoin(GfxState *state) {}
82 virtual void updateLineCap(GfxState *state) {}
83 virtual void updateMiterLimit(GfxState *state) {}
84 virtual void updateLineWidth(GfxState *state) {}
85 virtual void updateFillColor(GfxState *state) {}
86 virtual void updateStrokeColor(GfxState *state) {}
87 virtual void updateFillOpacity(GfxState *state) {}
88 virtual void updateStrokeOpacity(GfxState *state) {}
90 //----- update text state
91 virtual void updateFont(GfxState *state) {}
92 virtual void updateTextMat(GfxState *state) {}
93 virtual void updateCharSpace(GfxState *state) {}
94 virtual void updateRender(GfxState *state) {}
95 virtual void updateRise(GfxState *state) {}
96 virtual void updateWordSpace(GfxState *state) {}
97 virtual void updateHorizScaling(GfxState *state) {}
98 virtual void updateTextPos(GfxState *state) {}
99 virtual void updateTextShift(GfxState *state, double shift) {}
101 //----- path painting
102 virtual void stroke(GfxState *state) {}
103 virtual void fill(GfxState *state) {}
104 virtual void eoFill(GfxState *state) {}
106 //----- path clipping
107 virtual void clip(GfxState *state) {}
108 virtual void eoClip(GfxState *state) {}
111 virtual void beginString(GfxState *state, GString *s) {}
112 virtual void endString(GfxState *state) {}
113 virtual void drawChar(GfxState *state, double x, double y,
114 double dx, double dy, Guchar c) {}
115 virtual void drawChar16(GfxState *state, double x, double y,
116 double dx, double dy, int c) {}
117 virtual void drawString(GfxState *state, GString *s) {}
118 virtual void drawString16(GfxState *state, GString *s) {}
120 //----- image drawing
121 virtual void drawImageMask(GfxState *state, Object *ref, Stream *str,
122 int width, int height, GBool invert,
124 virtual void drawImage(GfxState *state, Object *ref, Stream *str,
125 int width, int height, GfxImageColorMap *colorMap,
129 //----- OPI functions
130 virtual void opiBegin(GfxState *state, Dict *opiDict);
131 virtual void opiEnd(GfxState *state, Dict *opiDict);
136 double ctm[6]; // coordinate transform matrix
137 double ictm[6]; // inverse CTM