index db2b2854aec6d9ac2056881343d03c23e96c34fa..ee870f758f448f205d569199cf731ba09e67fb7f 100644 (file)
* 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 <juca@members.fsf.org>
* 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,
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(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:
long Turbulence_setup_seed(long lSeed);
bool stitchTiles;
FilterTurbulenceType type;
bool updated;
+ NR::IRect updated_area;
NRPixBlock *pix;
unsigned char *pix_data;
double fTileY;
};
-} /* namespace NR */
+} /* namespace Filters */
+} /* namespace Inkscape */
#endif /* __NR_FILTER_TURBULENCE_H__ */
/*
fill-column:99
End:
*/
-// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :