+ don't expose agg headers

This commit is contained in:
Artem Pavlenko 2012-05-04 10:23:49 +01:00
parent b0f87ee9b2
commit 9ba04738d6
4 changed files with 67 additions and 34 deletions

View File

@ -27,7 +27,7 @@
#include <mapnik/rule.hpp>
#include <mapnik/feature.hpp>
#include <mapnik/enumeration.hpp>
#include <mapnik/image_filter.hpp>
#include <mapnik/image_filter_types.hpp>
// boost
#include <boost/optional.hpp>

View File

@ -24,10 +24,11 @@
#ifndef MAPNIK_IMAGE_FILTER_HPP
#define MAPNIK_IMAGE_FILTER_HPP
//mapnik
#include <mapnik/image_filter_types.hpp>
// boost
#include <boost/gil/gil_all.hpp>
#include <boost/variant.hpp>
#include <boost/concept_check.hpp>
// agg
#include "agg_basics.h"
#include "agg_rendering_buffer.h"
@ -122,24 +123,6 @@ static const float edge_detect_matrix[] = {0,1,0,1,-4,1,0,1,0 };
}
struct blur {};
struct emboss {};
struct sharpen {};
struct edge_detect {};
struct sobel {};
struct agg_stack_blur
{
agg_stack_blur(unsigned rx_, unsigned ry_)
: rx(rx_),ry(ry_) {}
unsigned rx;
unsigned ry;
};
struct gray {};
struct x_gradient {};
struct y_gradient {};
struct invert {};
template <typename Src, typename Dst, typename Conv>
void process_channel_impl (Src const& src, Dst & dst, Conv const& k)
@ -381,18 +364,6 @@ void apply_filter(Src & src, invert)
}
}
typedef boost::variant<filter::blur,
filter::gray,
filter::agg_stack_blur,
filter::emboss,
filter::sharpen,
filter::edge_detect,
filter::sobel,
filter::x_gradient,
filter::y_gradient,
filter::invert> filter_type;
template <typename Src>
struct filter_visitor : boost::static_visitor<void>
{

View File

@ -0,0 +1,62 @@
/*****************************************************************************
*
* This file is part of Mapnik (c++ mapping toolkit)
*
* Copyright (C) 2012 Artem Pavlenko
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
#ifndef MAPNIK_IMAGE_FILTER_TYPES_HPP
#define MAPNIK_IMAGE_FILTER_TYPES_HPP
#include <boost/variant.hpp>
namespace mapnik { namespace filter {
struct blur {};
struct emboss {};
struct sharpen {};
struct edge_detect {};
struct sobel {};
struct gray {};
struct x_gradient {};
struct y_gradient {};
struct invert {};
struct agg_stack_blur
{
agg_stack_blur(unsigned rx_, unsigned ry_)
: rx(rx_),ry(ry_) {}
unsigned rx;
unsigned ry;
};
typedef boost::variant<filter::blur,
filter::gray,
filter::agg_stack_blur,
filter::emboss,
filter::sharpen,
filter::edge_detect,
filter::sobel,
filter::x_gradient,
filter::y_gradient,
filter::invert> filter_type;
}}
#endif // MAPNIK_IMAGE_FILTER_TYPES_HPP

View File

@ -34,7 +34,7 @@
#include <mapnik/svg/svg_renderer.hpp>
#include <mapnik/svg/svg_path_adapter.hpp>
#include <mapnik/image_compositing.hpp>
#include <mapnik/image_filter.hpp>
// agg
#define AGG_RENDERING_BUFFER row_ptr_cache<int8u>
#include "agg_rendering_buffer.h"