From feaf757c0785a23c6736d7cf4046f73e7e46d56a Mon Sep 17 00:00:00 2001 From: Hermann Kraus Date: Wed, 20 Mar 2013 03:45:33 +0100 Subject: [PATCH 1/9] Fix return type. --- tests/visual_tests/test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/visual_tests/test.py b/tests/visual_tests/test.py index 1054ac084..3c1fcb4a5 100755 --- a/tests/visual_tests/test.py +++ b/tests/visual_tests/test.py @@ -125,7 +125,7 @@ def render(config, width, height, bbox, scale_factor, quiet=False, overwrite_fai except Exception, e: sys.stderr.write(e.message + '\n') fail(actual_agg,expected_agg,str(e.message)) - return + return m if not quiet: print "\"%s\" with agg..." % (postfix), try: From 4b713f6ed09616edd52acc1b05139faca5a1ea32 Mon Sep 17 00:00:00 2001 From: artemp Date: Wed, 20 Mar 2013 15:17:41 +0000 Subject: [PATCH 2/9] + impl colorize-alpha image filter NOTE:currently linear interpolation between two colours only TODO:support multiple colour stops : https://developer.mozilla.org/en-US/docs/CSS/linear-gradient --- include/mapnik/image_filter.hpp | 72 +++++++++++++++++++++++++++ include/mapnik/image_filter_types.hpp | 7 ++- 2 files changed, 78 insertions(+), 1 deletion(-) diff --git a/include/mapnik/image_filter.hpp b/include/mapnik/image_filter.hpp index 9fc5be8e1..3839171aa 100644 --- a/include/mapnik/image_filter.hpp +++ b/include/mapnik/image_filter.hpp @@ -404,6 +404,78 @@ void apply_filter(Src & src, agg_stack_blur const& op) agg::stack_blur_rgba32(pixf,op.rx,op.ry); } +template +void apply_filter(Src & src, colorize_alpha const& op) +{ + using namespace boost::gil; + + mapnik::color const& c0 = op.c0_; + mapnik::color const& c1 = op.c1_; + uint8_t reds[256]; + uint8_t greens[256]; + uint8_t blues[256]; + + for (unsigned a=0; a < 256;++a) + { + reds[a] = (c0.red() + (c1.red() - c0.red()) * a) >> 8; + greens[a] = (c0.green() + (c1.green() - c0.green()) * a) >> 8; + blues[a] = (c0.blue() + (c1.blue() - c0.blue()) * a) >> 8; + } + + rgba8_view_t src_view = rgba8_view(src); + for (int y=0; y 0) + { + + //r = (c0.red() + (c1.red() - c0.red()) * a) >> 8; + //g = (c0.green() + (c1.green() - c0.green()) * a) >> 8; + //b = (c0.blue() + (c1.blue() - c0.blue()) * a) >> 8; + r = (reds[a] * a + 255) >> 8; + g = (greens[a] * a + 255) >> 8; + b = (blues[a] * a + 255) >> 8; + +#if 0 + // rainbow + r = 0; + g = 0; + b = 0; + if (a < 64) + { + g = a * 4; + b = 255; + } + else if (a >= 64 && a < 128) + { + g = 255; + b = 255 - ((a - 64) * 4); + } + else if (a >= 128 && a < 192) + { + r = (a - 128) * 4; + g = 255; + } + else // >= 192 + { + r = 255; + g = 255 - ((a - 192) * 4); + } + r = (r * a + 255) >> 8; + g = (g * a + 255) >> 8; + b = (b * a + 255) >> 8; +#endif + } + } + } +} + template void apply_filter(Src & src, hsla const& transform) { diff --git a/include/mapnik/image_filter_types.hpp b/include/mapnik/image_filter_types.hpp index cca49e1ff..fe5b01875 100644 --- a/include/mapnik/image_filter_types.hpp +++ b/include/mapnik/image_filter_types.hpp @@ -101,9 +101,14 @@ struct hsla struct colorize_alpha { colorize_alpha(mapnik::color const& c0, mapnik::color const& c1) + : c0_(c0), + c1_(c1) { - // TODO: implement me! + // TODO: support multiple color-stops + // https://developer.mozilla.org/en-US/docs/CSS/linear-gradient } + mapnik::color c0_; + mapnik::color c1_; }; typedef boost::variant Date: Wed, 20 Mar 2013 17:21:09 +0000 Subject: [PATCH 3/9] + support multiple color stops in colorize-alpha ( TODO: add support for: = [ | ]? ) --- include/mapnik/image_filter.hpp | 37 +++++++++++++------------ include/mapnik/image_filter_grammar.hpp | 3 +- include/mapnik/image_filter_types.hpp | 9 +++--- src/image_filter_grammar.cpp | 9 +++--- 4 files changed, 29 insertions(+), 29 deletions(-) diff --git a/include/mapnik/image_filter.hpp b/include/mapnik/image_filter.hpp index 3839171aa..2fad73f17 100644 --- a/include/mapnik/image_filter.hpp +++ b/include/mapnik/image_filter.hpp @@ -32,6 +32,7 @@ #include #include #include +#include // agg #include "agg_basics.h" @@ -39,7 +40,7 @@ #include "agg_pixfmt_rgba.h" #include "agg_scanline_u.h" #include "agg_blur.h" - +#include "agg_gradient_lut.h" // stl #include @@ -409,18 +410,22 @@ void apply_filter(Src & src, colorize_alpha const& op) { using namespace boost::gil; - mapnik::color const& c0 = op.c0_; - mapnik::color const& c1 = op.c1_; - uint8_t reds[256]; - uint8_t greens[256]; - uint8_t blues[256]; + agg::gradient_lut > grad_lut; + grad_lut.remove_all(); + std::size_t size = op.size(); + if (size < 2) return; - for (unsigned a=0; a < 256;++a) + double step = 1.0/(size-1); + double offset = 0.0; + BOOST_FOREACH( mapnik::color const& c, op) { - reds[a] = (c0.red() + (c1.red() - c0.red()) * a) >> 8; - greens[a] = (c0.green() + (c1.green() - c0.green()) * a) >> 8; - blues[a] = (c0.blue() + (c1.blue() - c0.blue()) * a) >> 8; + grad_lut.add_color(offset, agg::rgba(c.red()/256.0, + c.green()/256.0, + c.blue()/256.0, + c.alpha()/256.0)); + offset += step; } + grad_lut.build_lut(); rgba8_view_t src_view = rgba8_view(src); for (int y=0; y 0) { - - //r = (c0.red() + (c1.red() - c0.red()) * a) >> 8; - //g = (c0.green() + (c1.green() - c0.green()) * a) >> 8; - //b = (c0.blue() + (c1.blue() - c0.blue()) * a) >> 8; - r = (reds[a] * a + 255) >> 8; - g = (greens[a] * a + 255) >> 8; - b = (blues[a] * a + 255) >> 8; - + agg::rgba8 c = grad_lut[a]; + r = (c.r * a + 255) >> 8; + g = (c.g * a + 255) >> 8; + b = (c.b * a + 255) >> 8; #if 0 // rainbow r = 0; diff --git a/include/mapnik/image_filter_grammar.hpp b/include/mapnik/image_filter_grammar.hpp index d98ad0e82..4c490f446 100644 --- a/include/mapnik/image_filter_grammar.hpp +++ b/include/mapnik/image_filter_grammar.hpp @@ -27,6 +27,7 @@ #include // mapnik #include +#include // stl #include @@ -45,7 +46,7 @@ struct image_filter_grammar : 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> colorize_alpha_filter; + qi::rule, void(ContType&), qi::ascii::space_type> colorize_alpha_filter; 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 fe5b01875..b433e9dd5 100644 --- a/include/mapnik/image_filter_types.hpp +++ b/include/mapnik/image_filter_types.hpp @@ -98,17 +98,16 @@ struct hsla double a1; }; -struct colorize_alpha +struct colorize_alpha : std::vector { + colorize_alpha() {} colorize_alpha(mapnik::color const& c0, mapnik::color const& c1) - : c0_(c0), - c1_(c1) { + this->push_back(c0); + this->push_back(c1); // TODO: support multiple color-stops // https://developer.mozilla.org/en-US/docs/CSS/linear-gradient } - mapnik::color c0_; - mapnik::color c1_; }; typedef boost::variant -#include // boost #include @@ -110,11 +109,11 @@ image_filter_grammar::image_filter_grammar() [push_back(_r1, construct(_a,_b,_c,_d,_e,_f,_g,_h))] ; - colorize_alpha_filter = lit("colorize-alpha") + colorize_alpha_filter = lit("colorize-alpha")[_a = construct()] >> lit('(') - >> css_color_[_a = _1] >> lit(',') - >> css_color_[_b = _1] >> lit(')') - [push_back(_r1,construct(_a,_b))] + >> css_color_[push_back(_a, _1)] + >> +(lit(',') >> css_color_[push_back(_a, _1)]) + >> lit(')') [push_back(_r1,_a)] ; no_args = -(lit('(') >> lit(')')); From fe092ac7a22848ca730cf363365088e0bf8330f7 Mon Sep 17 00:00:00 2001 From: artemp Date: Thu, 21 Mar 2013 12:10:08 +0000 Subject: [PATCH 4/9] + implement offset ``` offset = " | " ``` --- include/mapnik/image_filter.hpp | 16 ++++++++++----- include/mapnik/image_filter_grammar.hpp | 27 ++++++++++++++++++++++++- include/mapnik/image_filter_types.hpp | 18 +++++++++-------- src/image_filter_grammar.cpp | 12 ++++++++--- 4 files changed, 56 insertions(+), 17 deletions(-) diff --git a/include/mapnik/image_filter.hpp b/include/mapnik/image_filter.hpp index 2fad73f17..18094ce26 100644 --- a/include/mapnik/image_filter.hpp +++ b/include/mapnik/image_filter.hpp @@ -417,12 +417,18 @@ void apply_filter(Src & src, colorize_alpha const& op) double step = 1.0/(size-1); double offset = 0.0; - BOOST_FOREACH( mapnik::color const& c, op) + BOOST_FOREACH( mapnik::filter::color_stop const& stop, op) { - grad_lut.add_color(offset, agg::rgba(c.red()/256.0, - c.green()/256.0, - c.blue()/256.0, - c.alpha()/256.0)); + mapnik::color const& c = stop.color; + double stop_offset = stop.offset; + if (stop_offset == 0) + { + stop_offset = offset; + } + grad_lut.add_color(stop_offset, agg::rgba(c.red()/256.0, + c.green()/256.0, + c.blue()/256.0, + c.alpha()/256.0)); offset += step; } grad_lut.build_lut(); diff --git a/include/mapnik/image_filter_grammar.hpp b/include/mapnik/image_filter_grammar.hpp index 4c490f446..e2f194923 100644 --- a/include/mapnik/image_filter_grammar.hpp +++ b/include/mapnik/image_filter_grammar.hpp @@ -25,17 +25,40 @@ // boost #include +#include // mapnik #include #include // stl #include +BOOST_FUSION_ADAPT_STRUCT( + mapnik::filter::color_stop, + (mapnik::color, color ) + (double, offset) +) namespace mapnik { namespace qi = boost::spirit::qi; +struct percent_offset_impl +{ + template + struct result + { + typedef double type; + }; + + double operator() (double val) const + { + double result = std::abs(val/100.0); + if (result > 1.0) result = 1.0; + return result; + } +}; + + template struct image_filter_grammar : qi::grammar @@ -46,10 +69,12 @@ struct image_filter_grammar : 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> colorize_alpha_filter; + qi::rule, void(ContType&), qi::ascii::space_type> colorize_alpha_filter; qi::rule no_args; qi::uint_parser< unsigned, 10, 1, 3 > radius_; css_color_grammar css_color_; + qi::rule color_stop_offset; + phoenix::function percent_offset; }; } diff --git a/include/mapnik/image_filter_types.hpp b/include/mapnik/image_filter_types.hpp index b433e9dd5..dc5728b15 100644 --- a/include/mapnik/image_filter_types.hpp +++ b/include/mapnik/image_filter_types.hpp @@ -98,16 +98,18 @@ struct hsla double a1; }; -struct colorize_alpha : std::vector +struct color_stop +{ + color_stop() {} + color_stop(mapnik::color const& c, double val = 0.0) + : color(c),offset(val) {} + mapnik::color color; + double offset; +}; + +struct colorize_alpha : std::vector { colorize_alpha() {} - colorize_alpha(mapnik::color const& c0, mapnik::color const& c1) - { - this->push_back(c0); - this->push_back(c1); - // TODO: support multiple color-stops - // https://developer.mozilla.org/en-US/docs/CSS/linear-gradient - } }; typedef boost::variant::image_filter_grammar() using boost::spirit::ascii::string; using phoenix::push_back; using phoenix::construct; - + using phoenix::at_c; #if BOOST_VERSION >= 104700 using qi::no_skip; start = -(filter % no_skip[*char_(", ")]) @@ -111,11 +111,17 @@ image_filter_grammar::image_filter_grammar() colorize_alpha_filter = lit("colorize-alpha")[_a = construct()] >> lit('(') - >> css_color_[push_back(_a, _1)] - >> +(lit(',') >> css_color_[push_back(_a, _1)]) + >> (css_color_[at_c<0>(_b) = _1, at_c<1>(_b) = 0] + >> -color_stop_offset(_b)) [push_back(_a,_b)] + >> +(lit(',') >> css_color_[at_c<0>(_b) =_1,at_c<1>(_b) = 0] + >> -color_stop_offset(_b))[push_back(_a,_b)] >> lit(')') [push_back(_r1,_a)] ; + color_stop_offset = (double_ >> lit('%'))[at_c<1>(_r1) = percent_offset(_1)] + | + double_[at_c<1>(_r1) = _1] + ; no_args = -(lit('(') >> lit(')')); } From 16bfb3e728f33cc0948425ce5777091f698fac91 Mon Sep 17 00:00:00 2001 From: artemp Date: Fri, 22 Mar 2013 08:32:08 +0000 Subject: [PATCH 5/9] + update FSF address --- COPYING | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/COPYING b/COPYING index cfe59bcad..e5ab03e12 100644 --- a/COPYING +++ b/COPYING @@ -1,8 +1,8 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -10,7 +10,7 @@ as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] - Preamble + Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public @@ -55,7 +55,7 @@ modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. - + Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a @@ -111,8 +111,8 @@ modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE + + GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other @@ -146,7 +146,7 @@ such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. - + 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an @@ -158,7 +158,7 @@ Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. - + 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 @@ -216,7 +216,7 @@ instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. - + Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. @@ -267,7 +267,7 @@ Library will still fall under Section 6.) distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. - + 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work @@ -329,7 +329,7 @@ restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. - + 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined @@ -370,7 +370,7 @@ subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. - + 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or @@ -422,7 +422,7 @@ conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. - + 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is @@ -432,7 +432,7 @@ decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. - NO WARRANTY + NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. @@ -455,8 +455,8 @@ FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - END OF TERMS AND CONDITIONS - + END OF TERMS AND CONDITIONS + How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest @@ -485,7 +485,7 @@ convey the exclusion of warranty; and each file should have at least the You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. From aa122ea907fa1f31ed76f6e0f12ea9549c86a964 Mon Sep 17 00:00:00 2001 From: artemp Date: Fri, 22 Mar 2013 11:54:34 +0000 Subject: [PATCH 6/9] + local vars locality --- src/agg/agg_renderer.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/agg/agg_renderer.cpp b/src/agg/agg_renderer.cpp index cf774eafd..f3e6cea3a 100644 --- a/src/agg/agg_renderer.cpp +++ b/src/agg/agg_renderer.cpp @@ -344,11 +344,10 @@ void agg_renderer::render_marker(pixel_position const& pos, { double width = (*marker.get_bitmap_data())->width(); double height = (*marker.get_bitmap_data())->height(); - double cx = 0.5 * width; - double cy = 0.5 * height; - if (std::fabs(1.0 - scale_factor_) < 0.001 && tr.is_identity()) { + double cx = 0.5 * width; + double cy = 0.5 * height; composite(current_buffer_->data(), **marker.get_bitmap_data(), comp_op, opacity, boost::math::iround(pos.x - cx), From c84d83a685ba0e201b055db5a7cee68afde05d64 Mon Sep 17 00:00:00 2001 From: artemp Date: Fri, 22 Mar 2013 12:16:23 +0000 Subject: [PATCH 7/9] + fix raster markers positioning --- src/cairo_renderer.cpp | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/src/cairo_renderer.cpp b/src/cairo_renderer.cpp index bbc577bf6..5b97e7571 100644 --- a/src/cairo_renderer.cpp +++ b/src/cairo_renderer.cpp @@ -629,21 +629,24 @@ void cairo_renderer_base::render_marker(pixel_position const& pos, mapnik::svg_path_ptr vmarker = *marker.get_vector_data(); if (vmarker) { + agg::trans_affine marker_tr = tr; + marker_tr *=agg::trans_affine_scaling(scale_factor_); agg::pod_bvector const & attributes = vmarker->attributes(); - render_vector_marker(context_, pos, *vmarker, attributes, tr, opacity, recenter); + render_vector_marker(context_, pos, *vmarker, attributes, marker_tr, opacity, recenter); } } else if (marker.is_bitmap()) { - agg::trans_affine matrix = tr; double width = (*marker.get_bitmap_data())->width(); double height = (*marker.get_bitmap_data())->height(); double cx = 0.5 * width; double cy = 0.5 * height; - matrix *= agg::trans_affine_translation( - boost::math::iround(pos.x - cx), - boost::math::iround(pos.y - cy)); - context_.add_image(matrix, **marker.get_bitmap_data(), opacity); + agg::trans_affine marker_tr; + marker_tr *= agg::trans_affine_translation(-cx,-cy); + marker_tr *= tr; + marker_tr *= agg::trans_affine_scaling(scale_factor_); + marker_tr *= agg::trans_affine_translation(pos.x,pos.y); + context_.add_image(marker_tr, **marker.get_bitmap_data(), opacity); } } @@ -689,7 +692,7 @@ void cairo_renderer_base::process(point_symbolizer const& sym, double dx = 0.5 * (*marker)->width(); double dy = 0.5 * (*marker)->height(); - agg::trans_affine tr = agg::trans_affine_scaling(scale_factor_); + agg::trans_affine tr; evaluate_transform(tr, feature, sym.get_image_transform()); box2d label_ext (-dx, -dy, dx, dy); label_ext *= tr; @@ -728,15 +731,9 @@ void cairo_renderer_base::process(shield_symbolizer const& sym, pixel_position pos = helper.get_marker_position(placements[ii]); pos.x += 0.5 * helper.get_marker_width(); pos.y += 0.5 * helper.get_marker_height(); - double dx = 0.5 * helper.get_marker_width(); - double dy = 0.5 * helper.get_marker_height(); - agg::trans_affine marker_tr = agg::trans_affine_translation(-dx,-dy); - marker_tr *= agg::trans_affine_scaling(scale_factor_); - marker_tr *= agg::trans_affine_translation(dx,dy); - marker_tr *= helper.get_image_transform(); render_marker(pos, helper.get_marker(), - marker_tr, + helper.get_image_transform(), sym.get_opacity()); context_.add_text(placements[ii], face_manager_, font_manager_, scale_factor_); From f96de9bdd80e26d3f0758c2ef3137ad21e6cf754 Mon Sep 17 00:00:00 2001 From: artemp Date: Fri, 22 Mar 2013 12:30:46 +0000 Subject: [PATCH 8/9] + always ensure first value in gamma table to 0 --- deps/agg/include/agg_gamma_functions.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/deps/agg/include/agg_gamma_functions.h b/deps/agg/include/agg_gamma_functions.h index 323b80a95..619ef95b4 100644 --- a/deps/agg/include/agg_gamma_functions.h +++ b/deps/agg/include/agg_gamma_functions.h @@ -2,8 +2,8 @@ // Anti-Grain Geometry - Version 2.4 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com) // -// Permission to copy, use, modify, sell and distribute this software -// is granted provided this copyright notice appears in all copies. +// Permission to copy, use, modify, sell and distribute this software +// is granted provided this copyright notice appears in all copies. // This software is provided "as is" without express or implied // warranty, and with no claim as to its suitability for any purpose. // @@ -40,6 +40,7 @@ namespace agg double operator() (double x) const { + if (x == 0.0) return 0.0; return pow(x, m_gamma); } @@ -122,6 +123,3 @@ namespace agg } #endif - - - From efb5b3e33b160a96b0d959de90054b638569a3ba Mon Sep 17 00:00:00 2001 From: Andrzej Aleksiejuk Date: Fri, 22 Mar 2013 22:14:36 +0100 Subject: [PATCH 9/9] fixed a link to windows installation --- INSTALL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INSTALL.md b/INSTALL.md index f3b715d48..fd5300cbf 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -7,7 +7,7 @@ To configure and build Mapnik do: ./configure make -NOTE: the above will not work on windows, rather see https://github.com/mapnik/mapnik/wiki/BuildingOnWindows +NOTE: the above will not work on windows, rather see https://github.com/mapnik/mapnik/wiki/WindowsInstallation Then to run the tests locally (without needing to install):