diff --git a/include/mapnik/image_filter_grammar.hpp b/include/mapnik/image_filter_grammar.hpp index ef78b4e34..d98ad0e82 100644 --- a/include/mapnik/image_filter_grammar.hpp +++ b/include/mapnik/image_filter_grammar.hpp @@ -43,9 +43,9 @@ struct image_filter_grammar : qi::rule start; qi::rule filter; qi::rule, void(ContType&), qi::ascii::space_type> agg_blur_filter; - qi::rule, void(ContType&), qi::ascii::space_type> hsla_filter; + qi::rule, + void(ContType&), qi::ascii::space_type> hsla_filter; qi::rule, void(ContType&), qi::ascii::space_type> colorize_alpha_filter; - qi::rule string_arg; qi::rule no_args; qi::uint_parser< unsigned, 10, 1, 3 > radius_; css_color_grammar css_color_; diff --git a/include/mapnik/image_filter_types.hpp b/include/mapnik/image_filter_types.hpp index 276caac2a..72075f2ec 100644 --- a/include/mapnik/image_filter_types.hpp +++ b/include/mapnik/image_filter_types.hpp @@ -27,8 +27,8 @@ #include #include // boost +#include #include - // stl #include #include @@ -56,18 +56,20 @@ struct agg_stack_blur struct hsla { - hsla(std::string const& tint_string) - : tinter(tint_string) {} - std::string tinter; + hsla(double h0, double h1, + double s0, double s1, + double l0, double l1, + double a0, double a1) + { + // TODO: implement me! + } }; - - struct colorize_alpha { colorize_alpha(mapnik::color const& c0, mapnik::color const& c1) { - //do work + // TODO: implement me! } }; @@ -104,7 +106,7 @@ inline std::ostream& operator<< (std::ostream& os, agg_stack_blur const& filter) inline std::ostream& operator<< (std::ostream& os, hsla const& filter) { - os << "hsla(" << filter.tinter << ')'; + os << "hsla(" << "TODO" << ')'; return os; } diff --git a/src/image_filter_grammar.cpp b/src/image_filter_grammar.cpp index fba6f213f..28163ad91 100644 --- a/src/image_filter_grammar.cpp +++ b/src/image_filter_grammar.cpp @@ -44,10 +44,17 @@ image_filter_grammar::image_filter_grammar() using qi::_1; using qi::_a; using qi::_b; + using qi::_c; + using qi::_d; + using qi::_e; + using qi::_f; + using qi::_g; + using qi::_h; using qi::_r1; using qi::eps; using qi::char_; using qi::lexeme; + using qi::double_; using boost::spirit::ascii::string; using phoenix::push_back; using phoenix::construct; @@ -94,8 +101,13 @@ image_filter_grammar::image_filter_grammar() [push_back(_r1,construct(_a,_b))] ; - hsla_filter = lit("hsla") >> lit('(') >> string_arg(')')[_a = _1] >> lit(')') - [push_back(_r1,construct(_a))] + hsla_filter = lit("hsla") + >> lit('(') + >> double_[_a = _1] >> lit('x') >> double_[_b = _1] >> lit(';') + >> double_[_c = _1] >> lit('x') >> double_[_d = _1] >> lit(';') + >> double_[_e = _1] >> lit('x') >> double_[_f = _1] >> lit(';') + >> double_[_g = _1] >> lit('x') >> double_[_h = _1] >> lit(')') + [push_back(_r1, construct(_a,_b,_c,_d,_e,_f,_g,_h))] ; colorize_alpha_filter = lit("colorize-alpha") @@ -105,7 +117,6 @@ image_filter_grammar::image_filter_grammar() [push_back(_r1,construct(_a,_b))] ; - string_arg = + (char_ - lit(_r1)); no_args = -(lit('(') >> lit(')')); }