Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

pattern source is only used by line_pattern_symbolizer so move it to …

…that cpp
  • Loading branch information...
commit c0fd6802ed133b9e9108ed00b11c8256b997ee0e 1 parent c27530e
@springmeyer springmeyer authored
View
26 src/agg/agg_renderer.cpp
@@ -62,32 +62,6 @@
namespace mapnik
{
-class pattern_source : private boost::noncopyable
-{
-public:
- pattern_source(image_data_32 const& pattern)
- : pattern_(pattern) {}
-
- unsigned int width() const
- {
- return pattern_.width();
- }
- unsigned int height() const
- {
- return pattern_.height();
- }
- agg::rgba8 pixel(int x, int y) const
- {
- unsigned c = pattern_(x,y);
- return agg::rgba8(c & 0xff,
- (c >> 8) & 0xff,
- (c >> 16) & 0xff,
- (c >> 24) & 0xff);
- }
-private:
- image_data_32 const& pattern_;
-};
-
template <typename T>
agg_renderer<T>::agg_renderer(Map const& m, T & pixmap, double scale_factor, unsigned offset_x, unsigned offset_y)
View
37 src/agg/process_line_pattern_symbolizer.cpp
@@ -20,8 +20,6 @@
*
*****************************************************************************/
-// boost
-#include <boost/foreach.hpp>
// mapnik
#include <mapnik/debug.hpp>
#include <mapnik/graphics.hpp>
@@ -33,6 +31,7 @@
#include <mapnik/marker_cache.hpp>
#include <mapnik/line_pattern_symbolizer.hpp>
#include <mapnik/vertex_converters.hpp>
+
// agg
#include "agg_basics.h"
#include "agg_rendering_buffer.h"
@@ -47,6 +46,40 @@
#include "agg_renderer_outline_image.h"
#include "agg_conv_clip_polyline.h"
+// boost
+#include <boost/utility.hpp>
+#include <boost/foreach.hpp>
+
+namespace {
+
+class pattern_source : private boost::noncopyable
+{
+public:
+ pattern_source(mapnik::image_data_32 const& pattern)
+ : pattern_(pattern) {}
+
+ unsigned int width() const
+ {
+ return pattern_.width();
+ }
+ unsigned int height() const
+ {
+ return pattern_.height();
+ }
+ agg::rgba8 pixel(int x, int y) const
+ {
+ unsigned c = pattern_(x,y);
+ return agg::rgba8(c & 0xff,
+ (c >> 8) & 0xff,
+ (c >> 16) & 0xff,
+ (c >> 24) & 0xff);
+ }
+private:
+ mapnik::image_data_32 const& pattern_;
+};
+
+}
+
namespace mapnik {
template <typename T>
Please sign in to comment.
Something went wrong with that request. Please try again.