[poppler] poppler/Gfx.cc poppler/GfxState.h poppler/OutputDev.h

Jeff Muizelaar jrmuizel at kemper.freedesktop.org
Sun Nov 11 13:14:14 PST 2007


 poppler/Gfx.cc      |   14 ++++++++++++++
 poppler/GfxState.h  |    6 ++++++
 poppler/OutputDev.h |    2 ++
 3 files changed, 22 insertions(+)

New commits:
commit b0fbfb0ac366434d7e4c0350a9be83ddda7b03cf
Author: Jeff Muizelaar <jeff at infidigm.net>
Date:   Sun Nov 11 16:06:16 2007 -0500

    Track the AlphaIsShape and TextKnockout state
    
    Parse, store and notify the OutputDevices about these entries.

diff --git a/poppler/Gfx.cc b/poppler/Gfx.cc
index 37c279e..eb0012e 100644
--- a/poppler/Gfx.cc
+++ b/poppler/Gfx.cc
@@ -929,6 +929,20 @@ void Gfx::opSetExtGState(Object args[], int numArgs) {
   }
   obj2.free();
 
+  // alpha is shape
+  if (obj1.dictLookup("AIS", &obj2)->isBool()) {
+    state->setAlphaIsShape(obj2.getBool());
+    out->updateAlphaIsShape(state);
+  }
+  obj2.free();
+
+  // text knockout
+  if (obj1.dictLookup("TK", &obj2)->isBool()) {
+    state->setTextKnockout(obj2.getBool());
+    out->updateTextKnockout(state);
+  }
+  obj2.free();
+
   // soft mask
   if (!obj1.dictLookup("SMask", &obj2)->isNull()) {
     if (obj2.isName("None")) {
diff --git a/poppler/GfxState.h b/poppler/GfxState.h
index a36370e..c766858 100644
--- a/poppler/GfxState.h
+++ b/poppler/GfxState.h
@@ -1091,6 +1091,8 @@ public:
   int getLineCap() { return lineCap; }
   double getMiterLimit() { return miterLimit; }
   GBool getStrokeAdjust() { return strokeAdjust; }
+  GBool getAlphaIsShape() { return alphaIsShape; }
+  GBool getTextKnockout() { return textKnockout; }
   GfxFont *getFont() { return font; }
   double getFontSize() { return fontSize; }
   double *getTextMat() { return textMat; }
@@ -1158,6 +1160,8 @@ public:
   void setLineCap(int lineCap1) { lineCap = lineCap1; }
   void setMiterLimit(double limit) { miterLimit = limit; }
   void setStrokeAdjust(GBool sa) { strokeAdjust = sa; }
+  void setAlphaIsShape(GBool ais) { alphaIsShape = ais; }
+  void setTextKnockout(GBool tk) { textKnockout = tk; }
   void setFont(GfxFont *fontA, double fontSizeA);
   void setTextMat(double a, double b, double c,
 		  double d, double e, double f)
@@ -1240,6 +1244,8 @@ private:
   int lineCap;			// line cap style
   double miterLimit;		// line miter limit
   GBool strokeAdjust;		// stroke adjustment
+  GBool alphaIsShape;		// alpha is shape
+  GBool textKnockout;		// text knockout
 
   GfxFont *font;		// font
   double fontSize;		// font size
diff --git a/poppler/OutputDev.h b/poppler/OutputDev.h
index 71910ff..1e92b16 100644
--- a/poppler/OutputDev.h
+++ b/poppler/OutputDev.h
@@ -127,6 +127,8 @@ public:
   virtual void updateMiterLimit(GfxState * /*state*/) {}
   virtual void updateLineWidth(GfxState * /*state*/) {}
   virtual void updateStrokeAdjust(GfxState * /*state*/) {}
+  virtual void updateAlphaIsShape(GfxState * /*state*/) {}
+  virtual void updateTextKnockout(GfxState * /*state*/) {}
   virtual void updateFillColorSpace(GfxState * /*state*/) {}
   virtual void updateStrokeColorSpace(GfxState * /*state*/) {}
   virtual void updateFillColor(GfxState * /*state*/) {}


More information about the poppler mailing list