mirror of
https://github.com/mapnik/mapnik.git
synced 2025-12-08 20:13:09 +00:00
premultiply marker images once, before caching - refs #1262
This commit is contained in:
parent
65156a59ed
commit
3272707548
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user