1 //========================================================================
5 // Copyright 1996 Derek B. Noonburg
7 //========================================================================
10 #pragma implementation
17 #include "OutputDev.h"
19 //------------------------------------------------------------------------
21 //------------------------------------------------------------------------
23 void OutputDev::setDefaultCTM(double *ctm1) {
27 for (i = 0; i < 6; ++i)
29 det = 1 / (ctm[0] * ctm[3] - ctm[1] * ctm[2]);
30 ictm[0] = ctm[3] * det;
31 ictm[1] = -ctm[1] * det;
32 ictm[2] = -ctm[2] * det;
33 ictm[3] = ctm[0] * det;
34 ictm[4] = (ctm[2] * ctm[5] - ctm[3] * ctm[4]) * det;
35 ictm[5] = (ctm[1] * ctm[4] - ctm[0] * ctm[5]) * det;
38 void OutputDev::cvtDevToUser(int dx, int dy, double *ux, double *uy) {
39 *ux = ictm[0] * dx + ictm[2] * dy + ictm[4];
40 *uy = ictm[1] * dx + ictm[3] * dy + ictm[5];
43 void OutputDev::cvtUserToDev(double ux, double uy, int *dx, int *dy) {
44 *dx = (int)(ctm[0] * ux + ctm[2] * uy + ctm[4] + 0.5);
45 *dy = (int)(ctm[1] * ux + ctm[3] * uy + ctm[5] + 0.5);
48 void OutputDev::updateAll(GfxState *state) {
49 updateLineDash(state);
50 updateFlatness(state);
51 updateLineJoin(state);
53 updateMiterLimit(state);
54 updateLineWidth(state);
55 updateFillColor(state);
56 updateStrokeColor(state);
60 void OutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str,
61 int width, int height, GBool invert,
67 j = height * ((width + 7) / 8);
68 for (i = 0; i < j; ++i)
73 void OutputDev::drawImage(GfxState *state, Object *ref, Stream *str,
74 int width, int height, GfxImageColorMap *colorMap,
80 j = height * ((width * colorMap->getNumPixelComps() *
81 colorMap->getBits() + 7) / 8);
82 for (i = 0; i < j; ++i)
88 void OutputDev::opiBegin(GfxState *state, Dict *opiDict) {
91 void OutputDev::opiEnd(GfxState *state, Dict *opiDict) {