added raster_symbolizer

This commit is contained in:
Artem Pavlenko 2006-02-07 16:16:54 +00:00
parent af2601eea0
commit 6a4070a32a
6 changed files with 52 additions and 1 deletions

View file

@ -33,6 +33,7 @@ namespace mapnik
void process(line_pattern_symbolizer const& sym,Feature const& feature);
void process(polygon_symbolizer const& sym,Feature const& feature);
void process(polygon_pattern_symbolizer const& sym,Feature const& feature);
void process(raster_symbolizer const& sym,Feature const& feature);
private:
Image32 & pixmap_;
CoordTransform t_;

View file

@ -67,6 +67,11 @@ namespace mapnik
{
output_.process(sym,f_);
}
void operator () (raster_symbolizer const& sym) const
{
output_.process(sym,f_);
}
Processor & output_;
Feature const& f_;

View file

@ -49,6 +49,7 @@
#include "polygon_pattern_symbolizer.hpp"
#include "line_pattern_symbolizer.hpp"
#include "point_symbolizer.hpp"
#include "raster_symbolizer.hpp"
#include "image_util.hpp"
#include "datasource.hpp"
#include "layer.hpp"

View file

@ -0,0 +1,31 @@
/* This file is part of Mapnik (c++ mapping toolkit)
* Copyright (C) 2005 Artem Pavlenko
*
* Mapnik is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
//$Id$
#ifndef RASTER_SYMBOLIZER_HPP
#define RASTER_SYMBOLIZER_HPP
#include <boost/shared_ptr.hpp>
namespace mapnik
{
struct raster_symbolizer { /* TODO */};
}
#endif //RASTER_SYMBOLIZER

View file

@ -24,6 +24,7 @@
#include "polygon_symbolizer.hpp"
#include "polygon_pattern_symbolizer.hpp"
#include "point_symbolizer.hpp"
#include "raster_symbolizer.hpp"
#include "filter.hpp"
#include <boost/shared_ptr.hpp>
#include <boost/variant.hpp>
@ -37,7 +38,8 @@ namespace mapnik
line_symbolizer,
line_pattern_symbolizer,
polygon_symbolizer,
polygon_pattern_symbolizer> symbolizer;
polygon_pattern_symbolizer,
raster_symbolizer> symbolizer;
typedef std::vector<symbolizer> symbolizers;
template <typename FeatureT> class all_filter;

View file

@ -332,4 +332,15 @@ namespace mapnik
agg::render_scanlines(ras, sl, rp);
}
}
void agg_renderer::process(raster_symbolizer const& ,Feature const& feature)
{
// TODO -- at the moment raster_symbolizer is an empty class
// used for type dispatching, but we can have some fancy raster
// processing in a future (filters??). Just copy raster into pixmap for now.
raster_ptr const& raster=feature.get_raster();
if (raster)
{
pixmap_.set_rectangle(raster->x_,raster->y_,raster->data_);
}
}
}