1 //========================================================================
5 // Copyright 1996-2003 Glyph & Cog, LLC
7 //========================================================================
11 #ifdef USE_GCC_PRAGMAS
12 #pragma implementation
19 #include "OutputDev.h"
21 //------------------------------------------------------------------------
23 //------------------------------------------------------------------------
25 void OutputDev::setDefaultCTM(double *ctm) {
29 for (i = 0; i < 6; ++i) {
32 det = 1 / (defCTM[0] * defCTM[3] - defCTM[1] * defCTM[2]);
33 defICTM[0] = defCTM[3] * det;
34 defICTM[1] = -defCTM[1] * det;
35 defICTM[2] = -defCTM[2] * det;
36 defICTM[3] = defCTM[0] * det;
37 defICTM[4] = (defCTM[2] * defCTM[5] - defCTM[3] * defCTM[4]) * det;
38 defICTM[5] = (defCTM[1] * defCTM[4] - defCTM[0] * defCTM[5]) * det;
41 void OutputDev::cvtDevToUser(double dx, double dy, double *ux, double *uy) {
42 *ux = defICTM[0] * dx + defICTM[2] * dy + defICTM[4];
43 *uy = defICTM[1] * dx + defICTM[3] * dy + defICTM[5];
46 void OutputDev::cvtUserToDev(double ux, double uy, int *dx, int *dy) {
47 *dx = (int)(defCTM[0] * ux + defCTM[2] * uy + defCTM[4] + 0.5);
48 *dy = (int)(defCTM[1] * ux + defCTM[3] * uy + defCTM[5] + 0.5);
51 void OutputDev::updateAll(GfxState *state) {
52 updateLineDash(state);
53 updateFlatness(state);
54 updateLineJoin(state);
56 updateMiterLimit(state);
57 updateLineWidth(state);
58 updateFillColor(state);
59 updateStrokeColor(state);
63 GBool OutputDev::beginType3Char(GfxState *state, double x, double y,
65 CharCode code, Unicode *u, int uLen) {
69 void OutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str,
70 int width, int height, GBool invert,
76 j = height * ((width + 7) / 8);
77 for (i = 0; i < j; ++i)
83 void OutputDev::drawImage(GfxState *state, Object *ref, Stream *str,
84 int width, int height, GfxImageColorMap *colorMap,
85 int *maskColors, GBool inlineImg) {
90 j = height * ((width * colorMap->getNumPixelComps() *
91 colorMap->getBits() + 7) / 8);
92 for (i = 0; i < j; ++i)
99 void OutputDev::opiBegin(GfxState *state, Dict *opiDict) {
102 void OutputDev::opiEnd(GfxState *state, Dict *opiDict) {