Code

Patch from codedread. Prevents rendering of title/desc/metadata elements in text...
[inkscape.git] / src / display / nr-filter-turbulence.h
index 03c2e22a5ad4971d0d6bace6805718cd8a7842b0..d0f345360a41363b12a147898b2d03fa4a971b2b 100644 (file)
@@ -5,16 +5,26 @@
  * feTurbulence filter primitive renderer
  *
  * Authors:
- *   Felipe Sanches <felipe.sanches@gmail.com>
+ *   World Wide Web Consortium <http://www.w3.org/>
+ *   Felipe Corrêa da Silva Sanches <felipe.sanches@gmail.com>
  *   Niko Kiirala <niko@kiirala.com>
  *
- * Copyright (C) 2007 authors
+ * This file has a considerable amount of code adapted from
+ *  the W3C SVG filter specs, available at:
+ *  http://www.w3.org/TR/SVG11/filters.html#feTurbulence
+ *
+ * W3C original code is licensed under the terms of
+ *  the (GPL compatible) W3C® SOFTWARE NOTICE AND LICENSE:
+ *  http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
  *
+ * Copyright (C) 2007 authors
  * Released under GNU GPL, read the file 'COPYING' for more information
  */
 
 #include "display/nr-filter-primitive.h"
 #include "display/nr-filter-slot.h"
+#include "display/nr-filter-units.h"
+#include "libnr/nr-rect-l.h"
 
 namespace NR {
 
@@ -57,15 +67,16 @@ public:
     static FilterPrimitive *create();
     virtual ~FilterTurbulence();
 
-    virtual int render(FilterSlot &slot, Matrix const &trans);
-    virtual void update_pixbuffer(FilterSlot &slot);
-    
-    virtual void set_baseFrequency(int axis, double freq);
-    virtual void set_numOctaves(int num);
-    virtual void set_seed(double s);
-    virtual void set_stitchTiles(bool st);
-    virtual void set_type(FilterTurbulenceType t);
-    virtual void set_updated(bool u);
+    virtual int render(FilterSlot &slot, FilterUnits const &units);
+    void update_pixbuffer(IRect &area, FilterUnits const &units);
+    void render_area(NRPixBlock *pix, IRect &full_area, FilterUnits const &units);
+
+    void set_baseFrequency(int axis, double freq);
+    void set_numOctaves(int num);
+    void set_seed(double s);
+    void set_stitchTiles(bool st);
+    void set_type(FilterTurbulenceType t);
+    void set_updated(bool u);
     virtual FilterTraits get_input_traits();
 private:
 
@@ -81,6 +92,7 @@ private:
     bool stitchTiles;
     FilterTurbulenceType type;
     bool updated;
+    IRect updated_area;
     NRPixBlock *pix;
     unsigned char *pix_data;