From bb8404b19557519bd828113fa93604b10e9e7fe3 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Wed, 14 Jul 2010 04:32:10 +0200 Subject: Merge redundant *-fns.h into respective filter headers. Move gaussian blur to filters directory. Blend filter effect. (bzr r9508.1.16) --- src/sp-filter.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/sp-filter.cpp') diff --git a/src/sp-filter.cpp b/src/sp-filter.cpp index 4cbafe50c..44db09b86 100644 --- a/src/sp-filter.cpp +++ b/src/sp-filter.cpp @@ -28,6 +28,7 @@ using std::pair; #include "document.h" #include "sp-filter.h" #include "sp-filter-reference.h" +#include "sp-filter-primitive.h" #include "uri.h" #include "xml/repr.h" #include -- cgit v1.2.3 From 5489ec55d35af6640606ad16b73930d505958faf Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Mon, 29 Aug 2011 15:44:13 +0200 Subject: Add minimal support for reading color-interpolation and color-interpolation-filters properties (however, Inkscape assumes sRGB everywhere at the moment). Change color-interpolation-filters from attribute to style property in sp-filter.cpp as it is not allowed as an attribute in a (it is only allowed as an attribute in filter primitives). Added color-interpolation-filters:sRGB to style when new filter is created in filter-chemistry.cpp. (bzr r10591) --- src/sp-filter.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/sp-filter.cpp') diff --git a/src/sp-filter.cpp b/src/sp-filter.cpp index a7c1aa1fb..d0fd59802 100644 --- a/src/sp-filter.cpp +++ b/src/sp-filter.cpp @@ -370,12 +370,22 @@ sp_filter_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::N // TODO: This is evil, correctly implement support for color-interpolation-filters!!! // The color-interpolation-filters attribute is initially set to linearRGB according to the SVG standard. - // However, Inkscape completely ignores it and implicitly assumes that it is sRGB (like color-interpolation-filters). + // However, Inkscape completely ignores it and implicitly assumes that it is sRGB (like color-interpolation). // This results in a discrepancy between Inkscape and other renderers in how they render filters. // To mitigate this problem I've (Jasper van de Gronde,th.v.d.gronde@hccnet.nl) added this to ensure that at least // any filters written by Inkscape will henceforth be rendered the same in other renderers. // In the future Inkscape should have proper support for the color-interpolation properties and this should be changed. - repr->setAttribute("color-interpolation-filters", "sRGB"); + + // repr->setAttribute("color-interpolation-filters", "sRGB"); + + // Actually, the above line is not correct as the attribute is only allowed on filter + // primitives and not objects. However, it is allowed as a property in a style + // attribute. Note, this property must also be set in sp-filter-chemistry, filter_new() as the + // code here is not necessarily called when a new filter is created. 29 Aug 2011 Tav. + SPCSSAttr *css = sp_repr_css_attr_new(); + sp_repr_css_set_property(css, "color-interpolation-filters", "sRGB"); + sp_repr_css_change(repr, css, "style"); + sp_repr_css_attr_unref(css); if (((SPObjectClass *) filter_parent_class)->write) { ((SPObjectClass *) filter_parent_class)->write(object, doc, repr, flags); -- cgit v1.2.3