X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=pdf2swf%2Fxpdf%2FOutputDev.cc;h=cfa41619e04952fd3820eac7c73f41e6c957fa8e;hb=f3bc04e70501213ea1d9d2aa22d5c2fa550dab3f;hp=eebf46055e6f1f12e4f886e664d03f60decba8da;hpb=fc554a43712b76d16b41ec77dd311b4a78b1ef6b;p=swftools.git diff --git a/pdf2swf/xpdf/OutputDev.cc b/pdf2swf/xpdf/OutputDev.cc index eebf460..cfa4161 100644 --- a/pdf2swf/xpdf/OutputDev.cc +++ b/pdf2swf/xpdf/OutputDev.cc @@ -2,11 +2,13 @@ // // OutputDev.cc // -// Copyright 1996 Derek B. Noonburg +// Copyright 1996-2003 Glyph & Cog, LLC // //======================================================================== -#ifdef __GNUC__ +#include + +#ifdef USE_GCC_PRAGMAS #pragma implementation #endif @@ -20,29 +22,30 @@ // OutputDev //------------------------------------------------------------------------ -void OutputDev::setDefaultCTM(double *ctm1) { +void OutputDev::setDefaultCTM(double *ctm) { int i; double det; - for (i = 0; i < 6; ++i) - ctm[i] = ctm1[i]; - det = 1 / (ctm[0] * ctm[3] - ctm[1] * ctm[2]); - ictm[0] = ctm[3] * det; - ictm[1] = -ctm[1] * det; - ictm[2] = -ctm[2] * det; - ictm[3] = ctm[0] * det; - ictm[4] = (ctm[2] * ctm[5] - ctm[3] * ctm[4]) * det; - ictm[5] = (ctm[1] * ctm[4] - ctm[0] * ctm[5]) * det; + for (i = 0; i < 6; ++i) { + defCTM[i] = ctm[i]; + } + det = 1 / (defCTM[0] * defCTM[3] - defCTM[1] * defCTM[2]); + defICTM[0] = defCTM[3] * det; + defICTM[1] = -defCTM[1] * det; + defICTM[2] = -defCTM[2] * det; + defICTM[3] = defCTM[0] * det; + defICTM[4] = (defCTM[2] * defCTM[5] - defCTM[3] * defCTM[4]) * det; + defICTM[5] = (defCTM[1] * defCTM[4] - defCTM[0] * defCTM[5]) * det; } -void OutputDev::cvtDevToUser(int dx, int dy, double *ux, double *uy) { - *ux = ictm[0] * dx + ictm[2] * dy + ictm[4]; - *uy = ictm[1] * dx + ictm[3] * dy + ictm[5]; +void OutputDev::cvtDevToUser(double dx, double dy, double *ux, double *uy) { + *ux = defICTM[0] * dx + defICTM[2] * dy + defICTM[4]; + *uy = defICTM[1] * dx + defICTM[3] * dy + defICTM[5]; } void OutputDev::cvtUserToDev(double ux, double uy, int *dx, int *dy) { - *dx = (int)(ctm[0] * ux + ctm[2] * uy + ctm[4] + 0.5); - *dy = (int)(ctm[1] * ux + ctm[3] * uy + ctm[5] + 0.5); + *dx = (int)(defCTM[0] * ux + defCTM[2] * uy + defCTM[4] + 0.5); + *dy = (int)(defCTM[1] * ux + defCTM[3] * uy + defCTM[5] + 0.5); } void OutputDev::updateAll(GfxState *state) { @@ -52,11 +55,24 @@ void OutputDev::updateAll(GfxState *state) { updateLineCap(state); updateMiterLimit(state); updateLineWidth(state); + updateFillColorSpace(state); updateFillColor(state); + updateStrokeColorSpace(state); updateStrokeColor(state); + updateBlendMode(state); + updateFillOpacity(state); + updateStrokeOpacity(state); + updateFillOverprint(state); + updateStrokeOverprint(state); updateFont(state); } +GBool OutputDev::beginType3Char(GfxState *state, double x, double y, + double dx, double dy, + CharCode code, Unicode *u, int uLen) { + return gFalse; +} + void OutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str, int width, int height, GBool invert, GBool inlineImg) { @@ -67,12 +83,13 @@ void OutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str, j = height * ((width + 7) / 8); for (i = 0; i < j; ++i) str->getChar(); + str->close(); } } void OutputDev::drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, - GBool inlineImg) { + int *maskColors, GBool inlineImg) { int i, j; if (inlineImg) { @@ -81,9 +98,28 @@ void OutputDev::drawImage(GfxState *state, Object *ref, Stream *str, colorMap->getBits() + 7) / 8); for (i = 0; i < j; ++i) str->getChar(); + str->close(); } } +void OutputDev::drawMaskedImage(GfxState *state, Object *ref, Stream *str, + int width, int height, + GfxImageColorMap *colorMap, + Stream *maskStr, + int maskWidth, int maskHeight, + GBool maskInvert) { + drawImage(state, ref, str, width, height, colorMap, NULL, gFalse); +} + +void OutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str, + int width, int height, + GfxImageColorMap *colorMap, + Stream *maskStr, + int maskWidth, int maskHeight, + GfxImageColorMap *maskColorMap) { + drawImage(state, ref, str, width, height, colorMap, NULL, gFalse); +} + #if OPI_SUPPORT void OutputDev::opiBegin(GfxState *state, Dict *opiDict) { }