Code

Fix to prevent convolvematrix.cpp from setting targetX/Y to zero if no value is given.
[inkscape.git] / src / display / nr-filter-turbulence.h
index 144e3ec4cda5a5f3aafb5fac76c5b2b3dd0caacb..b12e6395a1122878554feaa775cb92ec790689c3 100644 (file)
@@ -5,19 +5,29 @@
  * 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 {
+namespace Inkscape {
+namespace Filters {
 
 enum FilterTurbulenceType {
     TURBULENCE_FRACTALNOISE,
@@ -59,14 +69,15 @@ public:
     virtual ~FilterTurbulence();
 
     virtual int render(FilterSlot &slot, FilterUnits const &units);
-    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);
+    void update_pixbuffer(NR::IRect &area, FilterUnits const &units);
+    void render_area(NRPixBlock *pix, NR::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:
 
@@ -82,6 +93,7 @@ private:
     bool stitchTiles;
     FilterTurbulenceType type;
     bool updated;
+    NR::IRect updated_area;
     NRPixBlock *pix;
     unsigned char *pix_data;
 
@@ -95,7 +107,8 @@ private:
     double fTileY;
 };
 
-} /* namespace NR */
+} /* namespace Filters */
+} /* namespace Inkscape */
 
 #endif /* __NR_FILTER_TURBULENCE_H__ */
 /*