count number of polygons
authorkramm <kramm>
Tue, 8 Jul 2008 09:26:25 +0000 (09:26 +0000)
committerkramm <kramm>
Tue, 8 Jul 2008 09:26:25 +0000 (09:26 +0000)
lib/pdf/InfoOutputDev.cc
lib/pdf/InfoOutputDev.h

index 7a42e73..a0a4cac 100644 (file)
@@ -13,6 +13,7 @@ InfoOutputDev::InfoOutputDev(XRef*xref)
     num_links = 0;
     num_images = 0;
     num_fonts = 0;
     num_links = 0;
     num_images = 0;
     num_fonts = 0;
+    num_polygons= 0;
     currentfont = 0;
     currentglyph = 0;
     id2font = new GHash(1);
     currentfont = 0;
     currentglyph = 0;
     id2font = new GHash(1);
@@ -154,6 +155,17 @@ void InfoOutputDev::updateFont(GfxState *state)
     currentfont->splash_font = splash->getCurrentFont();
     free(id);
 }
     currentfont->splash_font = splash->getCurrentFont();
     free(id);
 }
+
+void InfoOutputDev::fill(GfxState *state)
+{
+    num_polygons++;
+}
+
+void InfoOutputDev::eoFill(GfxState *state)
+{
+    num_polygons++;
+}
+
 FontInfo* InfoOutputDev::getFont(char*id)
 {
     return (FontInfo*)id2font->lookup(id);
 FontInfo* InfoOutputDev::getFont(char*id)
 {
     return (FontInfo*)id2font->lookup(id);
index 25ffdfb..13ba1e4 100644 (file)
@@ -60,11 +60,13 @@ class InfoOutputDev: public OutputDev
     FontInfo* currentfont;
     GlyphInfo* currentglyph;
     SplashOutputDev*splash;
     FontInfo* currentfont;
     GlyphInfo* currentglyph;
     SplashOutputDev*splash;
+
     public:
     int x1,y1,x2,y2;
     int num_links;
     int num_images;
     int num_fonts;
     public:
     int x1,y1,x2,y2;
     int num_links;
     int num_images;
     int num_fonts;
+    int num_polygons;
 
     InfoOutputDev(XRef*xref);
     virtual ~InfoOutputDev(); 
 
     InfoOutputDev(XRef*xref);
     virtual ~InfoOutputDev(); 
@@ -82,6 +84,9 @@ class InfoOutputDev: public OutputDev
     virtual void type3D0(GfxState *state, double wx, double wy);
     virtual void type3D1(GfxState *state, double wx, double wy, double llx, double lly, double urx, double ury);
     virtual void endType3Char(GfxState *state);
     virtual void type3D0(GfxState *state, double wx, double wy);
     virtual void type3D1(GfxState *state, double wx, double wy, double llx, double lly, double urx, double ury);
     virtual void endType3Char(GfxState *state);
+  
+    virtual void fill(GfxState *state);
+    virtual void eoFill(GfxState *state);
 
     virtual void drawChar(GfxState *state, double x, double y,
                          double dx, double dy,
 
     virtual void drawChar(GfxState *state, double x, double y,
                          double dx, double dy,