From b787f4d67272df7337ccaf5f6e2d40acf97af3ba Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Fri, 27 Sep 2013 14:06:07 -0700 Subject: [PATCH] fix image-filter serialization for scale-hsla and colorize-alpha --- include/mapnik/image_filter_types.hpp | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/include/mapnik/image_filter_types.hpp b/include/mapnik/image_filter_types.hpp index 9ff5ab516..f1549a8dd 100644 --- a/include/mapnik/image_filter_types.hpp +++ b/include/mapnik/image_filter_types.hpp @@ -32,6 +32,7 @@ #include #include #include +#include // stl #include @@ -168,10 +169,11 @@ inline std::ostream& operator<< (std::ostream& os, color_to_alpha const& filter) inline std::ostream& operator<< (std::ostream& os, scale_hsla const& filter) { - os << "hsla-transform(" << filter.h0 << 'x' << filter.h1 << ':' - << filter.s0 << 'x' << filter.s1 << ':' - << filter.l0 << 'x' << filter.l1 << ':' - << filter.a0 << 'x' << filter.a1 << ')'; + os << "scale-hsla(" + << filter.h0 << ',' << filter.h1 << ',' + << filter.s0 << ',' << filter.s1 << ',' + << filter.l0 << ',' << filter.l1 << ',' + << filter.a0 << ',' << filter.a1 << ')'; return os; } @@ -219,7 +221,19 @@ inline std::ostream& operator<< (std::ostream& os, invert) inline std::ostream& operator<< (std::ostream& os, colorize_alpha const& filter) { - os << "colorize-alpha(TODO)"; + os << "colorize-alpha("; + bool first = true; + BOOST_FOREACH( mapnik::filter::color_stop const& stop, filter) + { + if (!first) os << ","; + else first = false; + os << stop.color; + if (stop.offset > 0) + { + os << " " << stop.offset; + } + } + os << ')'; return os; }