From dcb935d31dc5cb66997bbca2445b6e4c4eff3257 Mon Sep 17 00:00:00 2001 From: kramm Date: Tue, 8 Jul 2008 09:26:25 +0000 Subject: [PATCH] count number of polygons --- lib/pdf/InfoOutputDev.cc | 12 ++++++++++++ lib/pdf/InfoOutputDev.h | 5 +++++ 2 files changed, 17 insertions(+) diff --git a/lib/pdf/InfoOutputDev.cc b/lib/pdf/InfoOutputDev.cc index 7a42e73..a0a4cac 100644 --- a/lib/pdf/InfoOutputDev.cc +++ b/lib/pdf/InfoOutputDev.cc @@ -13,6 +13,7 @@ InfoOutputDev::InfoOutputDev(XRef*xref) num_links = 0; num_images = 0; num_fonts = 0; + num_polygons= 0; currentfont = 0; currentglyph = 0; id2font = new GHash(1); @@ -154,6 +155,17 @@ void InfoOutputDev::updateFont(GfxState *state) 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); diff --git a/lib/pdf/InfoOutputDev.h b/lib/pdf/InfoOutputDev.h index 25ffdfb..13ba1e4 100644 --- a/lib/pdf/InfoOutputDev.h +++ b/lib/pdf/InfoOutputDev.h @@ -60,11 +60,13 @@ class InfoOutputDev: public OutputDev FontInfo* currentfont; GlyphInfo* currentglyph; SplashOutputDev*splash; + public: int x1,y1,x2,y2; int num_links; int num_images; int num_fonts; + int num_polygons; 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 fill(GfxState *state); + virtual void eoFill(GfxState *state); virtual void drawChar(GfxState *state, double x, double y, double dx, double dy, -- 1.7.10.4