filters
FilterDevice.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef FILTERDEVICE_H
00021 #define FILTERDEVICE_H
00022
00023 #include <qimage.h>
00024
00025 class Object;
00026 class Stream;
00027
00028 #include "gtypes.h"
00029 #include "OutputDev.h"
00030
00031 #include "misc.h"
00032
00033
00034 namespace PDFImport
00035 {
00036 class Page;
00037 class Data;
00038
00039 class Device : public OutputDev
00040 {
00041 public:
00042 Device(Data &data);
00043 ~Device();
00044
00045 void init();
00046 void dumpPage(uint i);
00047
00048
00049 virtual GBool upsideDown() { return gTrue; }
00050 virtual GBool useDrawChar() { return gTrue; }
00051 virtual GBool interpretType3Chars() { return gFalse; }
00052 virtual GBool needNonText() { return gFalse; }
00053
00054
00055 virtual void startPage(int pageNum, GfxState *state);
00056 virtual void endPage();
00057
00058
00059 virtual void updateAll(GfxState *state);
00060
00061
00062
00063
00064
00065
00066 virtual void updateFillColor(GfxState *state);
00067 virtual void updateStrokeColor(GfxState *state);
00068
00069
00070 virtual void updateFont(GfxState *state);
00071
00072
00073 virtual void beginString(GfxState *state, GString *s);
00074 virtual void endString(GfxState *state);
00075 virtual void drawChar(GfxState *state, double x, double y,
00076 double dx, double dy,
00077 double originX, double originY,
00078 CharCode c, Unicode *u, int uLen);
00079
00080
00081 virtual void drawLink(::Link* link, Catalog *cat);
00082
00083
00084 virtual void drawImageMask(GfxState *, Object *ref, Stream *,
00085 int width, int height, GBool invert,
00086 GBool inlineImg);
00087 virtual void drawImage(GfxState *, Object *ref, Stream *,
00088 int width, int height, GfxImageColorMap *colorMap,
00089 int *maskColors, GBool inlineImg);
00090
00091
00092 virtual void stroke(GfxState *state);
00093 virtual void fill(GfxState *state);
00094 virtual void eoFill(GfxState *state);
00095
00096 private:
00097 class Image;
00098 static void computeGeometry(GfxState *, Image &);
00099 uint initImage(GfxState *, int width, int height, bool mask);
00100 void addImage();
00101 void clear();
00102 static DPathVector convertPath(GfxState *);
00103 void doFill(const DPathVector &);
00104 Page *current() const { return _pages.getLast(); }
00105
00106 private:
00107 Data &_data;
00108 QPtrList<Page> _pages;
00109 QColor _fillColor, _strokeColor;
00110
00111 class Image {
00112 public:
00113 QImage image;
00114 DRect rect;
00115 bool mask;
00116 };
00117 Image _currentImage;
00118 typedef QValueList<Image> ImageList;
00119 ImageList _images;
00120 };
00121
00122 }
00123
00124 #endif
|