Permalink
Browse files

Merge branch 'master' of github.com:mapnik/mapnik

  • Loading branch information...
2 parents b68ea3b + 774e1b1 commit 4e60c0cc9b98604959c3d2fdbc9a864914626b46 Dane Springmeyer committed Jul 25, 2012
Showing with 39 additions and 47 deletions.
  1. +12 −9 include/mapnik/text_placements/dummy.hpp
  2. +12 −19 src/agg/process_markers_symbolizer.cpp
  3. +15 −19 src/build.py
@@ -22,33 +22,36 @@
#ifndef PLACEMENTS_DUMMY_HPP
#define PLACEMENTS_DUMMY_HPP
+// mapnik
#include <mapnik/config.hpp>
#include <mapnik/text_placements/base.hpp>
+// boost
+#include <boost/concept_check.hpp>
namespace mapnik
{
class text_placements_info_dummy;
-/** Dummy placement algorithm. Always takes the default value. */
+// Dummy placement algorithm. Always takes the default value.
class MAPNIK_DECL text_placements_dummy: public text_placements
{
public:
- text_placement_info_ptr get_placement_info(double scale_factor) const;
- friend class text_placement_info_dummy;
+text_placement_info_ptr get_placement_info(double scale_factor) const;
+friend class text_placement_info_dummy;
};
-/** Placement info object for dummy placement algorithm. Always takes the default value. */
+// Placement info object for dummy placement algorithm. Always takes the default value.
class MAPNIK_DECL text_placement_info_dummy : public text_placement_info
{
public:
- text_placement_info_dummy(text_placements_dummy const* parent, double scale_factor)
- : text_placement_info(parent, scale_factor),
- state(0), parent_(parent) {}
+text_placement_info_dummy(text_placements_dummy const* parent, double scale_factor)
+ : text_placement_info(parent, scale_factor),
+ state(0) {}
+
bool next();
private:
- unsigned state;
- text_placements_dummy const* parent_;
+unsigned state;
};
} //ns mapnik
@@ -142,26 +142,18 @@ struct vector_markers_rasterizer_dispatch
};
template <typename Rasterizer, typename RendererBuffer>
-void render_raster_marker(Rasterizer & ras, RendererBuffer & renb, agg::scanline_u8 & sl,
- pixel_position const& pos, image_data_32 const& src,
- agg::trans_affine const& tr,double opacity,
- double scale_factor)
+void render_raster_marker(Rasterizer & ras, RendererBuffer & renb,
+ agg::scanline_u8 & sl, image_data_32 const& src,
+ agg::trans_affine const& marker_tr, double opacity)
{
double width = src.width();
double height = src.height();
double p[8];
- p[0] = pos.x; p[1] = pos.y;
- p[2] = pos.x + width; p[3] = pos.y;
- p[4] = pos.x + width; p[5] = pos.y + height;
- p[6] = pos.x; p[7] = pos.y + height;
-
- agg::trans_affine marker_tr;
-
- marker_tr *= agg::trans_affine_translation(-pos.x,-pos.y);
- marker_tr *= tr;
- marker_tr *= agg::trans_affine_scaling(scale_factor);
- marker_tr *= agg::trans_affine_translation(pos.x,pos.y);
+ p[0] = 0; p[1] = 0;
+ p[2] = width; p[3] = 0;
+ p[4] = width; p[5] = height;
+ p[6] = 0; p[7] = height;
marker_tr.transform(&p[0], &p[1]);
marker_tr.transform(&p[2], &p[3]);
@@ -244,8 +236,8 @@ struct raster_markers_rasterizer_dispatch
detector_.has_placement(transformed_bbox))
{
- render_raster_marker(ras_, renb_, sl_, pixel_position(x,y), src_,
- marker_trans_, sym_.get_opacity(), scale_factor_);
+ render_raster_marker(ras_, renb_, sl_, src_,
+ matrix, sym_.get_opacity());
if (!sym_.get_ignore_placement())
detector_.insert(transformed_bbox);
}
@@ -261,8 +253,9 @@ struct raster_markers_rasterizer_dispatch
{
agg::trans_affine matrix = marker_trans_;
matrix.rotate(angle);
- render_raster_marker(ras_, renb_, sl_, pixel_position(x,y), src_,
- matrix, sym_.get_opacity(), scale_factor_);
+ matrix.translate(x,y);
+ render_raster_marker(ras_, renb_, sl_, src_,
+ matrix, sym_.get_opacity());
}
}
}
View
@@ -25,15 +25,11 @@
import glob
from copy import copy
from subprocess import Popen, PIPE
-from colorizer import colorizer
-col = colorizer()
Import('env')
lib_env = env.Clone()
-col.colorize(lib_env)
-
def call(cmd, silent=True):
stdin, stderr = Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE).communicate()
if not stderr:
@@ -288,21 +284,21 @@ def ldconfig(*args,**kwargs):
if env['SVG_RENDERER']: # svg backend
source += Split(
"""
- svg/svg_renderer.cpp
- svg/svg_generator.cpp
- svg/svg_output_attributes.cpp
- svg/process_symbolizers.cpp
- svg/process_building_symbolizer.cpp
- svg/process_line_pattern_symbolizer.cpp
- svg/process_line_symbolizer.cpp
- svg/process_markers_symbolizer.cpp
- svg/process_point_symbolizer.cpp
- svg/process_polygon_pattern_symbolizer.cpp
- svg/process_polygon_symbolizer.cpp
- svg/process_raster_symbolizer.cpp
- svg/process_shield_symbolizer.cpp
- svg/process_text_symbolizer.cpp
- """)
+ svg/svg_renderer.cpp
+ svg/svg_generator.cpp
+ svg/svg_output_attributes.cpp
+ svg/process_symbolizers.cpp
+ svg/process_building_symbolizer.cpp
+ svg/process_line_pattern_symbolizer.cpp
+ svg/process_line_symbolizer.cpp
+ svg/process_markers_symbolizer.cpp
+ svg/process_point_symbolizer.cpp
+ svg/process_polygon_pattern_symbolizer.cpp
+ svg/process_polygon_symbolizer.cpp
+ svg/process_raster_symbolizer.cpp
+ svg/process_shield_symbolizer.cpp
+ svg/process_text_symbolizer.cpp
+ """)
lib_env.Append(CXXFLAGS = '-DSVG_RENDERER')
libmapnik_cxxflags.append('-DSVG_RENDERER')

0 comments on commit 4e60c0c

Please sign in to comment.