diff --git a/bindings/python/mapnik_shield_symbolizer.cpp b/bindings/python/mapnik_shield_symbolizer.cpp index 5da6bad6a..57e5497f3 100644 --- a/bindings/python/mapnik_shield_symbolizer.cpp +++ b/bindings/python/mapnik_shield_symbolizer.cpp @@ -197,10 +197,6 @@ void export_shield_symbolizer() .add_property("shield_displacement", get_shield_displacement, set_shield_displacement) - .add_property("text_opacity", - &shield_symbolizer::get_text_opacity, - &shield_symbolizer::set_text_opacity, - "Set/get the text opacity") .add_property("text_transform", &shield_symbolizer::get_text_transform, &shield_symbolizer::set_text_transform, diff --git a/bindings/python/mapnik_text_placement.cpp b/bindings/python/mapnik_text_placement.cpp index b0abced77..79eee3366 100644 --- a/bindings/python/mapnik_text_placement.cpp +++ b/bindings/python/mapnik_text_placement.cpp @@ -127,7 +127,6 @@ void export_text_placement() .def_readwrite("text_size", &char_properties::text_size) .def_readwrite("character_spacing", &char_properties::character_spacing) .def_readwrite("line_spacing", &char_properties::line_spacing) - .def_readwrite("text_opacity", &char_properties::text_opacity) .def_readwrite("wrap_char", &char_properties::wrap_char) .def_readwrite("wrap_before", &char_properties::wrap_before) .def_readwrite("text_transform", &char_properties::text_transform) diff --git a/bindings/python/mapnik_text_symbolizer.cpp b/bindings/python/mapnik_text_symbolizer.cpp index 47f48699d..b7b4528e0 100644 --- a/bindings/python/mapnik_text_symbolizer.cpp +++ b/bindings/python/mapnik_text_symbolizer.cpp @@ -76,7 +76,6 @@ struct text_symbolizer_pickle_suite : boost::python::pickle_suite extras.append(t.get_wrap_before()); extras.append(t.get_horizontal_alignment()); extras.append(t.get_justify_alignment()); - extras.append(t.get_text_opacity()); extras.append(t.get_minimum_padding()); extras.append(t.get_minimum_path_length()); @@ -135,9 +134,8 @@ struct text_symbolizer_pickle_suite : boost::python::pickle_suite t.set_wrap_before(extract(extras[4])); t.set_horizontal_alignment(extract(extras[5])); t.set_justify_alignment(extract(extras[6])); - t.set_text_opacity(extract(extras[7])); - t.set_minimum_padding(extract(extras[8])); - t.set_minimum_path_length(extract(extras[9])); + t.set_minimum_padding(extract(extras[7])); + t.set_minimum_path_length(extract(extras[8])); } }; @@ -231,10 +229,6 @@ void export_text_symbolizer() &text_symbolizer::set_minimum_path_length) .add_property("name",&text_symbolizer::get_name, &text_symbolizer::set_name) - .add_property("opacity", - &text_symbolizer::get_text_opacity, - &text_symbolizer::set_text_opacity, - "Set/get the text opacity") .add_property("text_transform", &text_symbolizer::get_text_transform, &text_symbolizer::set_text_transform, diff --git a/include/mapnik/font_engine_freetype.hpp b/include/mapnik/font_engine_freetype.hpp index cbce5e43e..ae41aca01 100644 --- a/include/mapnik/font_engine_freetype.hpp +++ b/include/mapnik/font_engine_freetype.hpp @@ -349,7 +349,7 @@ struct text_renderer : private boost::noncopyable void render_id(int feature_id,double x0, double y0, double min_radius=1.0); private: - void render_bitmap(FT_Bitmap *bitmap, unsigned rgba, int x, int y, double opacity) + void render_bitmap(FT_Bitmap *bitmap, unsigned rgba, int x, int y) { int x_max=x+bitmap->width; int y_max=y+bitmap->rows; @@ -362,7 +362,7 @@ private: int gray=bitmap->buffer[q*bitmap->width+p]; if (gray) { - pixmap_.blendPixel2(i, j, rgba, gray, opacity); + pixmap_.blendPixel(i, j, rgba, gray); } } } diff --git a/include/mapnik/formating/format.hpp b/include/mapnik/formating/format.hpp index 1e61e120c..26f134204 100644 --- a/include/mapnik/formating/format.hpp +++ b/include/mapnik/formating/format.hpp @@ -42,7 +42,6 @@ public: boost::optional text_size; boost::optional character_spacing; boost::optional line_spacing; - boost::optional text_opacity; boost::optional wrap_before; boost::optional wrap_char; boost::optional text_transform; diff --git a/include/mapnik/graphics.hpp b/include/mapnik/graphics.hpp index 72ea1fa02..9712cb410 100644 --- a/include/mapnik/graphics.hpp +++ b/include/mapnik/graphics.hpp @@ -214,17 +214,12 @@ public: } } inline void blendPixel(int x,int y,unsigned int rgba1,int t) - { - blendPixel2(x,y,rgba1,t,1.0); // do not change opacity - } - - inline void blendPixel2(int x,int y,unsigned int rgba1,int t,double opacity) { if (checkBounds(x,y)) { unsigned rgba0 = data_(x,y); #ifdef MAPNIK_BIG_ENDIAN - unsigned a1 = (int)((rgba1 & 0xff) * opacity) & 0xff; // adjust for desired opacity + unsigned a1 = (int)(rgba1 & 0xff); a1 = (t*a1) / 255; if (a1 == 0) return; unsigned r1 = (rgba1 >> 24) & 0xff; @@ -244,7 +239,7 @@ public: a0 = a0 >> 8; data_(x,y)= (a0)| (b0 << 8) | (g0 << 16) | (r0 << 24) ; #else - unsigned a1 = (int)(((rgba1 >> 24) & 0xff) * opacity) & 0xff; // adjust for desired opacity + unsigned a1 = (int)((rgba1 >> 24) & 0xff); a1 = (t*a1) / 255; if (a1 == 0) return; unsigned r1 = rgba1 & 0xff; diff --git a/include/mapnik/grid/grid.hpp b/include/mapnik/grid/grid.hpp index bb8efec49..58f1315e5 100644 --- a/include/mapnik/grid/grid.hpp +++ b/include/mapnik/grid/grid.hpp @@ -265,19 +265,14 @@ public: } inline void blendPixel(value_type feature_id,int x,int y,unsigned int rgba1,int t) - { - blendPixel2(feature_id ,x,y,rgba1,t,1.0); // do not change opacity - } - - inline void blendPixel2(value_type feature_id,int x,int y,unsigned int rgba1,int t,double opacity) { if (checkBounds(x,y)) { #ifdef MAPNIK_BIG_ENDIAN - unsigned a = (int)((rgba1 & 0xff) * opacity) & 0xff; // adjust for desired opacity + unsigned a = (int)(rgba1 & 0xff); // adjust for desired opacity #else - unsigned a = (int)(((rgba1 >> 24) & 0xff) * opacity) & 0xff; // adjust for desired opacity + unsigned a = (int)((rgba1 >> 24) & 0xff); // adjust for desired opacity #endif // if the pixel is more than a tenth // opaque then burn in the feature id diff --git a/include/mapnik/text_properties.hpp b/include/mapnik/text_properties.hpp index 7f7190c51..4288d93d2 100644 --- a/include/mapnik/text_properties.hpp +++ b/include/mapnik/text_properties.hpp @@ -60,7 +60,6 @@ struct char_properties float text_size; double character_spacing; double line_spacing; //Largest total height (fontsize+line_spacing) per line is chosen - double text_opacity; bool wrap_before; unsigned wrap_char; text_transform_e text_transform; //Per expression diff --git a/include/mapnik/text_symbolizer.hpp b/include/mapnik/text_symbolizer.hpp index 72534ffa9..6da656467 100644 --- a/include/mapnik/text_symbolizer.hpp +++ b/include/mapnik/text_symbolizer.hpp @@ -117,8 +117,6 @@ struct MAPNIK_DECL text_symbolizer : public symbolizer_base double get_minimum_path_length() const; void set_allow_overlap(bool overlap); bool get_allow_overlap() const func_deprecated; - void set_text_opacity(double opacity); - double get_text_opacity() const func_deprecated; void set_wrap_before(bool wrap_before); bool get_wrap_before() const func_deprecated; // wrap text at wrap_char immediately before current work void set_horizontal_alignment(horizontal_alignment_e valign); diff --git a/src/font_engine_freetype.cpp b/src/font_engine_freetype.cpp index 61eaf59ef..c768e17c3 100644 --- a/src/font_engine_freetype.cpp +++ b/src/font_engine_freetype.cpp @@ -409,7 +409,7 @@ void text_renderer::render(double x0, double y0) FT_BitmapGlyph bit = (FT_BitmapGlyph)g; render_bitmap(&bit->bitmap, pos->properties->halo_fill.rgba(), bit->left, - height - bit->top, pos->properties->text_opacity); + height - bit->top); } } FT_Done_Glyph(g); @@ -427,7 +427,7 @@ void text_renderer::render(double x0, double y0) FT_BitmapGlyph bit = (FT_BitmapGlyph)pos->image; render_bitmap(&bit->bitmap, pos->properties->fill.rgba(), bit->left, - height - bit->top, pos->properties->text_opacity); + height - bit->top); } } } diff --git a/src/load_map.cpp b/src/load_map.cpp index d8b3be905..ea8edc755 100644 --- a/src/load_map.cpp +++ b/src/load_map.cpp @@ -1408,15 +1408,6 @@ void map_parser::parse_shield_symbolizer( rule & rule, ptree const & sym ) shield_symbol.set_opacity(*opacity); } - // text-opacity - // TODO: Could be problematic because it is named opacity in TextSymbolizer but opacity has a diffrent meaning here. - optional text_opacity = - get_opt_attr(sym, "text-opacity"); - if (text_opacity) - { - shield_symbol.set_text_opacity( * text_opacity ); - } - // unlock_image optional unlock_image = get_opt_attr(sym, "unlock-image"); diff --git a/src/save_map.cpp b/src/save_map.cpp index 54d1c1ac1..ba6447a79 100644 --- a/src/save_map.cpp +++ b/src/save_map.cpp @@ -206,10 +206,6 @@ public: { set_attr(sym_node, "unlock-image", sym.get_unlock_image()); } - if (sym.get_text_opacity() != dfl.get_text_opacity() || explicit_defaults_) - { - set_attr(sym_node, "text-opacity", sym.get_text_opacity()); - } position displacement = sym.get_shield_displacement(); if (displacement.first != dfl.get_shield_displacement().first || explicit_defaults_) { diff --git a/src/text_placements.cpp b/src/text_placements.cpp index 255958835..c4859de40 100644 --- a/src/text_placements.cpp +++ b/src/text_placements.cpp @@ -233,7 +233,6 @@ char_properties::char_properties() : text_size(10.0), character_spacing(0), line_spacing(0), - text_opacity(1.0), wrap_before(false), wrap_char(' '), text_transform(NONE), @@ -262,8 +261,6 @@ void char_properties::from_xml(boost::property_tree::ptree const &sym, std::map< if (tconvert_) text_transform = *tconvert_; optional line_spacing_ = get_opt_attr(sym, "line-spacing"); if (line_spacing_) line_spacing = *line_spacing_; - optional opacity_ = get_opt_attr(sym, "opacity"); - if (opacity_) text_opacity = *opacity_; optional wrap_char_ = get_opt_attr(sym, "wrap-character"); if (wrap_char_ && (*wrap_char_).size() > 0) wrap_char = ((*wrap_char_)[0]); optional face_name_ = get_opt_attr(sym, "face-name"); @@ -343,11 +340,6 @@ void char_properties::to_xml(boost::property_tree::ptree &node, bool explicit_de { set_attr(node, "character-spacing", character_spacing); } - // for shield_symbolizer this is later overridden - if (text_opacity != dfl.text_opacity || explicit_defaults) - { - set_attr(node, "opacity", text_opacity); - } } /************************************************************************/ diff --git a/src/text_processing.cpp b/src/text_processing.cpp index f9b74f3f3..e45cc3101 100644 --- a/src/text_processing.cpp +++ b/src/text_processing.cpp @@ -206,7 +206,6 @@ void format_node::to_xml(ptree &xml) const if (text_size) set_attr(new_node, "size", *text_size); if (character_spacing) set_attr(new_node, "character-spacing", *character_spacing); if (line_spacing) set_attr(new_node, "line-spacing", *line_spacing); - if (text_opacity) set_attr(new_node, "opacity", *text_opacity); if (wrap_before) set_attr(new_node, "wrap-before", *wrap_before); if (wrap_char) set_attr(new_node, "wrap-character", *wrap_char); if (text_transform) set_attr(new_node, "text-transform", *text_transform); @@ -230,7 +229,6 @@ node_ptr format_node::from_xml(ptree const& xml) n->text_size = get_opt_attr(xml, "size"); n->character_spacing = get_opt_attr(xml, "character-spacing"); n->line_spacing = get_opt_attr(xml, "line-spacing"); - n->text_opacity = get_opt_attr(xml, "opactity"); boost::optional wrap = get_opt_attr(xml, "wrap-before"); if (wrap) n->wrap_before = *wrap; n->wrap_char = get_opt_attr(xml, "wrap-character"); @@ -249,7 +247,6 @@ void format_node::apply(char_properties const& p, const Feature &feature, proces if (text_size) new_properties.text_size = *text_size; if (character_spacing) new_properties.character_spacing = *character_spacing; if (line_spacing) new_properties.line_spacing = *line_spacing; - if (text_opacity) new_properties.text_opacity = *text_opacity; if (wrap_before) new_properties.wrap_before = *wrap_before; if (wrap_char) new_properties.wrap_char = *wrap_char; if (text_transform) new_properties.text_transform = *text_transform; diff --git a/src/text_symbolizer.cpp b/src/text_symbolizer.cpp index 788dd1460..8ac81d13b 100644 --- a/src/text_symbolizer.cpp +++ b/src/text_symbolizer.cpp @@ -406,16 +406,6 @@ bool text_symbolizer::get_allow_overlap() const return placement_options_->properties.allow_overlap; } -void text_symbolizer::set_text_opacity(double text_opacity) -{ - placement_options_->properties.default_format.text_opacity = text_opacity; -} - -double text_symbolizer::get_text_opacity() const -{ - return placement_options_->properties.default_format.text_opacity; -} - void text_symbolizer::set_vertical_alignment(vertical_alignment_e valign) { placement_options_->properties.valign = valign;