Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

premultiply marker images once, before caching - refs #1262

  • Loading branch information...
commit 3272707548098487ae005b077f8d42d7b8d323fb 1 parent 65156a5
@springmeyer springmeyer authored
Showing with 10 additions and 1 deletion.
  1. +1 −1  src/agg/agg_renderer.cpp
  2. +9 −0 src/marker_cache.cpp
View
2  src/agg/agg_renderer.cpp
@@ -297,7 +297,7 @@ void agg_renderer<T>::render_marker(pixel_position const& pos, marker const& mar
comp_op, opacity,
boost::math::iround(pos.x - cx),
boost::math::iround(pos.y - cy),
- true);
+ false);
}
}
View
9 src/marker_cache.cpp
@@ -38,6 +38,10 @@
#include <boost/algorithm/string.hpp>
#include <boost/make_shared.hpp>
+// agg
+#include "agg_rendering_buffer.h"
+#include "agg_pixfmt_rgba.h"
+
namespace mapnik
{
@@ -113,6 +117,11 @@ boost::optional<marker_ptr> marker_cache::find(std::string const& uri, bool upda
BOOST_ASSERT(width > 0 && height > 0);
mapnik::image_ptr image(boost::make_shared<mapnik::image_data_32>(width,height));
reader->read(0,0,*image);
+ // ensure images are premultiplied
+ // TODO - don't need to multiply jpegs
+ agg::rendering_buffer buffer(image->getBytes(),image->width(),image->height(),image->width() * 4);
+ agg::pixfmt_rgba32 pixf(buffer);
+ pixf.premultiply();
marker_ptr mark(boost::make_shared<marker>(image));
result.reset(mark);
if (update_cache)
Please sign in to comment.
Something went wrong with that request. Please try again.