Compare commits

...

2 commits

Author SHA1 Message Date
Dane Springmeyer
f5227d7f18 need to demultiply to write proper alpha into png 2012-10-12 17:54:29 -07:00
Tom MacWright
1732a2ac54 Stash simple incremental images implementation 2012-10-10 14:33:15 -04:00
2 changed files with 9 additions and 1 deletions

View file

@ -135,6 +135,7 @@ private:
mutable bool style_level_compositing_; mutable bool style_level_compositing_;
unsigned width_; unsigned width_;
unsigned height_; unsigned height_;
unsigned renderer_pass_;
double scale_factor_; double scale_factor_;
CoordTransform t_; CoordTransform t_;
freetype_engine font_engine_; freetype_engine font_engine_;

View file

@ -72,6 +72,7 @@ agg_renderer<T>::agg_renderer(Map const& m, T & pixmap, double scale_factor, uns
style_level_compositing_(false), style_level_compositing_(false),
width_(pixmap_.width()), width_(pixmap_.width()),
height_(pixmap_.height()), height_(pixmap_.height()),
renderer_pass_(0),
scale_factor_(scale_factor), scale_factor_(scale_factor),
t_(m.width(),m.height(),m.get_current_extent(),offset_x,offset_y), t_(m.width(),m.height(),m.get_current_extent(),offset_x,offset_y),
font_engine_(), font_engine_(),
@ -92,6 +93,7 @@ agg_renderer<T>::agg_renderer(Map const& m, T & pixmap, boost::shared_ptr<label_
style_level_compositing_(false), style_level_compositing_(false),
width_(pixmap_.width()), width_(pixmap_.width()),
height_(pixmap_.height()), height_(pixmap_.height()),
renderer_pass_(0),
scale_factor_(scale_factor), scale_factor_(scale_factor),
t_(m.width(),m.height(),m.get_current_extent(),offset_x,offset_y), t_(m.width(),m.height(),m.get_current_extent(),offset_x,offset_y),
font_engine_(), font_engine_(),
@ -200,7 +202,7 @@ void agg_renderer<T>::start_layer_processing(layer const& lay, box2d<double> con
} }
template <typename T> template <typename T>
void agg_renderer<T>::end_layer_processing(layer const&) void agg_renderer<T>::end_layer_processing(layer const& lay)
{ {
MAPNIK_LOG_DEBUG(agg_renderer) << "agg_renderer: End layer processing"; MAPNIK_LOG_DEBUG(agg_renderer) << "agg_renderer: End layer processing";
} }
@ -269,6 +271,11 @@ void agg_renderer<T>::end_style_processing(feature_type_style const& st)
} }
} }
MAPNIK_LOG_DEBUG(agg_renderer) << "agg_renderer: End processing style"; MAPNIK_LOG_DEBUG(agg_renderer) << "agg_renderer: End processing style";
// copy pixmap so demultiply will not impact main buffer
mapnik::image_32 pix_tmp = pixmap_;
pix_tmp.demultiply();
mapnik::save_to_file(pix_tmp, (boost::format("%02d_style.png") % renderer_pass_).str(),"png");
renderer_pass_++;
} }
template <typename T> template <typename T>