File indexing completed on 2025-12-10 10:23:50
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027 #ifndef PRESCANOUTPUTDEV_H
0028 #define PRESCANOUTPUTDEV_H
0029
0030 #include "Object.h"
0031 #include "GfxState.h"
0032 #include "OutputDev.h"
0033 #include "PSOutputDev.h"
0034
0035
0036
0037
0038
0039 class PreScanOutputDev : public OutputDev
0040 {
0041 public:
0042
0043 explicit PreScanOutputDev(PSLevel levelA);
0044
0045
0046 ~PreScanOutputDev() override;
0047
0048
0049
0050
0051
0052 bool upsideDown() override { return true; }
0053
0054
0055 bool useDrawChar() override { return true; }
0056
0057
0058
0059
0060 bool useTilingPatternFill() override { return true; }
0061
0062
0063
0064
0065 bool useShadedFills(int type) override { return true; }
0066
0067
0068
0069 bool interpretType3Chars() override { return true; }
0070
0071
0072
0073
0074 void startPage(int pageNum, GfxState *state, XRef *xref) override;
0075
0076
0077 void endPage() override;
0078
0079
0080 void stroke(GfxState *state) override;
0081 void fill(GfxState *state) override;
0082 void eoFill(GfxState *state) override;
0083 bool tilingPatternFill(GfxState *state, Gfx *gfx, Catalog *cat, GfxTilingPattern *tPat, const double *mat, int x0, int y0, int x1, int y1, double xStep, double yStep) override;
0084 bool functionShadedFill(GfxState *state, GfxFunctionShading *shading) override;
0085 bool axialShadedFill(GfxState *state, GfxAxialShading *shading, double tMin, double tMax) override;
0086 bool radialShadedFill(GfxState *state, GfxRadialShading *shading, double tMin, double tMax) override;
0087
0088
0089 void clip(GfxState *state) override;
0090 void eoClip(GfxState *state) override;
0091
0092
0093 void beginStringOp(GfxState *state) override;
0094 void endStringOp(GfxState *state) override;
0095 bool beginType3Char(GfxState *state, double x, double y, double dx, double dy, CharCode code, const Unicode *u, int uLen) override;
0096 void endType3Char(GfxState *state) override;
0097
0098
0099 void drawImageMask(GfxState *state, Object *ref, Stream *str, int width, int height, bool invert, bool interpolate, bool inlineImg) override;
0100 void drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, bool interpolate, const int *maskColors, bool inlineImg) override;
0101 void drawMaskedImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, bool interpolate, Stream *maskStr, int maskWidth, int maskHeight, bool maskInvert, bool maskInterpolate) override;
0102 void drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, bool interpolate, Stream *maskStr, int maskWidth, int maskHeight, GfxImageColorMap *maskColorMap,
0103 bool maskInterpolate) override;
0104
0105
0106 void beginTransparencyGroup(GfxState *state, const double *bbox, GfxColorSpace *blendingColorSpace, bool isolated, bool knockout, bool forSoftMask) override;
0107 void paintTransparencyGroup(GfxState *state, const double *bbox) override;
0108 void setSoftMask(GfxState *state, const double *bbox, bool alpha, Function *transferFunc, GfxColor *backdropColor) override;
0109
0110
0111
0112
0113
0114 bool isMonochrome() { return mono; }
0115
0116
0117
0118 bool isGray() { return gray; }
0119
0120
0121
0122 bool usesTransparency() { return transparency; }
0123
0124
0125
0126 bool isAllGDI() { return gdi; }
0127
0128
0129
0130
0131 bool usesPatternImageMask() { return patternImgMask; }
0132
0133
0134 void clearStats();
0135
0136 private:
0137 void check(GfxColorSpace *colorSpace, const GfxColor *color, double opacity, GfxBlendMode blendMode);
0138
0139 bool mono;
0140 bool gray;
0141 bool transparency;
0142 bool gdi;
0143 PSLevel level;
0144 bool patternImgMask;
0145 int inTilingPatternFill;
0146 };
0147
0148 #endif