source: trunk/poppler/mypoppler/poppler/PreScanOutputDev.h @ 461

Last change on this file since 461 was 277, checked in by rbri, 12 years ago

PDF plugin: Poppler library updated to version 0.12.3

File size: 4.5 KB
Line 
1//========================================================================
2//
3// PreScanOutputDev.h
4//
5// Copyright 2005 Glyph & Cog, LLC
6//
7//========================================================================
8
9//========================================================================
10//
11// Modified under the Poppler project - http://poppler.freedesktop.org
12//
13// All changes made under the Poppler project to this file are licensed
14// under GPL version 2 or later
15//
16// Copyright (C) 2009 Carlos Garcia Campos <carlosgc@gnome.org>
17//
18// To see a description of the changes please see the Changelog file that
19// came with your tarball or type make ChangeLog if you are building from git
20//
21//========================================================================
22
23#ifndef PRESCANOUTPUTDEV_H
24#define PRESCANOUTPUTDEV_H
25
26#ifdef USE_GCC_PRAGMAS
27#pragma interface
28#endif
29
30#include "goo/gtypes.h"
31#include "GfxState.h"
32#include "OutputDev.h"
33
34//------------------------------------------------------------------------
35// PreScanOutputDev
36//------------------------------------------------------------------------
37
38class PreScanOutputDev: public OutputDev {
39public:
40
41  // Constructor.
42  PreScanOutputDev();
43
44  // Destructor.
45  virtual ~PreScanOutputDev();
46
47  //----- get info about output device
48
49  // Does this device use upside-down coordinates?
50  // (Upside-down means (0,0) is the top left corner of the page.)
51  virtual GBool upsideDown() { return gTrue; }
52
53  // Does this device use drawChar() or drawString()?
54  virtual GBool useDrawChar() { return gTrue; }
55
56  // Does this device use beginType3Char/endType3Char?  Otherwise,
57  // text in Type 3 fonts will be drawn with drawChar/drawString.
58  virtual GBool interpretType3Chars() { return gTrue; }
59
60  //----- initialization and control
61
62  // Start a page.
63  virtual void startPage(int pageNum, GfxState *state);
64
65  // End a page.
66  virtual void endPage();
67
68  //----- path painting
69  virtual void stroke(GfxState *state);
70  virtual void fill(GfxState *state);
71  virtual void eoFill(GfxState *state);
72
73  //----- path clipping
74  virtual void clip(GfxState *state);
75  virtual void eoClip(GfxState *state);
76
77  //----- text drawing
78  virtual void beginStringOp(GfxState *state);
79  virtual void endStringOp(GfxState *state);
80  virtual GBool beginType3Char(GfxState *state, double x, double y,
81                               double dx, double dy,
82                               CharCode code, Unicode *u, int uLen);
83  virtual void endType3Char(GfxState *state);
84
85  //----- image drawing
86  virtual void drawImageMask(GfxState *state, Object *ref, Stream *str,
87                             int width, int height, GBool invert,
88                             GBool interpolate, GBool inlineImg);
89  virtual void drawImage(GfxState *state, Object *ref, Stream *str,
90                         int width, int height, GfxImageColorMap *colorMap,
91                         GBool interpolate, int *maskColors, GBool inlineImg);
92  virtual void drawMaskedImage(GfxState *state, Object *ref, Stream *str,
93                               int width, int height,
94                               GfxImageColorMap *colorMap,
95                               GBool interpolate,
96                               Stream *maskStr, int maskWidth, int maskHeight,
97                               GBool maskInvert, GBool maskInterpolate);
98  virtual void drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str,
99                                   int width, int height,
100                                   GfxImageColorMap *colorMap,
101                                   GBool interpolate,
102                                   Stream *maskStr,
103                                   int maskWidth, int maskHeight,
104                                   GfxImageColorMap *maskColorMap,
105                                   GBool maskInterpolate);
106
107  //----- transparency groups and soft masks
108  virtual void beginTransparencyGroup(GfxState *state, double *bbox,
109                                      GfxColorSpace *blendingColorSpace,
110                                      GBool isolated, GBool knockout,
111                                      GBool forSoftMask);
112
113  //----- special access
114
115  // Returns true if the operations performed since the last call to
116  // clearStats() are all monochrome (black or white).
117  GBool isMonochrome() { return mono; }
118
119  // Returns true if the operations performed since the last call to
120  // clearStats() are all gray.
121  GBool isGray() { return gray; }
122
123  // Returns true if the operations performed since the last call to
124  // clearStats() included any transparency.
125  GBool usesTransparency() { return transparency; }
126
127  // Returns true if the operations performed since the last call to
128  // clearStats() are all rasterizable by GDI calls in GDIOutputDev.
129  GBool isAllGDI() { return gdi; }
130
131  // Clear the stats used by the above functions.
132  void clearStats();
133
134private:
135
136  void check(GfxColorSpace *colorSpace, GfxColor *color,
137             double opacity, GfxBlendMode blendMode);
138
139  GBool mono;
140  GBool gray;
141  GBool transparency;
142  GBool gdi;
143};
144
145#endif
Note: See TracBrowser for help on using the repository browser.