embose -> emboss

This commit is contained in:
Dane Springmeyer 2012-04-18 07:37:46 -07:00
parent cfa2ffc52e
commit dab6936f05
3 changed files with 10 additions and 8 deletions

View file

@ -26,6 +26,8 @@
// stl // stl
#include <string> #include <string>
#include <boost/optional.hpp>
namespace mapnik namespace mapnik
{ {
@ -64,7 +66,7 @@ enum composite_mode_e
invert_rgb invert_rgb
}; };
composite_mode_e comp_op_from_string(std::string const& name); boost::optional<composite_mode_e> comp_op_from_string(std::string const& name);
template <typename T1, typename T2> template <typename T1, typename T2>
void composite(T1 & im, T2 & im2, composite_mode_e mode); void composite(T1 & im, T2 & im2, composite_mode_e mode);

View file

@ -71,7 +71,7 @@
//if (out_value < 0) out_value = 0; //if (out_value < 0) out_value = 0;
//if (out_value > 255) out_value = 255; //if (out_value > 255) out_value = 255;
// embose // emboss
// -2 -1 0 // -2 -1 0
// -1 1 1 // -1 1 1
// 0 1 2 // 0 1 2
@ -121,14 +121,14 @@ using namespace boost::gil;
namespace mapnik { namespace filter { namespace detail { namespace mapnik { namespace filter { namespace detail {
static const float blur_matrix[] = {0.1111,0.1111,0.1111,0.1111,0.1111,0.1111,0.1111,0.1111,0.1111}; static const float blur_matrix[] = {0.1111,0.1111,0.1111,0.1111,0.1111,0.1111,0.1111,0.1111,0.1111};
static const float embose_matrix[] = {-2,-1,0,-1,1,1,0,1,2}; static const float emboss_matrix[] = {-2,-1,0,-1,1,1,0,1,2};
static const float sharpen_matrix[] = {0,-1,0,-1,5,-1,0,-1,0 }; static const float sharpen_matrix[] = {0,-1,0,-1,5,-1,0,-1,0 };
static const float edge_detect_matrix[] = {0,1,0,1,-4,1,0,1,0 }; static const float edge_detect_matrix[] = {0,1,0,1,-4,1,0,1,0 };
} }
struct blur {}; struct blur {};
struct embose {}; struct emboss {};
struct sharpen {}; struct sharpen {};
struct edge_detect {}; struct edge_detect {};
struct sobel {}; struct sobel {};
@ -172,9 +172,9 @@ void process_channel (Src const& src, Dst & dst, mapnik::filter::blur)
} }
template <typename Src, typename Dst> template <typename Src, typename Dst>
void process_channel (Src const& src, Dst & dst, mapnik::filter::embose) void process_channel (Src const& src, Dst & dst, mapnik::filter::emboss)
{ {
process_channel_impl(src,dst,mapnik::filter::detail::embose_matrix); process_channel_impl(src,dst,mapnik::filter::detail::emboss_matrix);
} }
template <typename Src, typename Dst> template <typename Src, typename Dst>
@ -385,7 +385,7 @@ void apply_filter(Src & src, invert)
typedef boost::variant<filter::blur, typedef boost::variant<filter::blur,
filter::gray, filter::gray,
filter::agg_stack_blur, filter::agg_stack_blur,
filter::embose, filter::emboss,
filter::sharpen, filter::sharpen,
filter::edge_detect, filter::edge_detect,
filter::sobel, filter::sobel,

View file

@ -55,7 +55,7 @@ struct image_filter_grammar :
start = -(filter % no_skip[*char_("; ")]) start = -(filter % no_skip[*char_("; ")])
; ;
filter = filter =
lit("embose")[push_back(_val,construct<mapnik::filter::embose>())] lit("emboss")[push_back(_val,construct<mapnik::filter::emboss>())]
| |
lit("blur")[push_back(_val,construct<mapnik::filter::blur>())] lit("blur")[push_back(_val,construct<mapnik::filter::blur>())]
| |