Code

Patch from codedread. Prevents rendering of title/desc/metadata elements in text...
[inkscape.git] / src / display / nr-filter.h
index a6f71b9a56ca4d1f181ee36ca369b714d6c2943a..267f242d1aff218beae9421929b35dd40bcf33e9 100644 (file)
@@ -77,10 +77,10 @@ public:
      */
     void set_output(int slot);
 
-    void set_x(SVGLength &lenght);
-    void set_y(SVGLength &length);
-    void set_width(SVGLength &length);
-    void set_height(SVGLength &length);
+    void set_x(SVGLength const &length);
+    void set_y(SVGLength const &length);
+    void set_width(SVGLength const &length);
+    void set_height(SVGLength const &length);
 
     /**
      * Sets the filter effects region.
@@ -105,7 +105,7 @@ public:
      * resolution is determined automatically. If x_pixels is less than zero,
      * calling this function results in no changes to filter state.
      */
-    void set_resolution(double x_pixels);
+    void set_resolution(double const x_pixels);
 
     /**
      * Sets the width and height of intermediate images in pixels. If not set,
@@ -113,7 +113,7 @@ public:
      * less than zero, calling this function results in no changes to filter
      * state.
      */
-    void set_resolution(double x_pixels, double y_pixels);
+    void set_resolution(double const x_pixels, double const y_pixels);
 
     /**
      * Resets the filter resolution to its default value, i.e. automatically
@@ -131,23 +131,31 @@ public:
 
     /**
      * Set the primitiveUnits-properterty. If not set, the default value of
-     * userSpaceOnUseis used. If the parameter value is not a valid
+     * userSpaceOnUse is used. If the parameter value is not a valid
      * enumeration value from SPFilterUnits, no changes to filter state
      * are made.
      */
     void set_primitive_units(SPFilterUnits unit);
 
     /** 
-     * Returns the amount of pixels the rendering area should be enlarged
-     * to prevent visual artefacts when filter needs to read pixels that
-     * are outside its output area (e.g. gaussian blur)
+     * Modifies the given area to accommodate for filters needing pixels
+     * outside the rendered area.
+     * When this function returns, area contains the area that needs
+     * to be rendered so that after filtering, the original area is
+     * drawn correctly.
      */
-    int get_enlarge(Matrix const &m);
+    void area_enlarge(NRRectL &area, Matrix const &m);
     /**
      * Given an object bounding box, this function enlarges it so that
      * it contains the filter effect area.
      */
     void bbox_enlarge(NRRectL &bbox);
+    /**
+     * Returns the filter effects area in user coordinate system.
+     * The given bounding box should be a bounding box as specified in
+     * SVG standard and in user coordinate system.
+     */
+    Rect filter_effect_area(Rect const &bbox);
 
     /** Creates a new filter with space for one filter element */
     Filter();
@@ -158,7 +166,7 @@ public:
      */
     Filter(int n);
     /** Destroys the filter and all its primitives */
-    ~Filter();
+    virtual ~Filter();
 
 private:
     int _primitive_count;