incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p..@apache.org
Subject svn commit: r1184758 [2/17] - in /incubator/ooo/trunk/main: ./ agg/inc/ agg/source/ solenv/config/
Date Sun, 16 Oct 2011 04:13:21 GMT
Modified: incubator/ooo/trunk/main/agg/inc/agg_color_rgba.h
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/agg/inc/agg_color_rgba.h?rev=1184758&r1=1184757&r2=1184758&view=diff
==============================================================================
--- incubator/ooo/trunk/main/agg/inc/agg_color_rgba.h (original)
+++ incubator/ooo/trunk/main/agg/inc/agg_color_rgba.h Sun Oct 16 04:13:16 2011
@@ -1,5 +1,5 @@
 //----------------------------------------------------------------------------
-// Anti-Grain Geometry - Version 2.3
+// Anti-Grain Geometry - Version 2.4
 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com)
 //
 // Permission to copy, use, modify, sell and distribute this software 
@@ -31,12 +31,12 @@ namespace agg
 {
     // Supported byte orders for RGB and RGBA pixel formats
     //=======================================================================
-    struct order_rgb  { enum { R=0, G=1, B=2, rgb_tag }; };       //----order_rgb
-    struct order_bgr  { enum { B=0, G=1, R=2, rgb_tag }; };       //----order_bgr
-    struct order_rgba { enum { R=0, G=1, B=2, A=3, rgba_tag }; }; //----order_rgba
-    struct order_argb { enum { A=0, R=1, G=2, B=3, rgba_tag }; }; //----order_argb
-    struct order_abgr { enum { A=0, B=1, G=2, R=3, rgba_tag }; }; //----order_abgr
-    struct order_bgra { enum { B=0, G=1, R=2, A=3, rgba_tag }; }; //----order_bgra
+    struct order_rgb  { enum rgb_e  { R=0, G=1, B=2, rgb_tag }; };       //----order_rgb
+    struct order_bgr  { enum bgr_e  { B=0, G=1, R=2, rgb_tag }; };       //----order_bgr
+    struct order_rgba { enum rgba_e { R=0, G=1, B=2, A=3, rgba_tag }; }; //----order_rgba
+    struct order_argb { enum argb_e { A=0, R=1, G=2, B=3, rgba_tag }; }; //----order_argb
+    struct order_abgr { enum abgr_e { A=0, B=1, G=2, R=3, rgba_tag }; }; //----order_abgr
+    struct order_bgra { enum bgra_e { B=0, G=1, R=2, A=3, rgba_tag }; }; //----order_bgra
 
     //====================================================================rgba
     struct rgba
@@ -145,7 +145,7 @@ namespace agg
         static rgba from_wavelength(double wl, double gamma = 1.0);
 	
         //--------------------------------------------------------------------
-        rgba(double wavelen, double gamma=1.0)
+        explicit rgba(double wavelen, double gamma=1.0)
         {
             *this = from_wavelength(wavelen, gamma);
         }
@@ -225,11 +225,11 @@ namespace agg
         typedef int8u  value_type;
         typedef int32u calc_type;
         typedef int32  long_type;
-        enum
+        enum base_scale_e
         {
             base_shift = 8,
-            base_size  = 1 << base_shift,
-            base_mask  = base_size - 1
+            base_scale = 1 << base_shift,
+            base_mask  = base_scale - 1
         };
         typedef rgba8 self_type;
 
@@ -251,10 +251,10 @@ namespace agg
 
         //--------------------------------------------------------------------
         rgba8(const rgba& c, double a_) :
-            r(value_type(c.r * double(base_mask) + 0.5)), 
-            g(value_type(c.g * double(base_mask) + 0.5)), 
-            b(value_type(c.b * double(base_mask) + 0.5)), 
-            a(value_type(a_  * double(base_mask) + 0.5)) {}
+            r((value_type)uround(c.r * double(base_mask))), 
+            g((value_type)uround(c.g * double(base_mask))), 
+            b((value_type)uround(c.b * double(base_mask))), 
+            a((value_type)uround(a_  * double(base_mask))) {}
 
         //--------------------------------------------------------------------
         rgba8(const self_type& c, unsigned a_) :
@@ -262,10 +262,10 @@ namespace agg
 
         //--------------------------------------------------------------------
         rgba8(const rgba& c) :
-            r(value_type(c.r * double(base_mask) + 0.5)), 
-            g(value_type(c.g * double(base_mask) + 0.5)), 
-            b(value_type(c.b * double(base_mask) + 0.5)), 
-            a(value_type(c.a * double(base_mask) + 0.5)) {}
+            r((value_type)uround(c.r * double(base_mask))), 
+            g((value_type)uround(c.g * double(base_mask))), 
+            b((value_type)uround(c.b * double(base_mask))), 
+            a((value_type)uround(c.a * double(base_mask))) {}
 
         //--------------------------------------------------------------------
         void clear()
@@ -285,7 +285,7 @@ namespace agg
         {
             if(a_ < 0.0) a_ = 0.0;
             if(a_ > 1.0) a_ = 1.0;
-            a = value_type(a_ * double(base_mask) + 0.5);
+            a = (value_type)uround(a_ * double(base_mask));
             return *this;
         }
 
@@ -296,7 +296,7 @@ namespace agg
         }
 
         //--------------------------------------------------------------------
-        const self_type& premultiply()
+        AGG_INLINE const self_type& premultiply()
         {
             if(a == base_mask) return *this;
             if(a == 0)
@@ -311,7 +311,7 @@ namespace agg
         }
 
         //--------------------------------------------------------------------
-        const self_type& premultiply(unsigned a_)
+        AGG_INLINE const self_type& premultiply(unsigned a_)
         {
             if(a == base_mask && a_ >= base_mask) return *this;
             if(a == 0 || a_ == 0)
@@ -330,7 +330,7 @@ namespace agg
         }
 
         //--------------------------------------------------------------------
-        const self_type& demultiply()
+        AGG_INLINE const self_type& demultiply()
         {
             if(a == base_mask) return *this;
             if(a == 0)
@@ -341,17 +341,17 @@ namespace agg
             calc_type r_ = (calc_type(r) * base_mask) / a;
             calc_type g_ = (calc_type(g) * base_mask) / a;
             calc_type b_ = (calc_type(b) * base_mask) / a;
-            r = value_type((r_ > base_mask) ? base_mask : r_);
-            g = value_type((g_ > base_mask) ? base_mask : g_);
-            b = value_type((b_ > base_mask) ? base_mask : b_);
+            r = value_type((r_ > calc_type(base_mask)) ? calc_type(base_mask) : r_);
+            g = value_type((g_ > calc_type(base_mask)) ? calc_type(base_mask) : g_);
+            b = value_type((b_ > calc_type(base_mask)) ? calc_type(base_mask) : b_);
             return *this;
         }
 
         //--------------------------------------------------------------------
-        self_type gradient(const self_type& c, double k) const
+        AGG_INLINE self_type gradient(const self_type& c, double k) const
         {
             self_type ret;
-            calc_type ik = calc_type(k * base_size);
+            calc_type ik = uround(k * base_scale);
             ret.r = value_type(calc_type(r) + (((calc_type(c.r) - r) * ik) >> base_shift));
             ret.g = value_type(calc_type(g) + (((calc_type(c.g) - g) * ik) >> base_shift));
             ret.b = value_type(calc_type(b) + (((calc_type(c.b) - b) * ik) >> base_shift));
@@ -360,6 +360,55 @@ namespace agg
         }
 
         //--------------------------------------------------------------------
+        AGG_INLINE void add(const self_type& c, unsigned cover)
+        {
+            calc_type cr, cg, cb, ca;
+            if(cover == cover_mask)
+            {
+                if(c.a == base_mask) 
+                {
+                    *this = c;
+                }
+                else
+                {
+                    cr = r + c.r; r = (cr > calc_type(base_mask)) ? calc_type(base_mask) : cr;
+                    cg = g + c.g; g = (cg > calc_type(base_mask)) ? calc_type(base_mask) : cg;
+                    cb = b + c.b; b = (cb > calc_type(base_mask)) ? calc_type(base_mask) : cb;
+                    ca = a + c.a; a = (ca > calc_type(base_mask)) ? calc_type(base_mask) : ca;
+                }
+            }
+            else
+            {
+                cr = r + ((c.r * cover + cover_mask/2) >> cover_shift);
+                cg = g + ((c.g * cover + cover_mask/2) >> cover_shift);
+                cb = b + ((c.b * cover + cover_mask/2) >> cover_shift);
+                ca = a + ((c.a * cover + cover_mask/2) >> cover_shift);
+                r = (cr > calc_type(base_mask)) ? calc_type(base_mask) : cr;
+                g = (cg > calc_type(base_mask)) ? calc_type(base_mask) : cg;
+                b = (cb > calc_type(base_mask)) ? calc_type(base_mask) : cb;
+                a = (ca > calc_type(base_mask)) ? calc_type(base_mask) : ca;
+            }
+        }
+
+        //--------------------------------------------------------------------
+        template<class GammaLUT>
+        AGG_INLINE void apply_gamma_dir(const GammaLUT& gamma)
+        {
+            r = gamma.dir(r);
+            g = gamma.dir(g);
+            b = gamma.dir(b);
+        }
+
+        //--------------------------------------------------------------------
+        template<class GammaLUT>
+        AGG_INLINE void apply_gamma_inv(const GammaLUT& gamma)
+        {
+            r = gamma.inv(r);
+            g = gamma.inv(g);
+            b = gamma.inv(b);
+        }
+
+        //--------------------------------------------------------------------
         static self_type no_color() { return self_type(0,0,0,0); }
 
         //--------------------------------------------------------------------
@@ -394,42 +443,53 @@ namespace agg
     }
 
 
-    //-----------------------------------------------------------rgb8_packed
+    //-------------------------------------------------------------rgb8_packed
     inline rgba8 rgb8_packed(unsigned v)
     {
         return rgba8((v >> 16) & 0xFF, (v >> 8) & 0xFF, v & 0xFF);
     }
 
-    //-----------------------------------------------------------bgr8_packed
+    //-------------------------------------------------------------bgr8_packed
     inline rgba8 bgr8_packed(unsigned v)
     {
         return rgba8(v & 0xFF, (v >> 8) & 0xFF, (v >> 16) & 0xFF);
     }
 
-    //----------------------------------------------------------argb8_packed
+    //------------------------------------------------------------argb8_packed
     inline rgba8 argb8_packed(unsigned v)
     {
         return rgba8((v >> 16) & 0xFF, (v >> 8) & 0xFF, v & 0xFF, v >> 24);
     }
 
+    //---------------------------------------------------------rgba8_gamma_dir
+    template<class GammaLUT>
+    rgba8 rgba8_gamma_dir(rgba8 c, const GammaLUT& gamma)
+    {
+        return rgba8(gamma.dir(c.r), gamma.dir(c.g), gamma.dir(c.b), c.a);
+    }
 
+    //---------------------------------------------------------rgba8_gamma_inv
+    template<class GammaLUT>
+    rgba8 rgba8_gamma_inv(rgba8 c, const GammaLUT& gamma)
+    {
+        return rgba8(gamma.inv(c.r), gamma.inv(c.g), gamma.inv(c.b), c.a);
+    }
 
 
 
 
 
-
-    //=================================================================rgba16
+    //==================================================================rgba16
     struct rgba16
     {
         typedef int16u value_type;
         typedef int32u calc_type;
         typedef int64  long_type;
-        enum
+        enum base_scale_e
         {
             base_shift = 16,
-            base_size  = 1 << base_shift,
-            base_mask  = base_size - 1
+            base_scale = 1 << base_shift,
+            base_mask  = base_scale - 1
         };
         typedef rgba16 self_type;
 
@@ -454,17 +514,17 @@ namespace agg
 
         //--------------------------------------------------------------------
         rgba16(const rgba& c) :
-            r(value_type(c.r * double(base_mask) + 0.5)), 
-            g(value_type(c.g * double(base_mask) + 0.5)), 
-            b(value_type(c.b * double(base_mask) + 0.5)), 
-            a(value_type(c.a * double(base_mask) + 0.5)) {}
+            r((value_type)uround(c.r * double(base_mask))), 
+            g((value_type)uround(c.g * double(base_mask))), 
+            b((value_type)uround(c.b * double(base_mask))), 
+            a((value_type)uround(c.a * double(base_mask))) {}
 
         //--------------------------------------------------------------------
         rgba16(const rgba& c, double a_) :
-            r(value_type(c.r * double(base_mask) + 0.5)), 
-            g(value_type(c.g * double(base_mask) + 0.5)), 
-            b(value_type(c.b * double(base_mask) + 0.5)), 
-            a(value_type(a_  * double(base_mask) + 0.5)) {}
+            r((value_type)uround(c.r * double(base_mask))), 
+            g((value_type)uround(c.g * double(base_mask))), 
+            b((value_type)uround(c.b * double(base_mask))), 
+            a((value_type)uround(a_  * double(base_mask))) {}
 
         //--------------------------------------------------------------------
         rgba16(const rgba8& c) :
@@ -494,11 +554,11 @@ namespace agg
         }
 
         //--------------------------------------------------------------------
-        const self_type& opacity(double a_)
+        AGG_INLINE const self_type& opacity(double a_)
         {
             if(a_ < 0.0) a_ = 0.0;
             if(a_ > 1.0) a_ = 1.0;
-            a = value_type(a_ * double(base_mask) + 0.5);
+            a = (value_type)uround(a_ * double(base_mask));
             return *this;
         }
 
@@ -509,7 +569,7 @@ namespace agg
         }
 
         //--------------------------------------------------------------------
-        const self_type& premultiply()
+        AGG_INLINE const self_type& premultiply()
         {
             if(a == base_mask) return *this;
             if(a == 0)
@@ -524,7 +584,7 @@ namespace agg
         }
 
         //--------------------------------------------------------------------
-        const self_type& premultiply(unsigned a_)
+        AGG_INLINE const self_type& premultiply(unsigned a_)
         {
             if(a == base_mask && a_ >= base_mask) return *this;
             if(a == 0 || a_ == 0)
@@ -543,7 +603,7 @@ namespace agg
         }
 
         //--------------------------------------------------------------------
-        const self_type& demultiply()
+        AGG_INLINE const self_type& demultiply()
         {
             if(a == base_mask) return *this;
             if(a == 0)
@@ -554,17 +614,17 @@ namespace agg
             calc_type r_ = (calc_type(r) * base_mask) / a;
             calc_type g_ = (calc_type(g) * base_mask) / a;
             calc_type b_ = (calc_type(b) * base_mask) / a;
-            r = value_type((r_ > base_mask) ? base_mask : r_);
-            g = value_type((g_ > base_mask) ? base_mask : g_);
-            b = value_type((b_ > base_mask) ? base_mask : b_);
+            r = value_type((r_ > calc_type(base_mask)) ? calc_type(base_mask) : r_);
+            g = value_type((g_ > calc_type(base_mask)) ? calc_type(base_mask) : g_);
+            b = value_type((b_ > calc_type(base_mask)) ? calc_type(base_mask) : b_);
             return *this;
         }
 
         //--------------------------------------------------------------------
-        self_type gradient(const self_type& c, double k) const
+        AGG_INLINE self_type gradient(const self_type& c, double k) const
         {
             self_type ret;
-            calc_type ik = calc_type(k * base_size);
+            calc_type ik = uround(k * base_scale);
             ret.r = value_type(calc_type(r) + (((calc_type(c.r) - r) * ik) >> base_shift));
             ret.g = value_type(calc_type(g) + (((calc_type(c.g) - g) * ik) >> base_shift));
             ret.b = value_type(calc_type(b) + (((calc_type(c.b) - b) * ik) >> base_shift));
@@ -573,6 +633,55 @@ namespace agg
         }
 
         //--------------------------------------------------------------------
+        AGG_INLINE void add(const self_type& c, unsigned cover)
+        {
+            calc_type cr, cg, cb, ca;
+            if(cover == cover_mask)
+            {
+                if(c.a == base_mask) 
+                {
+                    *this = c;
+                }
+                else
+                {
+                    cr = r + c.r; r = (cr > calc_type(base_mask)) ? calc_type(base_mask) : cr;
+                    cg = g + c.g; g = (cg > calc_type(base_mask)) ? calc_type(base_mask) : cg;
+                    cb = b + c.b; b = (cb > calc_type(base_mask)) ? calc_type(base_mask) : cb;
+                    ca = a + c.a; a = (ca > calc_type(base_mask)) ? calc_type(base_mask) : ca;
+                }
+            }
+            else
+            {
+                cr = r + ((c.r * cover + cover_mask) >> cover_shift);
+                cg = g + ((c.g * cover + cover_mask) >> cover_shift);
+                cb = b + ((c.b * cover + cover_mask) >> cover_shift);
+                ca = a + ((c.a * cover + cover_mask) >> cover_shift);
+                r = (cr > calc_type(base_mask)) ? calc_type(base_mask) : cr;
+                g = (cg > calc_type(base_mask)) ? calc_type(base_mask) : cg;
+                b = (cb > calc_type(base_mask)) ? calc_type(base_mask) : cb;
+                a = (ca > calc_type(base_mask)) ? calc_type(base_mask) : ca;
+            }
+        }
+
+        //--------------------------------------------------------------------
+        template<class GammaLUT>
+        AGG_INLINE void apply_gamma_dir(const GammaLUT& gamma)
+        {
+            r = gamma.dir(r);
+            g = gamma.dir(g);
+            b = gamma.dir(b);
+        }
+
+        //--------------------------------------------------------------------
+        template<class GammaLUT>
+        AGG_INLINE void apply_gamma_inv(const GammaLUT& gamma)
+        {
+            r = gamma.inv(r);
+            g = gamma.inv(g);
+            b = gamma.inv(b);
+        }
+
+        //--------------------------------------------------------------------
         static self_type no_color() { return self_type(0,0,0,0); }
 
         //--------------------------------------------------------------------
@@ -611,6 +720,22 @@ namespace agg
         return rgba16(c,a).premultiply();
     }
 
+
+    //------------------------------------------------------rgba16_gamma_dir
+    template<class GammaLUT>
+    rgba16 rgba16_gamma_dir(rgba16 c, const GammaLUT& gamma)
+    {
+        return rgba16(gamma.dir(c.r), gamma.dir(c.g), gamma.dir(c.b), c.a);
+    }
+
+    //------------------------------------------------------rgba16_gamma_inv
+    template<class GammaLUT>
+    rgba16 rgba16_gamma_inv(rgba16 c, const GammaLUT& gamma)
+    {
+        return rgba16(gamma.inv(c.r), gamma.inv(c.g), gamma.inv(c.b), c.a);
+    }
+
+
 }
 
 

Modified: incubator/ooo/trunk/main/agg/inc/agg_config.h
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/agg/inc/agg_config.h?rev=1184758&r1=1184757&r2=1184758&view=diff
==============================================================================
--- incubator/ooo/trunk/main/agg/inc/agg_config.h (original)
+++ incubator/ooo/trunk/main/agg/inc/agg_config.h Sun Oct 16 04:13:16 2011
@@ -1,7 +1,10 @@
 #ifndef AGG_CONFIG_INCLUDED
 #define AGG_CONFIG_INCLUDED
 
-// This file can be used to redefine the default basic types such as:
+// This file can be used to redefine certain data types.
+
+//---------------------------------------
+// 1. Default basic types such as:
 // 
 // AGG_INT8
 // AGG_INT8U
@@ -23,9 +26,23 @@
 // but it won't result any crash and the rest of the library will remain 
 // fully functional.
 
+//---------------------------------------
+// 2. Default rendering_buffer type. Can be:
+//
+// Provides faster access for massive pixel operations, 
+// such as blur, image filtering:
+// #define AGG_RENDERING_BUFFER row_ptr_cache<int8u>
+// 
+// Provides cheaper creation and destruction (no mem allocs):
+// #define AGG_RENDERING_BUFFER row_accessor<int8u>
+//
+// You can still use both of them simultaneouslyin your applications 
+// This #define is used only for default rendering_buffer type,
+// in short hand typedefs like pixfmt_rgba32.
+
 // #i65318# Passing agg version on to clients
 #ifndef AGG_VERSION
-# define AGG_VERSION 2300
+# define AGG_VERSION 2400
 #endif
 
 #endif

Modified: incubator/ooo/trunk/main/agg/inc/agg_conv_adaptor_vcgen.h
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/agg/inc/agg_conv_adaptor_vcgen.h?rev=1184758&r1=1184757&r2=1184758&view=diff
==============================================================================
--- incubator/ooo/trunk/main/agg/inc/agg_conv_adaptor_vcgen.h (original)
+++ incubator/ooo/trunk/main/agg/inc/agg_conv_adaptor_vcgen.h Sun Oct 16 04:13:16 2011
@@ -1,5 +1,5 @@
 //----------------------------------------------------------------------------
-// Anti-Grain Geometry - Version 2.3
+// Anti-Grain Geometry - Version 2.4
 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com)
 //
 // Permission to copy, use, modify, sell and distribute this software 
@@ -17,7 +17,6 @@
 #define AGG_CONV_ADAPTOR_VCGEN_INCLUDED
 
 #include "agg_basics.h"
-#include "agg_vertex_iterator.h"
 
 namespace agg
 {
@@ -30,11 +29,6 @@ namespace agg
 
         void rewind(unsigned) {}
         unsigned vertex(double*, double*) { return path_cmd_stop; }
-
-        typedef null_markers source_type;
-        typedef vertex_iterator<source_type> iterator;
-        iterator begin(unsigned id) { return iterator(*this, id); }
-        iterator end() { return iterator(path_cmd_stop); }
     };
 
 
@@ -51,12 +45,11 @@ namespace agg
         };
 
     public:
-        conv_adaptor_vcgen(VertexSource& source) :
+        explicit conv_adaptor_vcgen(VertexSource& source) :
             m_source(&source), 
             m_status(initial)
         {}
-
-        void set_source(VertexSource& source) { m_source = &source; }
+        void attach(VertexSource& source) { m_source = &source; }
 
         Generator& generator() { return m_generator; }
         const Generator& generator() const { return m_generator; }
@@ -64,19 +57,14 @@ namespace agg
         Markers& markers() { return m_markers; }
         const Markers& markers() const { return m_markers; }
         
-        void rewind(unsigned id) 
+        void rewind(unsigned path_id) 
         { 
-            m_source->rewind(id); 
+            m_source->rewind(path_id); 
             m_status = initial;
         }
 
         unsigned vertex(double* x, double* y);
 
-        typedef conv_adaptor_vcgen<VertexSource, Generator, Markers> source_type;
-        typedef vertex_iterator<source_type> iterator;
-        iterator begin(unsigned id) { return iterator(*this, id); }
-        iterator end() { return iterator(path_cmd_stop); }
-
     private:
         // Prohibit copying
         conv_adaptor_vcgen(const conv_adaptor_vcgen<VertexSource, Generator, Markers>&);

Modified: incubator/ooo/trunk/main/agg/inc/agg_conv_adaptor_vpgen.h
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/agg/inc/agg_conv_adaptor_vpgen.h?rev=1184758&r1=1184757&r2=1184758&view=diff
==============================================================================
--- incubator/ooo/trunk/main/agg/inc/agg_conv_adaptor_vpgen.h (original)
+++ incubator/ooo/trunk/main/agg/inc/agg_conv_adaptor_vpgen.h Sun Oct 16 04:13:16 2011
@@ -1,5 +1,5 @@
 //----------------------------------------------------------------------------
-// Anti-Grain Geometry - Version 2.3
+// Anti-Grain Geometry - Version 2.4
 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com)
 //
 // Permission to copy, use, modify, sell and distribute this software 
@@ -17,7 +17,6 @@
 #define AGG_CONV_ADAPTOR_VPGEN_INCLUDED
 
 #include "agg_basics.h"
-#include "agg_vertex_iterator.h"
 
 namespace agg
 {
@@ -26,9 +25,8 @@ namespace agg
     template<class VertexSource, class VPGen> class conv_adaptor_vpgen
     {
     public:
-        conv_adaptor_vpgen(VertexSource& source) : m_source(&source) {}
-
-        void set_source(VertexSource& source) { m_source = &source; }
+        explicit conv_adaptor_vpgen(VertexSource& source) : m_source(&source) {}
+        void attach(VertexSource& source) { m_source = &source; }
 
         VPGen& vpgen() { return m_vpgen; }
         const VPGen& vpgen() const { return m_vpgen; }
@@ -36,11 +34,6 @@ namespace agg
         void rewind(unsigned path_id);
         unsigned vertex(double* x, double* y);
 
-        typedef conv_adaptor_vpgen<VertexSource, VPGen> source_type;
-        typedef vertex_iterator<source_type> iterator;
-        iterator begin(unsigned id) { return iterator(*this, id); }
-        iterator end() { return iterator(path_cmd_stop); }
-
     private:
         conv_adaptor_vpgen(const conv_adaptor_vpgen<VertexSource, VPGen>&);
         const conv_adaptor_vpgen<VertexSource, VPGen>& 

Modified: incubator/ooo/trunk/main/agg/inc/agg_conv_bspline.h
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/agg/inc/agg_conv_bspline.h?rev=1184758&r1=1184757&r2=1184758&view=diff
==============================================================================
--- incubator/ooo/trunk/main/agg/inc/agg_conv_bspline.h (original)
+++ incubator/ooo/trunk/main/agg/inc/agg_conv_bspline.h Sun Oct 16 04:13:16 2011
@@ -1,5 +1,5 @@
 //----------------------------------------------------------------------------
-// Anti-Grain Geometry - Version 2.3
+// Anti-Grain Geometry - Version 2.4
 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com)
 //
 // Permission to copy, use, modify, sell and distribute this software 

Modified: incubator/ooo/trunk/main/agg/inc/agg_conv_clip_polygon.h
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/agg/inc/agg_conv_clip_polygon.h?rev=1184758&r1=1184757&r2=1184758&view=diff
==============================================================================
--- incubator/ooo/trunk/main/agg/inc/agg_conv_clip_polygon.h (original)
+++ incubator/ooo/trunk/main/agg/inc/agg_conv_clip_polygon.h Sun Oct 16 04:13:16 2011
@@ -1,5 +1,5 @@
 //----------------------------------------------------------------------------
-// Anti-Grain Geometry - Version 2.3
+// Anti-Grain Geometry - Version 2.4
 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com)
 //
 // Permission to copy, use, modify, sell and distribute this software 
@@ -29,7 +29,6 @@
 #include "agg_basics.h"
 #include "agg_conv_adaptor_vpgen.h"
 #include "agg_vpgen_clip_polygon.h"
-#include "agg_vertex_iterator.h"
 
 namespace agg
 {
@@ -53,11 +52,6 @@ namespace agg
         double x2() const { return base_type::vpgen().x2(); }
         double y2() const { return base_type::vpgen().y2(); }
 
-        typedef conv_clip_polygon<VertexSource> source_type;
-        typedef vertex_iterator<source_type> iterator;
-        iterator begin(unsigned id) { return iterator(*this, id); }
-        iterator end() { return iterator(path_cmd_stop); }
-
     private:
         conv_clip_polygon(const conv_clip_polygon<VertexSource>&);
         const conv_clip_polygon<VertexSource>& 

Modified: incubator/ooo/trunk/main/agg/inc/agg_conv_clip_polyline.h
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/agg/inc/agg_conv_clip_polyline.h?rev=1184758&r1=1184757&r2=1184758&view=diff
==============================================================================
--- incubator/ooo/trunk/main/agg/inc/agg_conv_clip_polyline.h (original)
+++ incubator/ooo/trunk/main/agg/inc/agg_conv_clip_polyline.h Sun Oct 16 04:13:16 2011
@@ -1,5 +1,5 @@
 //----------------------------------------------------------------------------
-// Anti-Grain Geometry - Version 2.3
+// Anti-Grain Geometry - Version 2.4
 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com)
 //
 // Permission to copy, use, modify, sell and distribute this software 
@@ -29,7 +29,6 @@
 #include "agg_basics.h"
 #include "agg_conv_adaptor_vpgen.h"
 #include "agg_vpgen_clip_polyline.h"
-#include "agg_vertex_iterator.h"
 
 namespace agg
 {
@@ -53,11 +52,6 @@ namespace agg
         double x2() const { return base_type::vpgen().x2(); }
         double y2() const { return base_type::vpgen().y2(); }
 
-        typedef conv_clip_polyline<VertexSource> source_type;
-        typedef vertex_iterator<source_type> iterator;
-        iterator begin(unsigned id) { return iterator(*this, id); }
-        iterator end() { return iterator(path_cmd_stop); }
-
     private:
         conv_clip_polyline(const conv_clip_polyline<VertexSource>&);
         const conv_clip_polyline<VertexSource>& 

Modified: incubator/ooo/trunk/main/agg/inc/agg_conv_close_polygon.h
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/agg/inc/agg_conv_close_polygon.h?rev=1184758&r1=1184757&r2=1184758&view=diff
==============================================================================
--- incubator/ooo/trunk/main/agg/inc/agg_conv_close_polygon.h (original)
+++ incubator/ooo/trunk/main/agg/inc/agg_conv_close_polygon.h Sun Oct 16 04:13:16 2011
@@ -1,5 +1,5 @@
 //----------------------------------------------------------------------------
-// Anti-Grain Geometry - Version 2.3
+// Anti-Grain Geometry - Version 2.4
 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com)
 //
 // Permission to copy, use, modify, sell and distribute this software 
@@ -17,7 +17,6 @@
 #define AGG_CONV_CLOSE_POLYGON_INCLUDED
 
 #include "agg_basics.h"
-#include "agg_vertex_iterator.h"
 
 namespace agg
 {
@@ -26,18 +25,12 @@ namespace agg
     template<class VertexSource> class conv_close_polygon
     {
     public:
-        conv_close_polygon(VertexSource& vs) : m_source(&vs) {}
-
-        void set_source(VertexSource& source) { m_source = &source; }
+        explicit conv_close_polygon(VertexSource& vs) : m_source(&vs) {}
+        void attach(VertexSource& source) { m_source = &source; }
 
         void rewind(unsigned path_id);
         unsigned vertex(double* x, double* y);
 
-        typedef conv_close_polygon<VertexSource> source_type;
-        typedef vertex_iterator<source_type> iterator;
-        iterator begin(unsigned id) { return iterator(*this, id); }
-        iterator end() { return iterator(path_cmd_stop); }
-
     private:
         conv_close_polygon(const conv_close_polygon<VertexSource>&);
         const conv_close_polygon<VertexSource>& 

Modified: incubator/ooo/trunk/main/agg/inc/agg_conv_concat.h
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/agg/inc/agg_conv_concat.h?rev=1184758&r1=1184757&r2=1184758&view=diff
==============================================================================
--- incubator/ooo/trunk/main/agg/inc/agg_conv_concat.h (original)
+++ incubator/ooo/trunk/main/agg/inc/agg_conv_concat.h Sun Oct 16 04:13:16 2011
@@ -1,5 +1,5 @@
 //----------------------------------------------------------------------------
-// Anti-Grain Geometry - Version 2.3
+// Anti-Grain Geometry - Version 2.4
 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com)
 //
 // Permission to copy, use, modify, sell and distribute this software 
@@ -17,7 +17,6 @@
 #define AGG_CONV_CONCAT_INCLUDED
 
 #include "agg_basics.h"
-#include "agg_vertex_iterator.h"
 
 namespace agg
 {
@@ -29,14 +28,13 @@ namespace agg
     public:
         conv_concat(VS1& source1, VS2& source2) :
             m_source1(&source1), m_source2(&source2), m_status(2) {}
+        void attach1(VS1& source) { m_source1 = &source; }
+        void attach2(VS2& source) { m_source2 = &source; }
 
-        void set_source1(VS1& source) { m_source1 = &source; }
-        void set_source2(VS2& source) { m_source2 = &source; }
 
-
-        void rewind(unsigned id)
+        void rewind(unsigned path_id)
         { 
-            m_source1->rewind(id);
+            m_source1->rewind(path_id);
             m_source2->rewind(0);
             m_status = 0;
         }
@@ -59,11 +57,6 @@ namespace agg
             return path_cmd_stop;
         }
 
-        typedef conv_concat<VS1, VS2> source_type;
-        typedef vertex_iterator<source_type> iterator;
-        iterator begin(unsigned id) { return iterator(*this, id); }
-        iterator end() { return iterator(path_cmd_stop); }
-
     private:
         conv_concat(const conv_concat<VS1, VS2>&);
         const conv_concat<VS1, VS2>& 

Modified: incubator/ooo/trunk/main/agg/inc/agg_conv_contour.h
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/agg/inc/agg_conv_contour.h?rev=1184758&r1=1184757&r2=1184758&view=diff
==============================================================================
--- incubator/ooo/trunk/main/agg/inc/agg_conv_contour.h (original)
+++ incubator/ooo/trunk/main/agg/inc/agg_conv_contour.h Sun Oct 16 04:13:16 2011
@@ -1,5 +1,5 @@
 //----------------------------------------------------------------------------
-// Anti-Grain Geometry - Version 2.3
+// Anti-Grain Geometry - Version 2.4
 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com)
 //
 // Permission to copy, use, modify, sell and distribute this software 
@@ -38,7 +38,7 @@ namespace agg
         }
 
         void line_join(line_join_e lj) { base_type::generator().line_join(lj); }
-        void inner_line_join(line_join_e lj) { base_type::generator().inner_line_join(lj); }
+        void inner_join(inner_join_e ij) { base_type::generator().inner_join(ij); }
         void width(double w) { base_type::generator().width(w); }
         void miter_limit(double ml) { base_type::generator().miter_limit(ml); }
         void miter_limit_theta(double t) { base_type::generator().miter_limit_theta(t); }
@@ -47,7 +47,7 @@ namespace agg
         void auto_detect_orientation(bool v) { base_type::generator().auto_detect_orientation(v); }
 
         line_join_e line_join() const { return base_type::generator().line_join(); }
-        line_join_e inner_line_join() const { return base_type::generator().inner_line_join(); }
+        inner_join_e inner_join() const { return base_type::generator().inner_join(); }
         double width() const { return base_type::generator().width(); }
         double miter_limit() const { return base_type::generator().miter_limit(); }
         double inner_miter_limit() const { return base_type::generator().inner_miter_limit(); }

Modified: incubator/ooo/trunk/main/agg/inc/agg_conv_curve.h
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/agg/inc/agg_conv_curve.h?rev=1184758&r1=1184757&r2=1184758&view=diff
==============================================================================
--- incubator/ooo/trunk/main/agg/inc/agg_conv_curve.h (original)
+++ incubator/ooo/trunk/main/agg/inc/agg_conv_curve.h Sun Oct 16 04:13:16 2011
@@ -1,5 +1,5 @@
 //----------------------------------------------------------------------------
-// Anti-Grain Geometry - Version 2.3
+// Anti-Grain Geometry - Version 2.4
 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com)
 //
 // Permission to copy, use, modify, sell and distribute this software 
@@ -33,14 +33,14 @@ namespace agg
     // and curve4. Curve3 is a conic Bezier curve with 2 endpoints and 1 control
     // point. Curve4 has 2 control points (4 points in total) and can be used
     // to interpolate more complicated curves. Curve4, unlike curve3 can be used 
-    // to approximate arcs, both curcular and elliptical. Curves are approximated 
+    // to approximate arcs, both circular and elliptical. Curves are approximated 
     // with straight lines and one of the approaches is just to store the whole 
     // sequence of vertices that approximate our curve. It takes additional 
     // memory, and at the same time the consecutive vertices can be calculated 
     // on demand. 
     //
     // Initially, path storages are not suppose to keep all the vertices of the
-    // curves (although, nothig prevents us from doing so). Instead, path_storage
+    // curves (although, nothing prevents us from doing so). Instead, path_storage
     // keeps only vertices, needed to calculate a curve on demand. Those vertices
     // are marked with special commands. So, if the path_storage contains curves 
     // (which are not real curves yet), and we render this storage directly, 
@@ -51,13 +51,29 @@ namespace agg
     // Class conv_curve recognizes commands path_cmd_curve3 and path_cmd_curve4 
     // and converts these vertices into a move_to/line_to sequence. 
     //-----------------------------------------------------------------------
-    template<class VertexSource> class conv_curve
+    template<class VertexSource, 
+             class Curve3=curve3, 
+             class Curve4=curve4> class conv_curve
     {
     public:
-        conv_curve(VertexSource& source) :
+        typedef Curve3 curve3_type;
+        typedef Curve4 curve4_type;
+        typedef conv_curve<VertexSource, Curve3, Curve4> self_type;
+
+        explicit conv_curve(VertexSource& source) :
           m_source(&source), m_last_x(0.0), m_last_y(0.0) {}
+        void attach(VertexSource& source) { m_source = &source; }
+
+        void approximation_method(curve_approximation_method_e v) 
+        { 
+            m_curve3.approximation_method(v);
+            m_curve4.approximation_method(v);
+        }
 
-        void set_source(VertexSource& source) { m_source = &source; }
+        curve_approximation_method_e approximation_method() const 
+        { 
+            return m_curve4.approximation_method();
+        }
 
         void approximation_scale(double s) 
         { 
@@ -67,36 +83,52 @@ namespace agg
 
         double approximation_scale() const 
         { 
-            return m_curve3.approximation_scale();  
+            return m_curve4.approximation_scale();  
         }
 
-        void     rewind(unsigned id); 
-        unsigned vertex(double* x, double* y);
+        void angle_tolerance(double v) 
+        { 
+            m_curve3.angle_tolerance(v); 
+            m_curve4.angle_tolerance(v); 
+        }
 
-        typedef conv_curve<VertexSource> source_type;
-        typedef vertex_iterator<source_type> iterator;
-        iterator begin(unsigned id) { return iterator(*this, id); }
-        iterator end() { return iterator(path_cmd_stop); }
+        double angle_tolerance() const 
+        { 
+            return m_curve4.angle_tolerance();  
+        }
+
+        void cusp_limit(double v) 
+        { 
+            m_curve3.cusp_limit(v); 
+            m_curve4.cusp_limit(v); 
+        }
+
+        double cusp_limit() const 
+        { 
+            return m_curve4.cusp_limit();  
+        }
+
+        void     rewind(unsigned path_id); 
+        unsigned vertex(double* x, double* y);
 
     private:
-        conv_curve(const conv_curve<VertexSource>&);
-        const conv_curve<VertexSource>& 
-           operator = (const conv_curve<VertexSource>&);
+        conv_curve(const self_type&);
+        const self_type& operator = (const self_type&);
 
         VertexSource* m_source;
         double        m_last_x;
         double        m_last_y;
-        curve3        m_curve3;
-        curve4        m_curve4;
+        curve3_type   m_curve3;
+        curve4_type   m_curve4;
     };
 
 
 
     //------------------------------------------------------------------------
-    template<class VertexSource>
-    void conv_curve<VertexSource>::rewind(unsigned id)
+    template<class VertexSource, class Curve3, class Curve4>
+    void conv_curve<VertexSource, Curve3, Curve4>::rewind(unsigned path_id)
     {
-        m_source->rewind(id);
+        m_source->rewind(path_id);
         m_last_x = 0.0;
         m_last_y = 0.0;
         m_curve3.reset();
@@ -105,8 +137,8 @@ namespace agg
 
 
     //------------------------------------------------------------------------
-    template<class VertexSource>
-    unsigned conv_curve<VertexSource>::vertex(double* x, double* y)
+    template<class VertexSource, class Curve3, class Curve4>
+    unsigned conv_curve<VertexSource, Curve3, Curve4>::vertex(double* x, double* y)
     {
         if(!is_stop(m_curve3.vertex(x, y)))
         {
@@ -122,21 +154,14 @@ namespace agg
             return path_cmd_line_to;
         }
 
-        double ct2_x = 0;
-        double ct2_y = 0;
-        double end_x = 0;
-        double end_y = 0;
+        double ct2_x;
+        double ct2_y;
+        double end_x;
+        double end_y;
 
         unsigned cmd = m_source->vertex(x, y);
         switch(cmd)
         {
-        case path_cmd_move_to:
-        case path_cmd_line_to:
-            m_last_x = *x;
-            m_last_y = *y;
-        default:
-            break; 
-        
         case path_cmd_curve3:
             m_source->vertex(&end_x, &end_y);
 
@@ -163,6 +188,8 @@ namespace agg
             cmd = path_cmd_line_to;
             break;
         }
+        m_last_x = *x;
+        m_last_y = *y;
         return cmd;
     }
 

Modified: incubator/ooo/trunk/main/agg/inc/agg_conv_dash.h
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/agg/inc/agg_conv_dash.h?rev=1184758&r1=1184757&r2=1184758&view=diff
==============================================================================
--- incubator/ooo/trunk/main/agg/inc/agg_conv_dash.h (original)
+++ incubator/ooo/trunk/main/agg/inc/agg_conv_dash.h Sun Oct 16 04:13:16 2011
@@ -1,5 +1,5 @@
 //----------------------------------------------------------------------------
-// Anti-Grain Geometry - Version 2.3
+// Anti-Grain Geometry - Version 2.4
 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com)
 //
 // Permission to copy, use, modify, sell and distribute this software 

Modified: incubator/ooo/trunk/main/agg/inc/agg_conv_gpc.h
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/agg/inc/agg_conv_gpc.h?rev=1184758&r1=1184757&r2=1184758&view=diff
==============================================================================
--- incubator/ooo/trunk/main/agg/inc/agg_conv_gpc.h (original)
+++ incubator/ooo/trunk/main/agg/inc/agg_conv_gpc.h Sun Oct 16 04:13:16 2011
@@ -1,5 +1,5 @@
 //----------------------------------------------------------------------------
-// Anti-Grain Geometry - Version 2.3
+// Anti-Grain Geometry - Version 2.4
 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com)
 //
 // Permission to copy, use, modify, sell and distribute this software 
@@ -27,7 +27,6 @@
 #include <math.h>
 #include "agg_basics.h"
 #include "agg_array.h"
-#include "agg_vertex_iterator.h"
 
 extern "C" 
 { 
@@ -63,8 +62,8 @@ namespace agg
             gpc_vertex* vertices;
         };
 
-        typedef pod_deque<gpc_vertex, 8>          vertex_array_type;
-        typedef pod_deque<contour_header_type, 6> contour_header_array_type;
+        typedef pod_bvector<gpc_vertex, 8>          vertex_array_type;
+        typedef pod_bvector<contour_header_type, 6> contour_header_array_type;
 
 
     public:
@@ -90,20 +89,15 @@ namespace agg
             memset(&m_result, 0, sizeof(m_result));
         }
 
-        void set_source1(VSA& source) { m_src_a = &source; }
-        void set_source2(VSB& source) { m_src_b = &source; }
+        void attach1(VSA& source) { m_src_a = &source; }
+        void attach2(VSB& source) { m_src_b = &source; }
 
         void operation(gpc_op_e v) { m_operation = v; }
 
         // Vertex Source Interface
-        void     rewind(unsigned id);
+        void     rewind(unsigned path_id);
         unsigned vertex(double* x, double* y);
 
-        // Iterator
-        typedef vertex_iterator<self_type> iterator;
-        iterator begin(unsigned id) { return iterator(*this, id); }
-        iterator end() { return iterator(path_cmd_stop); }
-
     private:
         conv_gpc(const conv_gpc<VSA, VSB>&);
         const conv_gpc<VSA, VSB>& operator = (const conv_gpc<VSA, VSB>&);
@@ -197,10 +191,10 @@ namespace agg
         int i;
         for(i = 0; i < p.num_contours; i++)
         {
-            delete [] p.contour[i].vertex;
+            pod_allocator<gpc_vertex>::deallocate(p.contour[i].vertex, 
+                                                  p.contour[i].num_vertices);
         }
-        delete [] p.hole;
-        delete [] p.contour;
+        pod_allocator<gpc_vertex_list>::deallocate(p.contour, p.num_contours);
         memset(&p, 0, sizeof(gpc_polygon));
     }
 
@@ -266,7 +260,7 @@ namespace agg
                 // TO DO: Clarify the "holes"
                 //if(is_cw(orientation)) h.hole_flag = 1;
 
-                h.vertices = new gpc_vertex [h.num_vertices];
+                h.vertices = pod_allocator<gpc_vertex>::allocate(h.num_vertices);
                 gpc_vertex* d = h.vertices;
                 int i;
                 for(i = 0; i < h.num_vertices; i++)
@@ -294,19 +288,14 @@ namespace agg
         {
             p.num_contours = m_contour_accumulator.size();
 
-            // TO DO: Clarify the "holes"
-            //p.hole = new int[p.num_contours];
             p.hole = 0;
-
-            p.contour = new gpc_vertex_list[p.num_contours];
+            p.contour = pod_allocator<gpc_vertex_list>::allocate(p.num_contours);
 
             int i;
-            //int* ph = p.hole;
             gpc_vertex_list* pv = p.contour;
             for(i = 0; i < p.num_contours; i++)
             {
                 const contour_header_type& h = m_contour_accumulator[i];
-                // *ph++ = h.hole_flag;
                 pv->num_vertices = h.num_vertices;
                 pv->vertex = h.vertices;
                 ++pv;
@@ -356,11 +345,11 @@ namespace agg
 
     //------------------------------------------------------------------------
     template<class VSA, class VSB> 
-    void conv_gpc<VSA, VSB>::rewind(unsigned id)
+    void conv_gpc<VSA, VSB>::rewind(unsigned path_id)
     {
         free_result();
-        m_src_a->rewind(id);
-        m_src_b->rewind(id);
+        m_src_a->rewind(path_id);
+        m_src_b->rewind(path_id);
         add(*m_src_a, m_poly_a);
         add(*m_src_b, m_poly_b);
         switch(m_operation)

Modified: incubator/ooo/trunk/main/agg/inc/agg_conv_marker.h
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/agg/inc/agg_conv_marker.h?rev=1184758&r1=1184757&r2=1184758&view=diff
==============================================================================
--- incubator/ooo/trunk/main/agg/inc/agg_conv_marker.h (original)
+++ incubator/ooo/trunk/main/agg/inc/agg_conv_marker.h Sun Oct 16 04:13:16 2011
@@ -1,5 +1,5 @@
 //----------------------------------------------------------------------------
-// Anti-Grain Geometry - Version 2.3
+// Anti-Grain Geometry - Version 2.4
 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com)
 //
 // Permission to copy, use, modify, sell and distribute this software 
@@ -21,7 +21,6 @@
 
 #include "agg_basics.h"
 #include "agg_trans_affine.h"
-#include "agg_vertex_iterator.h"
 
 namespace agg
 {
@@ -35,14 +34,9 @@ namespace agg
         trans_affine& transform() { return m_transform; }
         const trans_affine& transform() const { return m_transform; }
 
-        void rewind(unsigned id);
+        void rewind(unsigned path_id);
         unsigned vertex(double* x, double* y);
 
-        typedef conv_marker<MarkerLocator, MarkerShapes> source_type;
-        typedef vertex_iterator<source_type> iterator;
-        iterator begin(unsigned id) { return iterator(*this, id); }
-        iterator end() { return iterator(path_cmd_stop); }
-
     private:
         conv_marker(const conv_marker<MarkerLocator, MarkerShapes>&);
         const conv_marker<MarkerLocator, MarkerShapes>& 

Modified: incubator/ooo/trunk/main/agg/inc/agg_conv_marker_adaptor.h
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/agg/inc/agg_conv_marker_adaptor.h?rev=1184758&r1=1184757&r2=1184758&view=diff
==============================================================================
--- incubator/ooo/trunk/main/agg/inc/agg_conv_marker_adaptor.h (original)
+++ incubator/ooo/trunk/main/agg/inc/agg_conv_marker_adaptor.h Sun Oct 16 04:13:16 2011
@@ -1,5 +1,5 @@
 //----------------------------------------------------------------------------
-// Anti-Grain Geometry - Version 2.3
+// Anti-Grain Geometry - Version 2.4
 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com)
 //
 // Permission to copy, use, modify, sell and distribute this software 

Modified: incubator/ooo/trunk/main/agg/inc/agg_conv_segmentator.h
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/agg/inc/agg_conv_segmentator.h?rev=1184758&r1=1184757&r2=1184758&view=diff
==============================================================================
--- incubator/ooo/trunk/main/agg/inc/agg_conv_segmentator.h (original)
+++ incubator/ooo/trunk/main/agg/inc/agg_conv_segmentator.h Sun Oct 16 04:13:16 2011
@@ -1,5 +1,5 @@
 //----------------------------------------------------------------------------
-// Anti-Grain Geometry - Version 2.3
+// Anti-Grain Geometry - Version 2.4
 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com)
 //
 // Permission to copy, use, modify, sell and distribute this software 

Modified: incubator/ooo/trunk/main/agg/inc/agg_conv_shorten_path.h
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/agg/inc/agg_conv_shorten_path.h?rev=1184758&r1=1184757&r2=1184758&view=diff
==============================================================================
--- incubator/ooo/trunk/main/agg/inc/agg_conv_shorten_path.h (original)
+++ incubator/ooo/trunk/main/agg/inc/agg_conv_shorten_path.h Sun Oct 16 04:13:16 2011
@@ -1,5 +1,5 @@
 //----------------------------------------------------------------------------
-// Anti-Grain Geometry - Version 2.3
+// Anti-Grain Geometry - Version 2.4
 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com)
 //
 // Permission to copy, use, modify, sell and distribute this software 

Modified: incubator/ooo/trunk/main/agg/inc/agg_conv_smooth_poly1.h
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/agg/inc/agg_conv_smooth_poly1.h?rev=1184758&r1=1184757&r2=1184758&view=diff
==============================================================================
--- incubator/ooo/trunk/main/agg/inc/agg_conv_smooth_poly1.h (original)
+++ incubator/ooo/trunk/main/agg/inc/agg_conv_smooth_poly1.h Sun Oct 16 04:13:16 2011
@@ -1,5 +1,5 @@
 //----------------------------------------------------------------------------
-// Anti-Grain Geometry - Version 2.3
+// Anti-Grain Geometry - Version 2.4
 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com)
 //
 // Permission to copy, use, modify, sell and distribute this software 

Modified: incubator/ooo/trunk/main/agg/inc/agg_conv_stroke.h
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/agg/inc/agg_conv_stroke.h?rev=1184758&r1=1184757&r2=1184758&view=diff
==============================================================================
--- incubator/ooo/trunk/main/agg/inc/agg_conv_stroke.h (original)
+++ incubator/ooo/trunk/main/agg/inc/agg_conv_stroke.h Sun Oct 16 04:13:16 2011
@@ -1,5 +1,5 @@
 //----------------------------------------------------------------------------
-// Anti-Grain Geometry - Version 2.3
+// Anti-Grain Geometry - Version 2.4
 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com)
 //
 // Permission to copy, use, modify, sell and distribute this software 
@@ -39,13 +39,13 @@ namespace agg
         {
         }
 
-        void line_cap(line_cap_e lc)         { base_type::generator().line_cap(lc);  }
-        void line_join(line_join_e lj)       { base_type::generator().line_join(lj); }
-        void inner_line_join(line_join_e lj) { base_type::generator().inner_line_join(lj); }
-
-        line_cap_e  line_cap()        const { return base_type::generator().line_cap();  }
-        line_join_e line_join()       const { return base_type::generator().line_join(); }
-        line_join_e inner_line_join() const { return base_type::generator().inner_line_join(); }
+        void line_cap(line_cap_e lc)     { base_type::generator().line_cap(lc);  }
+        void line_join(line_join_e lj)   { base_type::generator().line_join(lj); }
+        void inner_join(inner_join_e ij) { base_type::generator().inner_join(ij); }
+
+        line_cap_e   line_cap()   const { return base_type::generator().line_cap();  }
+        line_join_e  line_join()  const { return base_type::generator().line_join(); }
+        inner_join_e inner_join() const { return base_type::generator().inner_join(); }
 
         void width(double w) { base_type::generator().width(w); }
         void miter_limit(double ml) { base_type::generator().miter_limit(ml); }

Modified: incubator/ooo/trunk/main/agg/inc/agg_conv_transform.h
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/agg/inc/agg_conv_transform.h?rev=1184758&r1=1184757&r2=1184758&view=diff
==============================================================================
--- incubator/ooo/trunk/main/agg/inc/agg_conv_transform.h (original)
+++ incubator/ooo/trunk/main/agg/inc/agg_conv_transform.h Sun Oct 16 04:13:16 2011
@@ -1,5 +1,5 @@
 //----------------------------------------------------------------------------
-// Anti-Grain Geometry - Version 2.3
+// Anti-Grain Geometry - Version 2.4
 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com)
 //
 // Permission to copy, use, modify, sell and distribute this software 
@@ -21,7 +21,6 @@
 
 #include "agg_basics.h"
 #include "agg_trans_affine.h"
-#include "agg_vertex_iterator.h"
 
 namespace agg
 {
@@ -32,12 +31,11 @@ namespace agg
     public:
         conv_transform(VertexSource& source, const Transformer& tr) :
             m_source(&source), m_trans(&tr) {}
+        void attach(VertexSource& source) { m_source = &source; }
 
-        void set_source(VertexSource& source) { m_source = &source; }
-
-        void rewind(unsigned id) 
+        void rewind(unsigned path_id) 
         { 
-            m_source->rewind(id); 
+            m_source->rewind(path_id); 
         }
 
         unsigned vertex(double* x, double* y)
@@ -55,11 +53,6 @@ namespace agg
             m_trans = &tr;
         }
 
-        typedef conv_transform<VertexSource, Transformer> source_type;
-        typedef vertex_iterator<source_type> iterator;
-        iterator begin(unsigned id) { return iterator(*this, id); }
-        iterator end() { return iterator(path_cmd_stop); }
-
     private:
         conv_transform(const conv_transform<VertexSource>&);
         const conv_transform<VertexSource>& 

Modified: incubator/ooo/trunk/main/agg/inc/agg_conv_unclose_polygon.h
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/agg/inc/agg_conv_unclose_polygon.h?rev=1184758&r1=1184757&r2=1184758&view=diff
==============================================================================
--- incubator/ooo/trunk/main/agg/inc/agg_conv_unclose_polygon.h (original)
+++ incubator/ooo/trunk/main/agg/inc/agg_conv_unclose_polygon.h Sun Oct 16 04:13:16 2011
@@ -1,5 +1,5 @@
 //----------------------------------------------------------------------------
-// Anti-Grain Geometry - Version 2.3
+// Anti-Grain Geometry - Version 2.4
 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com)
 //
 // Permission to copy, use, modify, sell and distribute this software 
@@ -17,7 +17,6 @@
 #define AGG_CONV_UNCLOSE_POLYGON_INCLUDED
 
 #include "agg_basics.h"
-#include "agg_vertex_iterator.h"
 
 namespace agg
 {
@@ -25,9 +24,8 @@ namespace agg
     template<class VertexSource> class conv_unclose_polygon
     {
     public:
-        conv_unclose_polygon(VertexSource& vs) : m_source(&vs) {}
-
-        void set_source(VertexSource& source) { m_source = &source; }
+        explicit conv_unclose_polygon(VertexSource& vs) : m_source(&vs) {}
+        void attach(VertexSource& source) { m_source = &source; }
 
         void rewind(unsigned path_id)
         {
@@ -41,11 +39,6 @@ namespace agg
             return cmd;
         }
 
-        typedef conv_unclose_polygon<VertexSource> source_type;
-        typedef vertex_iterator<source_type> iterator;
-        iterator begin(unsigned id) { return iterator(*this, id); }
-        iterator end() { return iterator(path_cmd_stop); }
-
     private:
         conv_unclose_polygon(const conv_unclose_polygon<VertexSource>&);
         const conv_unclose_polygon<VertexSource>& 

Modified: incubator/ooo/trunk/main/agg/inc/agg_curves.h
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/agg/inc/agg_curves.h?rev=1184758&r1=1184757&r2=1184758&view=diff
==============================================================================
--- incubator/ooo/trunk/main/agg/inc/agg_curves.h (original)
+++ incubator/ooo/trunk/main/agg/inc/agg_curves.h Sun Oct 16 04:13:16 2011
@@ -1,6 +1,7 @@
 //----------------------------------------------------------------------------
-// Anti-Grain Geometry - Version 2.3
+// Anti-Grain Geometry - Version 2.4
 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com)
+// Copyright (C) 2005 Tony Juricic (tonygeek@yahoo.com)
 //
 // Permission to copy, use, modify, sell and distribute this software 
 // is granted provided this copyright notice appears in all copies. 
@@ -12,34 +13,35 @@
 //          mcseemagg@yahoo.com
 //          http://www.antigrain.com
 //----------------------------------------------------------------------------
-//
-// classes curve3 and curve4
-//
-//----------------------------------------------------------------------------
 
 #ifndef AGG_CURVES_INCLUDED
 #define AGG_CURVES_INCLUDED
 
-#include "agg_basics.h"
-#include "agg_vertex_iterator.h"
+#include "agg_array.h"
 
 namespace agg
 {
 
-    // See Implemantation agg_curves.cpp
+    // See Implementation agg_curves.cpp
 
+    //--------------------------------------------curve_approximation_method_e
+    enum curve_approximation_method_e
+    {
+        curve_inc,
+        curve_div
+    };
     
-    //------------------------------------------------------------------curve3
-    class curve3
+    //--------------------------------------------------------------curve3_inc
+    class curve3_inc
     {
     public:
-        curve3() :
+        curve3_inc() :
           m_num_steps(0), m_step(0), m_scale(1.0) { }
 
-        curve3(double x1, double y1, 
-               double x2, double y2, 
-               double x3, double y3) :
-          m_num_steps(0), m_step(0), m_scale(1.0) 
+        curve3_inc(double x1, double y1, 
+                   double x2, double y2, 
+                   double x3, double y3) :
+            m_num_steps(0), m_step(0), m_scale(1.0) 
         { 
             init(x1, y1, x2, y2, x3, y3);
         }
@@ -48,16 +50,21 @@ namespace agg
         void init(double x1, double y1, 
                   double x2, double y2, 
                   double x3, double y3);
-        void approximation_scale(double s) { m_scale = s; }
-        double approximation_scale() const { return m_scale;  }
 
-        void     rewind(unsigned id);
-        unsigned vertex(double* x, double* y);
+        void approximation_method(curve_approximation_method_e) {}
+        curve_approximation_method_e approximation_method() const { return curve_inc; }
+
+        void approximation_scale(double s);
+        double approximation_scale() const;
 
-        typedef curve3 source_type;
-        typedef vertex_iterator<source_type> iterator;
-        iterator begin(unsigned id) { return iterator(*this, id); }
-        iterator end() { return iterator(path_cmd_stop); }
+        void angle_tolerance(double) {}
+        double angle_tolerance() const { return 0.0; }
+
+        void cusp_limit(double) {}
+        double cusp_limit() const { return 0.0; }
+
+        void     rewind(unsigned path_id);
+        unsigned vertex(double* x, double* y);
 
     private:
         int      m_num_steps;
@@ -83,40 +90,153 @@ namespace agg
 
 
 
+    //-------------------------------------------------------------curve3_div
+    class curve3_div
+    {
+    public:
+        curve3_div() : 
+            m_approximation_scale(1.0),
+            m_angle_tolerance(0.0),
+            m_count(0)
+        {}
+
+        curve3_div(double x1, double y1, 
+                   double x2, double y2, 
+                   double x3, double y3) :
+            m_approximation_scale(1.0),
+            m_angle_tolerance(0.0),
+            m_count(0)
+        { 
+            init(x1, y1, x2, y2, x3, y3);
+        }
+
+        void reset() { m_points.remove_all(); m_count = 0; }
+        void init(double x1, double y1, 
+                  double x2, double y2, 
+                  double x3, double y3);
 
+        void approximation_method(curve_approximation_method_e) {}
+        curve_approximation_method_e approximation_method() const { return curve_div; }
 
-    //-----------------------------------------------------------------curve4
-    class curve4
+        void approximation_scale(double s) { m_approximation_scale = s; }
+        double approximation_scale() const { return m_approximation_scale;  }
+
+        void angle_tolerance(double a) { m_angle_tolerance = a; }
+        double angle_tolerance() const { return m_angle_tolerance;  }
+
+        void cusp_limit(double) {}
+        double cusp_limit() const { return 0.0; }
+
+        void rewind(unsigned)
+        {
+            m_count = 0;
+        }
+
+        unsigned vertex(double* x, double* y)
+        {
+            if(m_count >= m_points.size()) return path_cmd_stop;
+            const point_d& p = m_points[m_count++];
+            *x = p.x;
+            *y = p.y;
+            return (m_count == 1) ? path_cmd_move_to : path_cmd_line_to;
+        }
+
+    private:
+        void bezier(double x1, double y1, 
+                    double x2, double y2, 
+                    double x3, double y3);
+        void recursive_bezier(double x1, double y1, 
+                              double x2, double y2, 
+                              double x3, double y3,
+                              unsigned level);
+
+        double               m_approximation_scale;
+        double               m_distance_tolerance_square;
+        double               m_angle_tolerance;
+        unsigned             m_count;
+        pod_bvector<point_d> m_points;
+    };
+
+
+
+
+
+
+
+    //-------------------------------------------------------------curve4_points
+    struct curve4_points
+    {
+        double cp[8];
+        curve4_points() {}
+        curve4_points(double x1, double y1,
+                      double x2, double y2,
+                      double x3, double y3,
+                      double x4, double y4)
+        {
+            cp[0] = x1; cp[1] = y1; cp[2] = x2; cp[3] = y2;
+            cp[4] = x3; cp[5] = y3; cp[6] = x4; cp[7] = y4;
+        }
+        void init(double x1, double y1,
+                  double x2, double y2,
+                  double x3, double y3,
+                  double x4, double y4)
+        {
+            cp[0] = x1; cp[1] = y1; cp[2] = x2; cp[3] = y2;
+            cp[4] = x3; cp[5] = y3; cp[6] = x4; cp[7] = y4;
+        }
+        double  operator [] (unsigned i) const { return cp[i]; }
+        double& operator [] (unsigned i)       { return cp[i]; }
+    };
+
+
+
+    //-------------------------------------------------------------curve4_inc
+    class curve4_inc
     {
     public:
-        curve4() :
-          m_num_steps(0), m_step(0), m_scale(1.0) { }
+        curve4_inc() :
+            m_num_steps(0), m_step(0), m_scale(1.0) { }
 
-        curve4(double x1, double y1, 
-               double x2, double y2, 
-               double x3, double y3,
-               double x4, double y4) :
-          m_num_steps(0), m_step(0), m_scale(1.0) 
+        curve4_inc(double x1, double y1, 
+                   double x2, double y2, 
+                   double x3, double y3,
+                   double x4, double y4) :
+            m_num_steps(0), m_step(0), m_scale(1.0) 
         { 
             init(x1, y1, x2, y2, x3, y3, x4, y4);
         }
 
+        curve4_inc(const curve4_points& cp) :
+            m_num_steps(0), m_step(0), m_scale(1.0) 
+        { 
+            init(cp[0], cp[1], cp[2], cp[3], cp[4], cp[5], cp[6], cp[7]);
+        }
+
         void reset() { m_num_steps = 0; m_step = -1; }
         void init(double x1, double y1, 
                   double x2, double y2, 
                   double x3, double y3,
                   double x4, double y4);
 
-        void approximation_scale(double s) { m_scale = s; }
-        double approximation_scale() const { return m_scale;  }
+        void init(const curve4_points& cp)
+        {
+            init(cp[0], cp[1], cp[2], cp[3], cp[4], cp[5], cp[6], cp[7]);
+        }
 
-        void     rewind(unsigned id);
-        unsigned vertex(double* x, double* y);
+        void approximation_method(curve_approximation_method_e) {}
+        curve_approximation_method_e approximation_method() const { return curve_inc; }
+
+        void approximation_scale(double s);
+        double approximation_scale() const;
+
+        void angle_tolerance(double) {}
+        double angle_tolerance() const { return 0.0; }
 
-        typedef curve4 source_type;
-        typedef vertex_iterator<source_type> iterator;
-        iterator begin(unsigned id) { return iterator(*this, id); }
-        iterator end() { return iterator(path_cmd_stop); }
+        void cusp_limit(double) {}
+        double cusp_limit() const { return 0.0; }
+
+        void     rewind(unsigned path_id);
+        unsigned vertex(double* x, double* y);
 
     private:
         int      m_num_steps;
@@ -144,6 +264,429 @@ namespace agg
 
 
 
+    //-------------------------------------------------------catrom_to_bezier
+    inline curve4_points catrom_to_bezier(double x1, double y1, 
+                                          double x2, double y2, 
+                                          double x3, double y3,
+                                          double x4, double y4)
+    {
+        // Trans. matrix Catmull-Rom to Bezier
+        //
+        //  0       1       0       0
+        //  -1/6    1       1/6     0
+        //  0       1/6     1       -1/6
+        //  0       0       1       0
+        //
+        return curve4_points(
+            x2,
+            y2,
+            (-x1 + 6*x2 + x3) / 6,
+            (-y1 + 6*y2 + y3) / 6,
+            ( x2 + 6*x3 - x4) / 6,
+            ( y2 + 6*y3 - y4) / 6,
+            x3,
+            y3);
+    }
+
+
+    //-----------------------------------------------------------------------
+    inline curve4_points
+    catrom_to_bezier(const curve4_points& cp)
+    {
+        return catrom_to_bezier(cp[0], cp[1], cp[2], cp[3], 
+                                cp[4], cp[5], cp[6], cp[7]);
+    }
+
+
+
+    //-----------------------------------------------------ubspline_to_bezier
+    inline curve4_points ubspline_to_bezier(double x1, double y1, 
+                                            double x2, double y2, 
+                                            double x3, double y3,
+                                            double x4, double y4)
+    {
+        // Trans. matrix Uniform BSpline to Bezier
+        //
+        //  1/6     4/6     1/6     0
+        //  0       4/6     2/6     0
+        //  0       2/6     4/6     0
+        //  0       1/6     4/6     1/6
+        //
+        return curve4_points(
+            (x1 + 4*x2 + x3) / 6,
+            (y1 + 4*y2 + y3) / 6,
+            (4*x2 + 2*x3) / 6,
+            (4*y2 + 2*y3) / 6,
+            (2*x2 + 4*x3) / 6,
+            (2*y2 + 4*y3) / 6,
+            (x2 + 4*x3 + x4) / 6,
+            (y2 + 4*y3 + y4) / 6);
+    }
+
+
+    //-----------------------------------------------------------------------
+    inline curve4_points 
+    ubspline_to_bezier(const curve4_points& cp)
+    {
+        return ubspline_to_bezier(cp[0], cp[1], cp[2], cp[3], 
+                                  cp[4], cp[5], cp[6], cp[7]);
+    }
+
+
+
+
+    //------------------------------------------------------hermite_to_bezier
+    inline curve4_points hermite_to_bezier(double x1, double y1, 
+                                           double x2, double y2, 
+                                           double x3, double y3,
+                                           double x4, double y4)
+    {
+        // Trans. matrix Hermite to Bezier
+        //
+        //  1       0       0       0
+        //  1       0       1/3     0
+        //  0       1       0       -1/3
+        //  0       1       0       0
+        //
+        return curve4_points(
+            x1,
+            y1,
+            (3*x1 + x3) / 3,
+            (3*y1 + y3) / 3,
+            (3*x2 - x4) / 3,
+            (3*y2 - y4) / 3,
+            x2,
+            y2);
+    }
+
+
+
+    //-----------------------------------------------------------------------
+    inline curve4_points 
+    hermite_to_bezier(const curve4_points& cp)
+    {
+        return hermite_to_bezier(cp[0], cp[1], cp[2], cp[3], 
+                                 cp[4], cp[5], cp[6], cp[7]);
+    }
+
+
+    //-------------------------------------------------------------curve4_div
+    class curve4_div
+    {
+    public:
+        curve4_div() : 
+            m_approximation_scale(1.0),
+            m_angle_tolerance(0.0),
+            m_cusp_limit(0.0),
+            m_count(0)
+        {}
+
+        curve4_div(double x1, double y1, 
+                   double x2, double y2, 
+                   double x3, double y3,
+                   double x4, double y4) :
+            m_approximation_scale(1.0),
+            m_angle_tolerance(0.0),
+            m_cusp_limit(0.0),
+            m_count(0)
+        { 
+            init(x1, y1, x2, y2, x3, y3, x4, y4);
+        }
+
+        curve4_div(const curve4_points& cp) :
+            m_approximation_scale(1.0),
+            m_angle_tolerance(0.0),
+            m_count(0)
+        { 
+            init(cp[0], cp[1], cp[2], cp[3], cp[4], cp[5], cp[6], cp[7]);
+        }
+
+        void reset() { m_points.remove_all(); m_count = 0; }
+        void init(double x1, double y1, 
+                  double x2, double y2, 
+                  double x3, double y3,
+                  double x4, double y4);
+
+        void init(const curve4_points& cp)
+        {
+            init(cp[0], cp[1], cp[2], cp[3], cp[4], cp[5], cp[6], cp[7]);
+        }
+
+        void approximation_method(curve_approximation_method_e) {}
+
+        curve_approximation_method_e approximation_method() const 
+        { 
+            return curve_div; 
+        }
+
+        void approximation_scale(double s) { m_approximation_scale = s; }
+        double approximation_scale() const { return m_approximation_scale;  }
+
+        void angle_tolerance(double a) { m_angle_tolerance = a; }
+        double angle_tolerance() const { return m_angle_tolerance;  }
+
+        void cusp_limit(double v) 
+        { 
+            m_cusp_limit = (v == 0.0) ? 0.0 : pi - v; 
+        }
+
+        double cusp_limit() const 
+        { 
+            return (m_cusp_limit == 0.0) ? 0.0 : pi - m_cusp_limit; 
+        }
+
+        void rewind(unsigned)
+        {
+            m_count = 0;
+        }
+
+        unsigned vertex(double* x, double* y)
+        {
+            if(m_count >= m_points.size()) return path_cmd_stop;
+            const point_d& p = m_points[m_count++];
+            *x = p.x;
+            *y = p.y;
+            return (m_count == 1) ? path_cmd_move_to : path_cmd_line_to;
+        }
+
+    private:
+        void bezier(double x1, double y1, 
+                    double x2, double y2, 
+                    double x3, double y3, 
+                    double x4, double y4);
+
+        void recursive_bezier(double x1, double y1, 
+                              double x2, double y2, 
+                              double x3, double y3, 
+                              double x4, double y4,
+                              unsigned level);
+
+        double               m_approximation_scale;
+        double               m_distance_tolerance_square;
+        double               m_angle_tolerance;
+        double               m_cusp_limit;
+        unsigned             m_count;
+        pod_bvector<point_d> m_points;
+    };
+
+
+    //-----------------------------------------------------------------curve3
+    class curve3
+    {
+    public:
+        curve3() : m_approximation_method(curve_div) {}
+        curve3(double x1, double y1, 
+               double x2, double y2, 
+               double x3, double y3) :
+            m_approximation_method(curve_div)
+        { 
+            init(x1, y1, x2, y2, x3, y3);
+        }
+
+        void reset() 
+        { 
+            m_curve_inc.reset();
+            m_curve_div.reset();
+        }
+
+        void init(double x1, double y1, 
+                  double x2, double y2, 
+                  double x3, double y3)
+        {
+            if(m_approximation_method == curve_inc) 
+            {
+                m_curve_inc.init(x1, y1, x2, y2, x3, y3);
+            }
+            else
+            {
+                m_curve_div.init(x1, y1, x2, y2, x3, y3);
+            }
+        }
+
+        void approximation_method(curve_approximation_method_e v) 
+        { 
+            m_approximation_method = v; 
+        }
+
+        curve_approximation_method_e approximation_method() const 
+        { 
+            return m_approximation_method; 
+        }
+
+        void approximation_scale(double s) 
+        { 
+            m_curve_inc.approximation_scale(s);
+            m_curve_div.approximation_scale(s);
+        }
+
+        double approximation_scale() const 
+        { 
+            return m_curve_inc.approximation_scale(); 
+        }
+
+        void angle_tolerance(double a) 
+        { 
+            m_curve_div.angle_tolerance(a); 
+        }
+
+        double angle_tolerance() const 
+        { 
+            return m_curve_div.angle_tolerance(); 
+        }
+
+        void cusp_limit(double v) 
+        { 
+            m_curve_div.cusp_limit(v); 
+        }
+
+        double cusp_limit() const 
+        { 
+            return m_curve_div.cusp_limit();  
+        }
+
+        void rewind(unsigned path_id)
+        {
+            if(m_approximation_method == curve_inc) 
+            {
+                m_curve_inc.rewind(path_id);
+            }
+            else
+            {
+                m_curve_div.rewind(path_id);
+            }
+        }
+
+        unsigned vertex(double* x, double* y)
+        {
+            if(m_approximation_method == curve_inc) 
+            {
+                return m_curve_inc.vertex(x, y);
+            }
+            return m_curve_div.vertex(x, y);
+        }
+
+    private:
+        curve3_inc m_curve_inc;
+        curve3_div m_curve_div;
+        curve_approximation_method_e m_approximation_method;
+    };
+
+
+
+
+
+    //-----------------------------------------------------------------curve4
+    class curve4
+    {
+    public:
+        curve4() : m_approximation_method(curve_div) {}
+        curve4(double x1, double y1, 
+               double x2, double y2, 
+               double x3, double y3,
+               double x4, double y4) : 
+            m_approximation_method(curve_div)
+        { 
+            init(x1, y1, x2, y2, x3, y3, x4, y4);
+        }
+
+        curve4(const curve4_points& cp) :
+            m_approximation_method(curve_div)
+        { 
+            init(cp[0], cp[1], cp[2], cp[3], cp[4], cp[5], cp[6], cp[7]);
+        }
+
+        void reset() 
+        { 
+            m_curve_inc.reset();
+            m_curve_div.reset();
+        }
+
+        void init(double x1, double y1, 
+                  double x2, double y2, 
+                  double x3, double y3,
+                  double x4, double y4)
+        {
+            if(m_approximation_method == curve_inc) 
+            {
+                m_curve_inc.init(x1, y1, x2, y2, x3, y3, x4, y4);
+            }
+            else
+            {
+                m_curve_div.init(x1, y1, x2, y2, x3, y3, x4, y4);
+            }
+        }
+
+        void init(const curve4_points& cp)
+        {
+            init(cp[0], cp[1], cp[2], cp[3], cp[4], cp[5], cp[6], cp[7]);
+        }
+
+        void approximation_method(curve_approximation_method_e v) 
+        { 
+            m_approximation_method = v; 
+        }
+
+        curve_approximation_method_e approximation_method() const 
+        { 
+            return m_approximation_method; 
+        }
+
+        void approximation_scale(double s) 
+        { 
+            m_curve_inc.approximation_scale(s);
+            m_curve_div.approximation_scale(s);
+        }
+        double approximation_scale() const { return m_curve_inc.approximation_scale(); }
+
+        void angle_tolerance(double v) 
+        { 
+            m_curve_div.angle_tolerance(v); 
+        }
+
+        double angle_tolerance() const 
+        { 
+            return m_curve_div.angle_tolerance();  
+        }
+
+        void cusp_limit(double v) 
+        { 
+            m_curve_div.cusp_limit(v); 
+        }
+
+        double cusp_limit() const 
+        { 
+            return m_curve_div.cusp_limit();  
+        }
+
+        void rewind(unsigned path_id)
+        {
+            if(m_approximation_method == curve_inc) 
+            {
+                m_curve_inc.rewind(path_id);
+            }
+            else
+            {
+                m_curve_div.rewind(path_id);
+            }
+        }
+
+        unsigned vertex(double* x, double* y)
+        {
+            if(m_approximation_method == curve_inc) 
+            {
+                return m_curve_inc.vertex(x, y);
+            }
+            return m_curve_div.vertex(x, y);
+        }
+
+    private:
+        curve4_inc m_curve_inc;
+        curve4_div m_curve_div;
+        curve_approximation_method_e m_approximation_method;
+    };
+
+
+
 
 }
 

Modified: incubator/ooo/trunk/main/agg/inc/agg_dda_line.h
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/agg/inc/agg_dda_line.h?rev=1184758&r1=1184757&r2=1184758&view=diff
==============================================================================
--- incubator/ooo/trunk/main/agg/inc/agg_dda_line.h (original)
+++ incubator/ooo/trunk/main/agg/inc/agg_dda_line.h Sun Oct 16 04:13:16 2011
@@ -1,5 +1,5 @@
 //----------------------------------------------------------------------------
-// Anti-Grain Geometry - Version 2.3
+// Anti-Grain Geometry - Version 2.4
 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com)
 //
 // Permission to copy, use, modify, sell and distribute this software 
@@ -86,7 +86,7 @@ namespace agg
     {
     public:
         typedef int save_data_type;
-        enum { save_size = 2 };
+        enum save_size_e { save_size = 2 };
 
         //--------------------------------------------------------------------
         dda2_line_interpolator() {}
@@ -125,10 +125,10 @@ namespace agg
         }
 
         //-------------------------------------------- Backward-adjusted line
-        dda2_line_interpolator(int _y, int count) :
+        dda2_line_interpolator(int y, int count) :
             m_cnt(count <= 0 ? 1 : count),
-            m_lft(_y / m_cnt),
-            m_rem(_y % m_cnt),
+            m_lft(y / m_cnt),
+            m_rem(y % m_cnt),
             m_mod(m_rem),
             m_y(0)
         {
@@ -217,28 +217,28 @@ namespace agg
     class line_bresenham_interpolator
     {
     public:
-        enum
+        enum subpixel_scale_e
         {
             subpixel_shift = 8,
-            subpixel_size  = 1 << subpixel_shift,
-            subpixel_mask  = subpixel_size - 1
+            subpixel_scale = 1 << subpixel_shift,
+            subpixel_mask  = subpixel_scale - 1
         };
 
         //--------------------------------------------------------------------
         static int line_lr(int v) { return v >> subpixel_shift; }
 
         //--------------------------------------------------------------------
-        line_bresenham_interpolator(int _x1, int _y1, int _x2, int _y2) :
-            m_x1_lr(line_lr(_x1)),
-            m_y1_lr(line_lr(_y1)),
-            m_x2_lr(line_lr(_x2)),
-            m_y2_lr(line_lr(_y2)),
+        line_bresenham_interpolator(int x1, int y1, int x2, int y2) :
+            m_x1_lr(line_lr(x1)),
+            m_y1_lr(line_lr(y1)),
+            m_x2_lr(line_lr(x2)),
+            m_y2_lr(line_lr(y2)),
             m_ver(abs(m_x2_lr - m_x1_lr) < abs(m_y2_lr - m_y1_lr)),
             m_len(m_ver ? abs(m_y2_lr - m_y1_lr) : 
                           abs(m_x2_lr - m_x1_lr)),
-            m_inc(m_ver ? ((_y2 > _y1) ? 1 : -1) : ((_x2 > _x1) ? 1 : -1)),
-            m_interpolator(m_ver ? _x1 : _y1, 
-                           m_ver ? _x2 : _y2, 
+            m_inc(m_ver ? ((y2 > y1) ? 1 : -1) : ((x2 > x1) ? 1 : -1)),
+            m_interpolator(m_ver ? x1 : y1, 
+                           m_ver ? x2 : y2, 
                            m_len)
         {
         }

Modified: incubator/ooo/trunk/main/agg/inc/agg_ellipse.h
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/agg/inc/agg_ellipse.h?rev=1184758&r1=1184757&r2=1184758&view=diff
==============================================================================
--- incubator/ooo/trunk/main/agg/inc/agg_ellipse.h (original)
+++ incubator/ooo/trunk/main/agg/inc/agg_ellipse.h Sun Oct 16 04:13:16 2011
@@ -1,5 +1,5 @@
 //----------------------------------------------------------------------------
-// Anti-Grain Geometry - Version 2.3
+// Anti-Grain Geometry - Version 2.4
 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com)
 //
 // Permission to copy, use, modify, sell and distribute this software 
@@ -30,27 +30,41 @@ namespace agg
     class ellipse
     {
     public:
-        ellipse() : m_x(0.0), m_y(0.0), m_rx(1.0), m_ry(1.0), m_num(4), m_step(0) {}
-        ellipse(double x, double y, double rx, double ry, unsigned num_steps) 
-            : m_x(x), m_y(y), m_rx(rx), m_ry(ry), m_num(num_steps), m_step(0) {}
+        ellipse() : 
+            m_x(0.0), m_y(0.0), m_rx(1.0), m_ry(1.0), m_scale(1.0), 
+            m_num(4), m_step(0), m_cw(false) {}
+
+        ellipse(double x, double y, double rx, double ry, 
+                unsigned num_steps=0, bool cw=false) :
+            m_x(x), m_y(y), m_rx(rx), m_ry(ry), m_scale(1.0), 
+            m_num(num_steps), m_step(0), m_cw(cw) 
+        {
+            if(m_num == 0) calc_num_steps();
+        }
+
+        void init(double x, double y, double rx, double ry, 
+                  unsigned num_steps=0, bool cw=false);
 
-        void init(double x, double y, double rx, double ry, unsigned num_steps);
         void approximation_scale(double scale);
-        void rewind(unsigned id);
+        void rewind(unsigned path_id);
         unsigned vertex(double* x, double* y);
 
     private:
+        void calc_num_steps();
+
         double m_x;
         double m_y;
         double m_rx;
         double m_ry;
+        double m_scale;
         unsigned m_num;
         unsigned m_step;
+        bool m_cw;
     };
 
-
     //------------------------------------------------------------------------
-    inline void ellipse::init(double x, double y, double rx, double ry, unsigned num_steps)
+    inline void ellipse::init(double x, double y, double rx, double ry, 
+                              unsigned num_steps, bool cw)
     {
         m_x = x;
         m_y = y;
@@ -58,13 +72,23 @@ namespace agg
         m_ry = ry;
         m_num = num_steps;
         m_step = 0;
+        m_cw = cw;
+        if(m_num == 0) calc_num_steps();
     }
 
     //------------------------------------------------------------------------
     inline void ellipse::approximation_scale(double scale)
     {   
-       m_num = unsigned((fabs(m_rx) + fabs(m_ry) + 6.0) * scale);
-       if(m_num < 6) m_num = 6;
+        m_scale = scale;
+        calc_num_steps();
+    }
+
+    //------------------------------------------------------------------------
+    inline void ellipse::calc_num_steps()
+    {
+        double ra = (fabs(m_rx) + fabs(m_ry)) / 2;
+        double da = acos(ra / (ra + 0.125 / m_scale)) * 2;
+        m_num = uround(2*pi / da);
     }
 
     //------------------------------------------------------------------------
@@ -83,6 +107,7 @@ namespace agg
         }
         if(m_step > m_num) return path_cmd_stop;
         double angle = double(m_step) / double(m_num) * 2.0 * pi;
+        if(m_cw) angle = 2.0 * pi - angle;
         *x = m_x + cos(angle) * m_rx;
         *y = m_y + sin(angle) * m_ry;
         m_step++;

Modified: incubator/ooo/trunk/main/agg/inc/agg_ellipse_bresenham.h
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/agg/inc/agg_ellipse_bresenham.h?rev=1184758&r1=1184757&r2=1184758&view=diff
==============================================================================
--- incubator/ooo/trunk/main/agg/inc/agg_ellipse_bresenham.h (original)
+++ incubator/ooo/trunk/main/agg/inc/agg_ellipse_bresenham.h Sun Oct 16 04:13:16 2011
@@ -1,5 +1,5 @@
 //----------------------------------------------------------------------------
-// Anti-Grain Geometry - Version 2.3
+// Anti-Grain Geometry - Version 2.4
 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com)
 //
 // Permission to copy, use, modify, sell and distribute this software 

Modified: incubator/ooo/trunk/main/agg/inc/agg_embedded_raster_fonts.h
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/agg/inc/agg_embedded_raster_fonts.h?rev=1184758&r1=1184757&r2=1184758&view=diff
==============================================================================
--- incubator/ooo/trunk/main/agg/inc/agg_embedded_raster_fonts.h (original)
+++ incubator/ooo/trunk/main/agg/inc/agg_embedded_raster_fonts.h Sun Oct 16 04:13:16 2011
@@ -1,5 +1,5 @@
 //----------------------------------------------------------------------------
-// Anti-Grain Geometry - Version 2.3
+// Anti-Grain Geometry - Version 2.4
 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com)
 //
 // Permission to copy, use, modify, sell and distribute this software 



Mime
View raw message