diff --git a/benchmark/test_polygon_clipping.cpp b/benchmark/test_polygon_clipping.cpp index 051c5868a..c883d667f 100644 --- a/benchmark/test_polygon_clipping.cpp +++ b/benchmark/test_polygon_clipping.cpp @@ -45,7 +45,7 @@ void render(mapnik::geometry::multi_polygon const& geom, mapnik::box2d padded_extent(155,134,665,466);//extent; padded_extent.pad(10); mapnik::view_transform tr(im.width(),im.height(),padded_extent,0,0); - agg::rendering_buffer buf(im.getBytes(),im.width(),im.height(), im.getRowSize()); + agg::rendering_buffer buf(im.getBytes(),im.width(),im.height(), im.row_size()); agg::pixfmt_rgba32_plain pixf(buf); ren_base renb(pixf); renderer ren(renb); @@ -388,7 +388,7 @@ public: if (area > 0) { std::reverse(path.begin(), path.end()); - } + } if (!clipper.AddPath(path, ClipperLib::ptSubject, true)) { std::clog << "ptSubject ext failed!\n"; @@ -406,7 +406,7 @@ public: if (area < 0) { std::reverse(path.begin(), path.end()); - } + } if (!clipper.AddPath(path, ClipperLib::ptSubject, true)) { std::clog << "ptSubject ext failed!\n"; diff --git a/include/mapnik/agg_render_marker.hpp b/include/mapnik/agg_render_marker.hpp index 104d99e63..508ae89e4 100644 --- a/include/mapnik/agg_render_marker.hpp +++ b/include/mapnik/agg_render_marker.hpp @@ -80,7 +80,7 @@ void render_raster_marker(RendererType renb, RasterizerType & ras, image_rgba8 c && (std::fabs(0.0 - tr.shx) < agg::affine_epsilon) && (std::fabs(1.0 - tr.sy) < agg::affine_epsilon)) { - agg::rendering_buffer src_buffer((unsigned char *)src.getBytes(),src.width(),src.height(),src.getRowSize()); + agg::rendering_buffer src_buffer((unsigned char *)src.getBytes(),src.width(),src.height(),src.row_size()); pixfmt_pre pixf_mask(src_buffer); if (snap_to_pixels) { @@ -124,7 +124,7 @@ void render_raster_marker(RendererType renb, RasterizerType & ras, image_rgba8 c agg::rendering_buffer marker_buf((unsigned char *)src.getBytes(), src.width(), src.height(), - src.getRowSize()); + src.row_size()); pixfmt_pre pixf(marker_buf); img_accessor_type ia(pixf); agg::trans_affine final_tr(p, 0, 0, width, height); diff --git a/include/mapnik/image.hpp b/include/mapnik/image.hpp index a9d840d96..070f1164e 100644 --- a/include/mapnik/image.hpp +++ b/include/mapnik/image.hpp @@ -85,10 +85,10 @@ private: bool painted_; public: image(); - image(int width, - int height, - bool initialize = true, - bool premultiplied = false, + image(int width, + int height, + bool initialize = true, + bool premultiplied = false, bool painted = false); image(image const& rhs); image(image && rhs) noexcept; @@ -102,8 +102,8 @@ public: const pixel_type& operator() (std::size_t i, std::size_t j) const; std::size_t width() const; std::size_t height() const; - unsigned getSize() const; - unsigned getRowSize() const; + std::size_t size() const; + std::size_t row_size() const; void set(pixel_type const& t); const pixel_type* getData() const; pixel_type* getData(); diff --git a/include/mapnik/image_any.hpp b/include/mapnik/image_any.hpp index ead6ad638..ba76d6c5e 100644 --- a/include/mapnik/image_any.hpp +++ b/include/mapnik/image_any.hpp @@ -29,18 +29,18 @@ namespace mapnik { -using image_base = util::variant; +using image_base = util::variant; struct MAPNIK_DECL image_any : image_base @@ -50,13 +50,13 @@ struct MAPNIK_DECL image_any : image_base image_any(int width, int height, image_dtype type = image_dtype_rgba8, - bool initialize = true, - bool premultiplied = false, + bool initialize = true, + bool premultiplied = false, bool painted = false); template image_any(T && data) noexcept - : image_base(std::move(data)) {} + : image_base(std::move(data)) {} unsigned char const* getBytes() const; unsigned char* getBytes(); @@ -64,8 +64,8 @@ struct MAPNIK_DECL image_any : image_base std::size_t height() const; bool get_premultiplied() const; bool painted() const; - unsigned getSize() const; - unsigned getRowSize() const; + std::size_t size() const; + std::size_t row_size() const; double get_offset() const; double get_scaling() const; image_dtype get_dtype() const; @@ -73,12 +73,12 @@ struct MAPNIK_DECL image_any : image_base void set_scaling(double val); }; -MAPNIK_DECL image_any create_image_any(int width, - int height, - image_dtype type = image_dtype_rgba8, - bool initialize = true, - bool premultiplied = false, - bool painted = false); +MAPNIK_DECL image_any create_image_any(int width, + int height, + image_dtype type = image_dtype_rgba8, + bool initialize = true, + bool premultiplied = false, + bool painted = false); } // end mapnik ns diff --git a/include/mapnik/image_filter.hpp b/include/mapnik/image_filter.hpp index 215703efb..cc080a3a5 100644 --- a/include/mapnik/image_filter.hpp +++ b/include/mapnik/image_filter.hpp @@ -401,7 +401,7 @@ void apply_filter(Src & src, Filter const& filter) template void apply_filter(Src & src, agg_stack_blur const& op) { - agg::rendering_buffer buf(src.getBytes(),src.width(),src.height(), src.getRowSize()); + agg::rendering_buffer buf(src.getBytes(),src.width(),src.height(), src.row_size()); agg::pixfmt_rgba32_pre pixf(buf); agg::stack_blur_rgba32(pixf,op.rx,op.ry); } diff --git a/include/mapnik/image_impl.hpp b/include/mapnik/image_impl.hpp index 44d9bd298..d5bcc81b0 100644 --- a/include/mapnik/image_impl.hpp +++ b/include/mapnik/image_impl.hpp @@ -74,7 +74,7 @@ image::image() offset_(0.0), scaling_(1.0), premultiplied_alpha_(false), - painted_(false) + painted_(false) {} template @@ -140,7 +140,7 @@ bool image::operator==(image const& rhs) const template bool image::operator<(image const& rhs) const { - return getSize() < rhs.getSize(); + return size() < rhs.size(); } template @@ -181,13 +181,13 @@ inline std::size_t image::height() const } template -inline unsigned image::getSize() const +inline std::size_t image::size() const { return dimensions_.height() * dimensions_.width() * pixel_size; } - + template -inline unsigned image::getRowSize() const +inline std::size_t image::row_size() const { return dimensions_.width() * pixel_size; } @@ -223,7 +223,7 @@ inline unsigned char* image::getBytes() } template -inline const typename image::pixel_type* image::getRow(std::size_t row) const +inline typename image::pixel_type const* image::getRow(std::size_t row) const { return pData_ + row * dimensions_.width(); } @@ -281,11 +281,11 @@ inline double image::get_scaling() const } template -inline void image::set_scaling(double set) +inline void image::set_scaling(double scaling) { - if (set != 0.0) + if (scaling != 0.0) { - scaling_ = set; + scaling_ = scaling; return; } std::clog << "Can not set scaling to 0.0, offset not set." << std::endl; @@ -322,4 +322,3 @@ inline image_dtype image::get_dtype() const } } // end ns - diff --git a/include/mapnik/image_null.hpp b/include/mapnik/image_null.hpp index 422e4e108..1639349bb 100644 --- a/include/mapnik/image_null.hpp +++ b/include/mapnik/image_null.hpp @@ -42,10 +42,10 @@ public: private: public: image() {} - image(int width, - int height, - bool initialize = true, - bool premultiplied = false, + image(int width, + int height, + bool initialize = true, + bool premultiplied = false, bool painted = false) {} image(image const& rhs) {} image(image && rhs) noexcept {} @@ -56,12 +56,12 @@ public: std::size_t width() const { return 0; } std::size_t height() const { return 0; } - unsigned getSize() const { return 0; } - unsigned getRowSize() const { return 0; } + std::size_t size() const { return 0; } + std::size_t row_size() const { return 0; } void set(pixel_type const& t) { throw std::runtime_error("Can not set values for null image"); } pixel_type& operator() (std::size_t i, std::size_t j) { throw std::runtime_error("Can not get or set values for null image"); } - const pixel_type& operator() (std::size_t i, std::size_t j) const { throw std::runtime_error("Can not get or set values for null image"); } - const unsigned char* getBytes() const { return nullptr; } + pixel_type const& operator() (std::size_t i, std::size_t j) const { throw std::runtime_error("Can not get or set values for null image"); } + unsigned const char* getBytes() const { return nullptr; } unsigned char* getBytes() {return nullptr; } double get_offset() const { return 0.0; } void set_offset(double set) {} diff --git a/include/mapnik/image_view.hpp b/include/mapnik/image_view.hpp index 381fd0da1..e56accf74 100644 --- a/include/mapnik/image_view.hpp +++ b/include/mapnik/image_view.hpp @@ -33,26 +33,26 @@ class image_view public: using pixel = typename T::pixel; using pixel_type = typename T::pixel_type; - static const image_dtype dtype = T::dtype; + static constexpr image_dtype dtype = T::dtype; static constexpr std::size_t pixel_size = sizeof(pixel_type); - - image_view(unsigned x, unsigned y, unsigned width, unsigned height, T const& data); + + image_view(std::size_t x, std::size_t y, std::size_t width, std::size_t height, T const& data); ~image_view(); - + image_view(image_view const& rhs); image_view & operator=(image_view const& rhs); bool operator==(image_view const& rhs) const; bool operator<(image_view const& rhs) const; - unsigned x() const; - unsigned y() const; - unsigned width() const; - unsigned height() const; - const pixel_type& operator() (std::size_t i, std::size_t j) const; - unsigned getSize() const; - unsigned getRowSize() const; - const pixel_type* getRow(unsigned row) const; - const pixel_type* getRow(unsigned row, std::size_t x0) const; + std::size_t x() const; + std::size_t y() const; + std::size_t width() const; + std::size_t height() const; + pixel_type const& operator() (std::size_t i, std::size_t j) const; + std::size_t size() const; + std::size_t row_size() const; + pixel_type const* getRow(std::size_t row) const; + pixel_type const* getRow(std::size_t row, std::size_t x0) const; T const& data() const; bool get_premultiplied() const; double get_offset() const; diff --git a/include/mapnik/image_view_any.hpp b/include/mapnik/image_view_any.hpp index ca975d8a3..6ce0fe5cd 100644 --- a/include/mapnik/image_view_any.hpp +++ b/include/mapnik/image_view_any.hpp @@ -52,8 +52,8 @@ struct MAPNIK_DECL image_view_any : image_view_base std::size_t width() const; std::size_t height() const; - unsigned getSize() const; - unsigned getRowSize() const; + std::size_t size() const; + std::size_t row_size() const; bool get_premultiplied() const; double get_offset() const; double get_scaling() const; diff --git a/include/mapnik/image_view_impl.hpp b/include/mapnik/image_view_impl.hpp index e71176d90..7fe3a1098 100644 --- a/include/mapnik/image_view_impl.hpp +++ b/include/mapnik/image_view_impl.hpp @@ -26,7 +26,7 @@ namespace mapnik { template -image_view::image_view(unsigned x, unsigned y, unsigned width, unsigned height, T const& data) +image_view::image_view(std::size_t x, std::size_t y, std::size_t width, std::size_t height, T const& data) : x_(x), y_(y), width_(width), @@ -71,59 +71,59 @@ bool image_view::operator==(image_view const& rhs) const template bool image_view::operator<(image_view const& rhs) const { - return data_.getSize() < rhs.data_.getSize(); + return data_.size() < rhs.data_.size(); } template -inline unsigned image_view::x() const +inline std::size_t image_view::x() const { return x_; } template -inline unsigned image_view::y() const +inline std::size_t image_view::y() const { return y_; } template -inline unsigned image_view::width() const +inline std::size_t image_view::width() const { return width_; } template -inline unsigned image_view::height() const +inline std::size_t image_view::height() const { return height_; } template -inline const typename image_view::pixel_type& image_view::operator() (std::size_t i, std::size_t j) const +inline typename image_view::pixel_type const& image_view::operator() (std::size_t i, std::size_t j) const { return data_(i,j); } template -inline unsigned image_view::getSize() const +inline std::size_t image_view::size() const { return height_ * width_ * pixel_size; } template -inline unsigned image_view::getRowSize() const +inline std::size_t image_view::row_size() const { return width_ * pixel_size; } template -inline const typename image_view::pixel_type* image_view::getRow(unsigned row) const +inline typename image_view::pixel_type const* image_view::getRow(std::size_t row) const { return data_.getRow(row + y_) + x_; } template -inline const typename image_view::pixel_type* image_view::getRow(unsigned row, std::size_t x0) const +inline typename image_view::pixel_type const* image_view::getRow(std::size_t row, std::size_t x0) const { return data_.getRow(row + y_, x0) + x_; } diff --git a/include/mapnik/image_view_null.hpp b/include/mapnik/image_view_null.hpp index edce0f5cb..c53c5fa79 100644 --- a/include/mapnik/image_view_null.hpp +++ b/include/mapnik/image_view_null.hpp @@ -45,15 +45,15 @@ public: bool operator==(image_view const& rhs) const { return true; } bool operator<(image_view const& rhs) const { return false; } - unsigned x() const { return 0; } - unsigned y() const { return 0; } - unsigned width() const { return 0; } - unsigned height() const { return 0; } + std::size_t x() const { return 0; } + std::size_t y() const { return 0; } + std::size_t width() const { return 0; } + std::size_t height() const { return 0; } pixel_type operator() (std::size_t i, std::size_t j) const { throw std::runtime_error("Can not get from a null image view"); } - unsigned getSize() const { return 0; } - unsigned getRowSize() const { return 0; } - const pixel_type* getRow(unsigned row) const { return nullptr; } - const pixel_type* getRow(unsigned row, std::size_t x0) const { return nullptr; } + std::size_t size() const { return 0; } + std::size_t row_size() const { return 0; } + const pixel_type* getRow(std::size_t row) const { return nullptr; } + const pixel_type* getRow(std::size_t row, std::size_t x0) const { return nullptr; } bool get_premultiplied() const { return false; } double get_offset() const { return 0.0; } double get_scaling() const { return 1.0; } diff --git a/src/agg/agg_renderer.cpp b/src/agg/agg_renderer.cpp index d988e9a2c..71da8af04 100644 --- a/src/agg/agg_renderer.cpp +++ b/src/agg/agg_renderer.cpp @@ -121,9 +121,9 @@ struct setup_agg_bg_visitor opacity_(opacity) {} void operator() (marker_null const&) {} - + void operator() (marker_svg const&) {} - + void operator() (marker_rgba8 const& marker) { mapnik::image_rgba8 const& bg_image = marker.get_data(); @@ -338,7 +338,7 @@ struct agg_render_marker_visitor { agg_render_marker_visitor(renderer_common & common, buffer_type * current_buffer, - std::unique_ptr const& ras_ptr, + std::unique_ptr const& ras_ptr, gamma_method_enum & gamma_method, double & gamma, pixel_position const& pos, @@ -378,11 +378,11 @@ struct agg_render_marker_visitor agg::rendering_buffer buf(current_buffer_->getBytes(), current_buffer_->width(), current_buffer_->height(), - current_buffer_->getRowSize()); + current_buffer_->row_size()); pixfmt_comp_type pixf(buf); pixf.comp_op(static_cast(comp_op_)); renderer_base renb(pixf); - + box2d const& bbox = marker.get_data()->bounding_box(); coord c = bbox.center(); // center the svg marker on '0,0' @@ -429,11 +429,11 @@ struct agg_render_marker_visitor agg::rendering_buffer buf(current_buffer_->getBytes(), current_buffer_->width(), current_buffer_->height(), - current_buffer_->getRowSize()); + current_buffer_->row_size()); pixfmt_comp_type pixf(buf); pixf.comp_op(static_cast(comp_op_)); renderer_base renb(pixf); - + double width = marker.width(); double height = marker.height(); if (std::fabs(1.0 - common_.scale_factor_) < 0.001 @@ -486,7 +486,7 @@ struct agg_render_marker_visitor agg::rendering_buffer marker_buf((unsigned char *)src.getBytes(), src.width(), src.height(), - src.getRowSize()); + src.row_size()); agg::pixfmt_rgba32_pre marker_pixf(marker_buf); using img_accessor_type = agg::image_accessor_clone; using interpolator_type = agg::span_interpolator_linear; @@ -528,7 +528,7 @@ void agg_renderer::render_marker(pixel_position const& pos, { agg_render_marker_visitor visitor(common_, current_buffer_, - ras_ptr, + ras_ptr, gamma_method_, gamma_, pos, @@ -557,7 +557,7 @@ void agg_renderer::debug_draw_box(box2d const& box, agg::rendering_buffer buf(current_buffer_->getBytes(), current_buffer_->width(), current_buffer_->height(), - current_buffer_->getRowSize()); + current_buffer_->row_size()); debug_draw_box(buf, box, x, y, angle); } diff --git a/src/agg/process_building_symbolizer.cpp b/src/agg/process_building_symbolizer.cpp index cad888154..b210fc69d 100644 --- a/src/agg/process_building_symbolizer.cpp +++ b/src/agg/process_building_symbolizer.cpp @@ -58,7 +58,7 @@ void agg_renderer::process(building_symbolizer const& sym, using ren_base = agg::renderer_base; using renderer = agg::renderer_scanline_aa_solid; - agg::rendering_buffer buf(current_buffer_->getBytes(),current_buffer_->width(),current_buffer_->height(), current_buffer_->getRowSize()); + agg::rendering_buffer buf(current_buffer_->getBytes(),current_buffer_->width(),current_buffer_->height(), current_buffer_->row_size()); agg::pixfmt_rgba32_pre pixf(buf); ren_base renb(pixf); diff --git a/src/agg/process_debug_symbolizer.cpp b/src/agg/process_debug_symbolizer.cpp index e0b31b5d5..ef805f4a4 100644 --- a/src/agg/process_debug_symbolizer.cpp +++ b/src/agg/process_debug_symbolizer.cpp @@ -126,7 +126,7 @@ struct RingRenderer { agg::rgba8 const& color) { ras_ptr_.reset(); - agg::rendering_buffer buf(im_.getBytes(),im_.width(),im_.height(),im_.getRowSize()); + agg::rendering_buffer buf(im_.getBytes(),im_.width(),im_.height(),im_.row_size()); pixfmt_comp_type pixf(buf); renderer_base renb(pixf); renderer_type ren(renb); @@ -143,7 +143,7 @@ struct RingRenderer { double stroke_width=3) { ras_ptr_.reset(); - agg::rendering_buffer buf(im_.getBytes(),im_.width(),im_.height(),im_.getRowSize()); + agg::rendering_buffer buf(im_.getBytes(),im_.width(),im_.height(),im_.row_size()); pixfmt_comp_type pixf(buf); renderer_base renb(pixf); renderer_type ren(renb); diff --git a/src/agg/process_dot_symbolizer.cpp b/src/agg/process_dot_symbolizer.cpp index 2c9dd141f..867997808 100644 --- a/src/agg/process_dot_symbolizer.cpp +++ b/src/agg/process_dot_symbolizer.cpp @@ -111,7 +111,7 @@ void agg_renderer::process(dot_symbolizer const& sym, double opacity = get(sym, keys::opacity, feature, common_.vars_, 1.0); color const& fill = get(sym, keys::fill, feature, common_.vars_, mapnik::color(128,128,128)); ras_ptr->reset(); - agg::rendering_buffer buf(current_buffer_->getBytes(),current_buffer_->width(),current_buffer_->height(),current_buffer_->getRowSize()); + agg::rendering_buffer buf(current_buffer_->getBytes(),current_buffer_->width(),current_buffer_->height(),current_buffer_->row_size()); using blender_type = agg::comp_op_adaptor_rgba_pre; using pixfmt_comp_type = agg::pixfmt_custom_blend_rgba; using renderer_base = agg::renderer_base; diff --git a/src/agg/process_group_symbolizer.cpp b/src/agg/process_group_symbolizer.cpp index 2ee6416c3..14a6a1850 100644 --- a/src/agg/process_group_symbolizer.cpp +++ b/src/agg/process_group_symbolizer.cpp @@ -81,7 +81,7 @@ struct thunk_renderer renderer_type, pixfmt_comp_type>; ras_ptr_->reset(); - buf_type render_buffer(buf_->getBytes(), buf_->width(), buf_->height(), buf_->getRowSize()); + buf_type render_buffer(buf_->getBytes(), buf_->width(), buf_->height(), buf_->row_size()); pixfmt_comp_type pixf(render_buffer); pixf.comp_op(static_cast(thunk.comp_op_)); renderer_base renb(pixf); @@ -102,7 +102,7 @@ struct thunk_renderer using renderer_base = agg::renderer_base; ras_ptr_->reset(); - buf_type render_buffer(buf_->getBytes(), buf_->width(), buf_->height(), buf_->getRowSize()); + buf_type render_buffer(buf_->getBytes(), buf_->width(), buf_->height(), buf_->row_size()); pixfmt_comp_type pixf(render_buffer); pixf.comp_op(static_cast(thunk.comp_op_)); renderer_base renb(pixf); diff --git a/src/agg/process_line_pattern_symbolizer.cpp b/src/agg/process_line_pattern_symbolizer.cpp index d5c695131..55e6ffba3 100644 --- a/src/agg/process_line_pattern_symbolizer.cpp +++ b/src/agg/process_line_pattern_symbolizer.cpp @@ -99,7 +99,7 @@ struct agg_renderer_process_visitor_l value_double simplify_tolerance = get(sym_, feature_, common_.vars_); value_double smooth = get(sym_, feature_, common_.vars_); - agg::rendering_buffer buf(current_buffer_->getBytes(),current_buffer_->width(),current_buffer_->height(), current_buffer_->getRowSize()); + agg::rendering_buffer buf(current_buffer_->getBytes(),current_buffer_->width(),current_buffer_->height(), current_buffer_->row_size()); pixfmt_type pixf(buf); pixf.comp_op(static_cast(get(sym_, feature_, common_.vars_))); renderer_base ren_base(pixf); @@ -168,7 +168,7 @@ struct agg_renderer_process_visitor_l value_double smooth = get(sym_, feature_, common_.vars_); agg::rendering_buffer buf(current_buffer_->getBytes(),current_buffer_->width(), - current_buffer_->height(), current_buffer_->getRowSize()); + current_buffer_->height(), current_buffer_->row_size()); pixfmt_type pixf(buf); pixf.comp_op(static_cast(get(sym_, feature_, common_.vars_))); renderer_base ren_base(pixf); diff --git a/src/agg/process_line_symbolizer.cpp b/src/agg/process_line_symbolizer.cpp index 393299a86..44203c755 100644 --- a/src/agg/process_line_symbolizer.cpp +++ b/src/agg/process_line_symbolizer.cpp @@ -108,7 +108,7 @@ void agg_renderer::process(line_symbolizer const& sym, gamma_ = gamma; } - agg::rendering_buffer buf(current_buffer_->getBytes(),current_buffer_->width(),current_buffer_->height(), current_buffer_->getRowSize()); + agg::rendering_buffer buf(current_buffer_->getBytes(),current_buffer_->width(),current_buffer_->height(), current_buffer_->row_size()); using color_type = agg::rgba8; using order_type = agg::order_rgba; diff --git a/src/agg/process_markers_symbolizer.cpp b/src/agg/process_markers_symbolizer.cpp index 446cfa2ff..756d5fc1e 100644 --- a/src/agg/process_markers_symbolizer.cpp +++ b/src/agg/process_markers_symbolizer.cpp @@ -147,8 +147,8 @@ struct raster_markers_rasterizer_dispatch : public raster_markers_dispatchsrc_ provided that converts - // the destination pixel type required. + // In the long term this should be a visitor pattern based on the type of render this->src_ provided that converts + // the destination pixel type required. render_raster_marker(renb_, ras_, this->src_, marker_tr, opacity, this->scale_factor_, snap_to_pixels_); } @@ -192,7 +192,7 @@ void agg_renderer::process(markers_symbolizer const& sym, gamma_ = gamma; } - buf_type render_buffer(current_buffer_->getBytes(), current_buffer_->width(), current_buffer_->height(), current_buffer_->getRowSize()); + buf_type render_buffer(current_buffer_->getBytes(), current_buffer_->width(), current_buffer_->height(), current_buffer_->row_size()); box2d clip_box = clipping_extent(common_); auto renderer_context = std::tie(render_buffer,*ras_ptr,pixmap_); diff --git a/src/agg/process_polygon_pattern_symbolizer.cpp b/src/agg/process_polygon_pattern_symbolizer.cpp index 098fc2e7a..fc4af351f 100644 --- a/src/agg/process_polygon_pattern_symbolizer.cpp +++ b/src/agg/process_polygon_pattern_symbolizer.cpp @@ -87,7 +87,7 @@ struct agg_renderer_process_visitor_p render_pattern(*ras_ptr_, marker, image_tr, 1.0, image); agg::rendering_buffer buf(current_buffer_->getBytes(), current_buffer_->width(), - current_buffer_->height(), current_buffer_->getRowSize()); + current_buffer_->height(), current_buffer_->row_size()); ras_ptr_->reset(); value_double gamma = get(sym_, feature_, common_.vars_); gamma_method_enum gamma_method = get(sym_, feature_, common_.vars_); @@ -203,7 +203,7 @@ struct agg_renderer_process_visitor_p agg::rendering_buffer buf(current_buffer_->getBytes(), current_buffer_->width(), - current_buffer_->height(), current_buffer_->getRowSize()); + current_buffer_->height(), current_buffer_->row_size()); ras_ptr_->reset(); value_double gamma = get(sym_, feature_, common_.vars_); gamma_method_enum gamma_method = get(sym_, feature_, common_.vars_); diff --git a/src/agg/process_polygon_symbolizer.cpp b/src/agg/process_polygon_symbolizer.cpp index a31178a8c..9c1935f28 100644 --- a/src/agg/process_polygon_symbolizer.cpp +++ b/src/agg/process_polygon_symbolizer.cpp @@ -61,7 +61,7 @@ void agg_renderer::process(polygon_symbolizer const& sym, } box2d clip_box = clipping_extent(common_); - agg::rendering_buffer buf(current_buffer_->getBytes(),current_buffer_->width(),current_buffer_->height(), current_buffer_->getRowSize()); + agg::rendering_buffer buf(current_buffer_->getBytes(),current_buffer_->width(),current_buffer_->height(), current_buffer_->row_size()); render_polygon_symbolizer( sym, feature, prj_trans, common_, clip_box, *ras_ptr, diff --git a/src/image_any.cpp b/src/image_any.cpp index 579bb071c..fe75ba8e2 100644 --- a/src/image_any.cpp +++ b/src/image_any.cpp @@ -92,18 +92,18 @@ struct get_painted_visitor struct get_any_size_visitor { template - unsigned operator()(T const& data) const + std::size_t operator()(T const& data) const { - return data.getSize(); + return data.size(); } }; struct get_any_row_size_visitor { template - unsigned operator()(T const& data) const + std::size_t operator()(T const& data) const { - return data.getRowSize(); + return data.row_size(); } }; @@ -156,8 +156,8 @@ struct set_scaling_visitor MAPNIK_DECL image_any::image_any(int width, int height, image_dtype type, - bool initialize, - bool premultiplied, + bool initialize, + bool premultiplied, bool painted) : image_base(std::move(create_image_any(width, height, type, initialize, premultiplied, painted))) {} @@ -191,12 +191,12 @@ MAPNIK_DECL bool image_any::painted() const return util::apply_visitor(detail::get_painted_visitor(),*this); } -MAPNIK_DECL unsigned image_any::getSize() const +MAPNIK_DECL std::size_t image_any::size() const { return util::apply_visitor(detail::get_any_size_visitor(),*this); } -MAPNIK_DECL unsigned image_any::getRowSize() const +MAPNIK_DECL std::size_t image_any::row_size() const { return util::apply_visitor(detail::get_any_row_size_visitor(),*this); } @@ -227,11 +227,11 @@ MAPNIK_DECL void image_any::set_scaling(double val) } -MAPNIK_DECL image_any create_image_any(int width, +MAPNIK_DECL image_any create_image_any(int width, int height, - image_dtype type, - bool initialize, - bool premultiplied, + image_dtype type, + bool initialize, + bool premultiplied, bool painted) { switch (type) diff --git a/src/image_compositing.cpp b/src/image_compositing.cpp index 878b0a611..c184b2f5c 100644 --- a/src/image_compositing.cpp +++ b/src/image_compositing.cpp @@ -139,7 +139,7 @@ struct rendering_buffer uint8_t const* buf() const { return data_.getBytes(); } unsigned width() const { return data_.width();} unsigned height() const { return data_.height();} - int stride() const { return data_.getRowSize();} + int stride() const { return data_.row_size();} uint8_t const* row_ptr(int, int y, unsigned) {return row_ptr(y);} uint8_t const* row_ptr(int y) const { return reinterpret_cast(data_.getRow(y)); } row_data row (int y) const { return row_data(0, data_.width() - 1, row_ptr(y)); } @@ -161,20 +161,20 @@ MAPNIK_DECL void composite(image_rgba8 & dst, image_rgba8 const& src, composite_ using pixfmt_type = agg::pixfmt_custom_blend_rgba; using renderer_type = agg::renderer_base; - agg::rendering_buffer dst_buffer(dst.getBytes(),dst.width(),dst.height(),dst.getRowSize()); + agg::rendering_buffer dst_buffer(dst.getBytes(),dst.width(),dst.height(),dst.row_size()); const_rendering_buffer src_buffer(src); pixfmt_type pixf(dst_buffer); pixf.comp_op(static_cast(mode)); agg::pixfmt_alpha_blend_rgba pixf_mask(src_buffer); #ifdef MAPNIK_DEBUG - if (!src.get_premultiplied()) + if (!src.get_premultiplied()) { throw std::runtime_error("SOURCE MUST BE PREMULTIPLIED FOR COMPOSITING!"); } if (!dst.get_premultiplied()) { throw std::runtime_error("DESTINATION MUST BE PREMULTIPLIED FOR COMPOSITING!"); - } + } #endif renderer_type ren(pixf); ren.blend_from(pixf_mask,0,dx,dy,unsigned(255*opacity)); @@ -203,7 +203,7 @@ namespace detail { struct composite_visitor { - composite_visitor(image_any const& src, + composite_visitor(image_any const& src, composite_mode_e mode, float opacity, int dx, @@ -213,7 +213,7 @@ struct composite_visitor opacity_(opacity), dx_(dx), dy_(dy) {} - + template void operator() (T & dst); @@ -232,7 +232,7 @@ void composite_visitor::operator() (T & dst) } template <> -void composite_visitor::operator() (image_rgba8 & dst) +void composite_visitor::operator() (image_rgba8 & dst) { composite(dst, util::get(src_), mode_, opacity_, dx_, dy_); } diff --git a/src/image_util.cpp b/src/image_util.cpp index 0a861f128..93c286d8b 100644 --- a/src/image_util.cpp +++ b/src/image_util.cpp @@ -38,7 +38,7 @@ #ifdef SSE_MATH #include -#endif +#endif // agg #include "agg_rendering_buffer.h" @@ -136,7 +136,7 @@ MAPNIK_DECL void save_to_stream(T const& image, else throw ImageWriterException("Could not write to empty stream" ); } -// This can be removed once image_any and image_view_any are the only +// This can be removed once image_any and image_view_any are the only // items using this template template <> MAPNIK_DECL void save_to_stream(image_rgba8 const& image, @@ -167,7 +167,7 @@ MAPNIK_DECL void save_to_stream(image_rgba8 const& image, else throw ImageWriterException("Could not write to empty stream" ); } -// This can be removed once image_any and image_view_any are the only +// This can be removed once image_any and image_view_any are the only // items using this template template <> MAPNIK_DECL void save_to_stream(image_view_rgba8 const& image, @@ -214,7 +214,7 @@ MAPNIK_DECL void save_to_stream(T const& image, } else if (boost::algorithm::starts_with(t, "tif")) { - tiff_saver visitor(stream, t); + tiff_saver visitor(stream, t); util::apply_visitor(visitor, image); } else if (boost::algorithm::starts_with(t, "jpeg")) @@ -232,7 +232,7 @@ MAPNIK_DECL void save_to_stream(T const& image, else throw ImageWriterException("Could not write to empty stream" ); } -// This can be removed once image_any and image_view_any are the only +// This can be removed once image_any and image_view_any are the only // items using this template template <> MAPNIK_DECL void save_to_stream(image_rgba8 const& image, @@ -251,7 +251,7 @@ MAPNIK_DECL void save_to_stream(image_rgba8 const& image, } else if (boost::algorithm::starts_with(t, "tif")) { - tiff_saver visitor(stream, t); + tiff_saver visitor(stream, t); visitor(image); //util::apply_visitor(visitor, image); } @@ -272,7 +272,7 @@ MAPNIK_DECL void save_to_stream(image_rgba8 const& image, else throw ImageWriterException("Could not write to empty stream" ); } -// This can be removed once image_any and image_view_any are the only +// This can be removed once image_any and image_view_any are the only // items using this template template <> MAPNIK_DECL void save_to_stream(image_view_rgba8 const& image, @@ -291,7 +291,7 @@ MAPNIK_DECL void save_to_stream(image_view_rgba8 const& image, } else if (boost::algorithm::starts_with(t, "tif")) { - tiff_saver visitor(stream, t); + tiff_saver visitor(stream, t); visitor(image); //util::apply_visitor(visitor, image); } @@ -478,7 +478,7 @@ struct premultiply_visitor { if (!data.get_premultiplied()) { - agg::rendering_buffer buffer(data.getBytes(),data.width(),data.height(),data.getRowSize()); + agg::rendering_buffer buffer(data.getBytes(),data.width(),data.height(),data.row_size()); agg::pixfmt_rgba32 pixf(buffer); pixf.premultiply(); data.set_premultiplied(true); @@ -488,7 +488,7 @@ struct premultiply_visitor } template - bool operator() (T &) + bool operator() (T &) { return false; } @@ -500,7 +500,7 @@ struct demultiply_visitor { if (data.get_premultiplied()) { - agg::rendering_buffer buffer(data.getBytes(),data.width(),data.height(),data.getRowSize()); + agg::rendering_buffer buffer(data.getBytes(),data.width(),data.height(),data.row_size()); agg::pixfmt_rgba32_pre pixf(buffer); pixf.demultiply(); data.set_premultiplied(false); @@ -510,7 +510,7 @@ struct demultiply_visitor } template - bool operator() (T &) + bool operator() (T &) { return false; } @@ -522,7 +522,7 @@ struct set_premultiplied_visitor : status_(status) {} template - void operator() (T & data) + void operator() (T & data) { data.set_premultiplied(status_); } @@ -905,7 +905,7 @@ template MAPNIK_DECL void set_color_to_alpha(image_gray64f &, color const&); namespace detail { template -struct visitor_fill +struct visitor_fill { visitor_fill(T1 const& val) : val_(val) {} @@ -923,7 +923,7 @@ struct visitor_fill { val = std::numeric_limits::min(); } - catch(positive_overflow&) + catch(positive_overflow&) { val = std::numeric_limits::max(); } @@ -939,7 +939,7 @@ struct visitor_fill { visitor_fill(color const& val) : val_(val) {} - + void operator() (image_rgba8 & data) { using pixel_type = image_rgba8::pixel_type; @@ -983,7 +983,7 @@ template MAPNIK_DECL void fill(image_any &, double const&); template MAPNIK_DECL void fill (image_rgba8 & data, T const& val) { - detail::visitor_fill visitor(val); + detail::visitor_fill visitor(val); return visitor(data); } @@ -1002,7 +1002,7 @@ template MAPNIK_DECL void fill(image_rgba8 &, double const&); template MAPNIK_DECL void fill (image_gray8 & data, T const& val) { - detail::visitor_fill visitor(val); + detail::visitor_fill visitor(val); return visitor(data); } @@ -1021,7 +1021,7 @@ template MAPNIK_DECL void fill(image_gray8 &, double const&); template MAPNIK_DECL void fill (image_gray8s & data, T const& val) { - detail::visitor_fill visitor(val); + detail::visitor_fill visitor(val); return visitor(data); } @@ -1040,7 +1040,7 @@ template MAPNIK_DECL void fill(image_gray8s &, double const&); template MAPNIK_DECL void fill (image_gray16 & data, T const& val) { - detail::visitor_fill visitor(val); + detail::visitor_fill visitor(val); return visitor(data); } @@ -1059,7 +1059,7 @@ template MAPNIK_DECL void fill(image_gray16 &, double const&); template MAPNIK_DECL void fill (image_gray16s & data, T const& val) { - detail::visitor_fill visitor(val); + detail::visitor_fill visitor(val); return visitor(data); } @@ -1078,7 +1078,7 @@ template MAPNIK_DECL void fill(image_gray16s &, double const&); template MAPNIK_DECL void fill (image_gray32 & data, T const& val) { - detail::visitor_fill visitor(val); + detail::visitor_fill visitor(val); return visitor(data); } @@ -1097,7 +1097,7 @@ template MAPNIK_DECL void fill(image_gray32 &, double const&); template MAPNIK_DECL void fill (image_gray32s & data, T const& val) { - detail::visitor_fill visitor(val); + detail::visitor_fill visitor(val); return visitor(data); } @@ -1116,7 +1116,7 @@ template MAPNIK_DECL void fill(image_gray32s &, double const&); template MAPNIK_DECL void fill (image_gray32f & data, T const& val) { - detail::visitor_fill visitor(val); + detail::visitor_fill visitor(val); return visitor(data); } @@ -1135,7 +1135,7 @@ template MAPNIK_DECL void fill(image_gray32f &, double const&); template MAPNIK_DECL void fill (image_gray64 & data, T const& val) { - detail::visitor_fill visitor(val); + detail::visitor_fill visitor(val); return visitor(data); } @@ -1154,7 +1154,7 @@ template MAPNIK_DECL void fill(image_gray64 &, double const&); template MAPNIK_DECL void fill (image_gray64s & data, T const& val) { - detail::visitor_fill visitor(val); + detail::visitor_fill visitor(val); return visitor(data); } @@ -1173,7 +1173,7 @@ template MAPNIK_DECL void fill(image_gray64s &, double const&); template MAPNIK_DECL void fill (image_gray64f & data, T const& val) { - detail::visitor_fill visitor(val); + detail::visitor_fill visitor(val); return visitor(data); } @@ -1221,7 +1221,7 @@ struct visitor_set_rectangle } } } - + void operator() (image_null &) { throw std::runtime_error("Set rectangle not support for null images"); @@ -1256,7 +1256,7 @@ struct visitor_set_rectangle int y0_; }; -} // end detail ns +} // end detail ns MAPNIK_DECL void set_rectangle(image_any & dst, image_any const& src, int x, int y) { @@ -1287,8 +1287,8 @@ namespace detail struct visitor_composite_pixel { - // Obviously c variable would only work for rgba8 currently, but didn't want to - // make this a template class until new rgba types exist. + // Obviously c variable would only work for rgba8 currently, but didn't want to + // make this a template class until new rgba types exist. visitor_composite_pixel(unsigned op, int x,int y, unsigned c, unsigned cover, double opacity) : opacity_(opacity), op_(op), @@ -1379,7 +1379,7 @@ struct visitor_set_pixel { val = std::numeric_limits::min(); } - catch(positive_overflow&) + catch(positive_overflow&) { val = std::numeric_limits::max(); } @@ -1685,7 +1685,7 @@ struct visitor_get_pixel { val = std::numeric_limits::min(); } - catch(positive_overflow&) + catch(positive_overflow&) { val = std::numeric_limits::max(); } @@ -1744,7 +1744,7 @@ template MAPNIK_DECL int16_t get_pixel(image_any const&, std::size_t, std::size_ template MAPNIK_DECL uint8_t get_pixel(image_any const&, std::size_t, std::size_t); template MAPNIK_DECL int8_t get_pixel(image_any const&, std::size_t, std::size_t); template MAPNIK_DECL float get_pixel(image_any const&, std::size_t, std::size_t); -template MAPNIK_DECL double get_pixel(image_any const&, std::size_t, std::size_t); +template MAPNIK_DECL double get_pixel(image_any const&, std::size_t, std::size_t); template MAPNIK_DECL T get_pixel (image_view_any const& data, std::size_t x, std::size_t y) @@ -1762,7 +1762,7 @@ template MAPNIK_DECL int16_t get_pixel(image_view_any const&, std::size_t, std:: template MAPNIK_DECL uint8_t get_pixel(image_view_any const&, std::size_t, std::size_t); template MAPNIK_DECL int8_t get_pixel(image_view_any const&, std::size_t, std::size_t); template MAPNIK_DECL float get_pixel(image_view_any const&, std::size_t, std::size_t); -template MAPNIK_DECL double get_pixel(image_view_any const&, std::size_t, std::size_t); +template MAPNIK_DECL double get_pixel(image_view_any const&, std::size_t, std::size_t); template MAPNIK_DECL T get_pixel (image_rgba8 const& data, std::size_t x, std::size_t y) @@ -1781,7 +1781,7 @@ template MAPNIK_DECL int16_t get_pixel(image_rgba8 const&, std::size_t, std::siz template MAPNIK_DECL uint8_t get_pixel(image_rgba8 const&, std::size_t, std::size_t); template MAPNIK_DECL int8_t get_pixel(image_rgba8 const&, std::size_t, std::size_t); template MAPNIK_DECL float get_pixel(image_rgba8 const&, std::size_t, std::size_t); -template MAPNIK_DECL double get_pixel(image_rgba8 const&, std::size_t, std::size_t); +template MAPNIK_DECL double get_pixel(image_rgba8 const&, std::size_t, std::size_t); template MAPNIK_DECL T get_pixel (image_gray8 const& data, std::size_t x, std::size_t y) @@ -1800,7 +1800,7 @@ template MAPNIK_DECL int16_t get_pixel(image_gray8 const&, std::size_t, std::siz template MAPNIK_DECL uint8_t get_pixel(image_gray8 const&, std::size_t, std::size_t); template MAPNIK_DECL int8_t get_pixel(image_gray8 const&, std::size_t, std::size_t); template MAPNIK_DECL float get_pixel(image_gray8 const&, std::size_t, std::size_t); -template MAPNIK_DECL double get_pixel(image_gray8 const&, std::size_t, std::size_t); +template MAPNIK_DECL double get_pixel(image_gray8 const&, std::size_t, std::size_t); template MAPNIK_DECL T get_pixel (image_gray8s const& data, std::size_t x, std::size_t y) @@ -1819,7 +1819,7 @@ template MAPNIK_DECL int16_t get_pixel(image_gray8s const&, std::size_t, std::si template MAPNIK_DECL uint8_t get_pixel(image_gray8s const&, std::size_t, std::size_t); template MAPNIK_DECL int8_t get_pixel(image_gray8s const&, std::size_t, std::size_t); template MAPNIK_DECL float get_pixel(image_gray8s const&, std::size_t, std::size_t); -template MAPNIK_DECL double get_pixel(image_gray8s const&, std::size_t, std::size_t); +template MAPNIK_DECL double get_pixel(image_gray8s const&, std::size_t, std::size_t); template MAPNIK_DECL T get_pixel (image_gray16 const& data, std::size_t x, std::size_t y) @@ -1838,7 +1838,7 @@ template MAPNIK_DECL int16_t get_pixel(image_gray16 const&, std::size_t, std::si template MAPNIK_DECL uint8_t get_pixel(image_gray16 const&, std::size_t, std::size_t); template MAPNIK_DECL int8_t get_pixel(image_gray16 const&, std::size_t, std::size_t); template MAPNIK_DECL float get_pixel(image_gray16 const&, std::size_t, std::size_t); -template MAPNIK_DECL double get_pixel(image_gray16 const&, std::size_t, std::size_t); +template MAPNIK_DECL double get_pixel(image_gray16 const&, std::size_t, std::size_t); template MAPNIK_DECL T get_pixel (image_gray16s const& data, std::size_t x, std::size_t y) @@ -1857,7 +1857,7 @@ template MAPNIK_DECL int16_t get_pixel(image_gray16s const&, std::size_t, std::s template MAPNIK_DECL uint8_t get_pixel(image_gray16s const&, std::size_t, std::size_t); template MAPNIK_DECL int8_t get_pixel(image_gray16s const&, std::size_t, std::size_t); template MAPNIK_DECL float get_pixel(image_gray16s const&, std::size_t, std::size_t); -template MAPNIK_DECL double get_pixel(image_gray16s const&, std::size_t, std::size_t); +template MAPNIK_DECL double get_pixel(image_gray16s const&, std::size_t, std::size_t); template MAPNIK_DECL T get_pixel (image_gray32 const& data, std::size_t x, std::size_t y) @@ -1876,7 +1876,7 @@ template MAPNIK_DECL int16_t get_pixel(image_gray32 const&, std::size_t, std::si template MAPNIK_DECL uint8_t get_pixel(image_gray32 const&, std::size_t, std::size_t); template MAPNIK_DECL int8_t get_pixel(image_gray32 const&, std::size_t, std::size_t); template MAPNIK_DECL float get_pixel(image_gray32 const&, std::size_t, std::size_t); -template MAPNIK_DECL double get_pixel(image_gray32 const&, std::size_t, std::size_t); +template MAPNIK_DECL double get_pixel(image_gray32 const&, std::size_t, std::size_t); template MAPNIK_DECL T get_pixel (image_gray32s const& data, std::size_t x, std::size_t y) @@ -1895,7 +1895,7 @@ template MAPNIK_DECL int16_t get_pixel(image_gray32s const&, std::size_t, std::s template MAPNIK_DECL uint8_t get_pixel(image_gray32s const&, std::size_t, std::size_t); template MAPNIK_DECL int8_t get_pixel(image_gray32s const&, std::size_t, std::size_t); template MAPNIK_DECL float get_pixel(image_gray32s const&, std::size_t, std::size_t); -template MAPNIK_DECL double get_pixel(image_gray32s const&, std::size_t, std::size_t); +template MAPNIK_DECL double get_pixel(image_gray32s const&, std::size_t, std::size_t); template MAPNIK_DECL T get_pixel (image_gray32f const& data, std::size_t x, std::size_t y) @@ -1914,7 +1914,7 @@ template MAPNIK_DECL int16_t get_pixel(image_gray32f const&, std::size_t, std::s template MAPNIK_DECL uint8_t get_pixel(image_gray32f const&, std::size_t, std::size_t); template MAPNIK_DECL int8_t get_pixel(image_gray32f const&, std::size_t, std::size_t); template MAPNIK_DECL float get_pixel(image_gray32f const&, std::size_t, std::size_t); -template MAPNIK_DECL double get_pixel(image_gray32f const&, std::size_t, std::size_t); +template MAPNIK_DECL double get_pixel(image_gray32f const&, std::size_t, std::size_t); template MAPNIK_DECL T get_pixel (image_gray64 const& data, std::size_t x, std::size_t y) @@ -1933,7 +1933,7 @@ template MAPNIK_DECL int16_t get_pixel(image_gray64 const&, std::size_t, std::si template MAPNIK_DECL uint8_t get_pixel(image_gray64 const&, std::size_t, std::size_t); template MAPNIK_DECL int8_t get_pixel(image_gray64 const&, std::size_t, std::size_t); template MAPNIK_DECL float get_pixel(image_gray64 const&, std::size_t, std::size_t); -template MAPNIK_DECL double get_pixel(image_gray64 const&, std::size_t, std::size_t); +template MAPNIK_DECL double get_pixel(image_gray64 const&, std::size_t, std::size_t); template MAPNIK_DECL T get_pixel (image_gray64s const& data, std::size_t x, std::size_t y) @@ -1952,7 +1952,7 @@ template MAPNIK_DECL int16_t get_pixel(image_gray64s const&, std::size_t, std::s template MAPNIK_DECL uint8_t get_pixel(image_gray64s const&, std::size_t, std::size_t); template MAPNIK_DECL int8_t get_pixel(image_gray64s const&, std::size_t, std::size_t); template MAPNIK_DECL float get_pixel(image_gray64s const&, std::size_t, std::size_t); -template MAPNIK_DECL double get_pixel(image_gray64s const&, std::size_t, std::size_t); +template MAPNIK_DECL double get_pixel(image_gray64s const&, std::size_t, std::size_t); template MAPNIK_DECL T get_pixel (image_gray64f const& data, std::size_t x, std::size_t y) @@ -1971,7 +1971,7 @@ template MAPNIK_DECL int16_t get_pixel(image_gray64f const&, std::size_t, std::s template MAPNIK_DECL uint8_t get_pixel(image_gray64f const&, std::size_t, std::size_t); template MAPNIK_DECL int8_t get_pixel(image_gray64f const&, std::size_t, std::size_t); template MAPNIK_DECL float get_pixel(image_gray64f const&, std::size_t, std::size_t); -template MAPNIK_DECL double get_pixel(image_gray64f const&, std::size_t, std::size_t); +template MAPNIK_DECL double get_pixel(image_gray64f const&, std::size_t, std::size_t); template MAPNIK_DECL T get_pixel (image_view_rgba8 const& data, std::size_t x, std::size_t y) @@ -1990,7 +1990,7 @@ template MAPNIK_DECL int16_t get_pixel(image_view_rgba8 const&, std::size_t, std template MAPNIK_DECL uint8_t get_pixel(image_view_rgba8 const&, std::size_t, std::size_t); template MAPNIK_DECL int8_t get_pixel(image_view_rgba8 const&, std::size_t, std::size_t); template MAPNIK_DECL float get_pixel(image_view_rgba8 const&, std::size_t, std::size_t); -template MAPNIK_DECL double get_pixel(image_view_rgba8 const&, std::size_t, std::size_t); +template MAPNIK_DECL double get_pixel(image_view_rgba8 const&, std::size_t, std::size_t); template MAPNIK_DECL T get_pixel (image_view_gray8 const& data, std::size_t x, std::size_t y) @@ -2009,7 +2009,7 @@ template MAPNIK_DECL int16_t get_pixel(image_view_gray8 const&, std::size_t, std template MAPNIK_DECL uint8_t get_pixel(image_view_gray8 const&, std::size_t, std::size_t); template MAPNIK_DECL int8_t get_pixel(image_view_gray8 const&, std::size_t, std::size_t); template MAPNIK_DECL float get_pixel(image_view_gray8 const&, std::size_t, std::size_t); -template MAPNIK_DECL double get_pixel(image_view_gray8 const&, std::size_t, std::size_t); +template MAPNIK_DECL double get_pixel(image_view_gray8 const&, std::size_t, std::size_t); template MAPNIK_DECL T get_pixel (image_view_gray8s const& data, std::size_t x, std::size_t y) @@ -2028,7 +2028,7 @@ template MAPNIK_DECL int16_t get_pixel(image_view_gray8s const&, std::size_t, st template MAPNIK_DECL uint8_t get_pixel(image_view_gray8s const&, std::size_t, std::size_t); template MAPNIK_DECL int8_t get_pixel(image_view_gray8s const&, std::size_t, std::size_t); template MAPNIK_DECL float get_pixel(image_view_gray8s const&, std::size_t, std::size_t); -template MAPNIK_DECL double get_pixel(image_view_gray8s const&, std::size_t, std::size_t); +template MAPNIK_DECL double get_pixel(image_view_gray8s const&, std::size_t, std::size_t); template MAPNIK_DECL T get_pixel (image_view_gray16 const& data, std::size_t x, std::size_t y) @@ -2047,7 +2047,7 @@ template MAPNIK_DECL int16_t get_pixel(image_view_gray16 const&, std::size_t, st template MAPNIK_DECL uint8_t get_pixel(image_view_gray16 const&, std::size_t, std::size_t); template MAPNIK_DECL int8_t get_pixel(image_view_gray16 const&, std::size_t, std::size_t); template MAPNIK_DECL float get_pixel(image_view_gray16 const&, std::size_t, std::size_t); -template MAPNIK_DECL double get_pixel(image_view_gray16 const&, std::size_t, std::size_t); +template MAPNIK_DECL double get_pixel(image_view_gray16 const&, std::size_t, std::size_t); template MAPNIK_DECL T get_pixel (image_view_gray16s const& data, std::size_t x, std::size_t y) @@ -2066,7 +2066,7 @@ template MAPNIK_DECL int16_t get_pixel(image_view_gray16s const&, std::size_t, s template MAPNIK_DECL uint8_t get_pixel(image_view_gray16s const&, std::size_t, std::size_t); template MAPNIK_DECL int8_t get_pixel(image_view_gray16s const&, std::size_t, std::size_t); template MAPNIK_DECL float get_pixel(image_view_gray16s const&, std::size_t, std::size_t); -template MAPNIK_DECL double get_pixel(image_view_gray16s const&, std::size_t, std::size_t); +template MAPNIK_DECL double get_pixel(image_view_gray16s const&, std::size_t, std::size_t); template MAPNIK_DECL T get_pixel (image_view_gray32 const& data, std::size_t x, std::size_t y) @@ -2085,7 +2085,7 @@ template MAPNIK_DECL int16_t get_pixel(image_view_gray32 const&, std::size_t, st template MAPNIK_DECL uint8_t get_pixel(image_view_gray32 const&, std::size_t, std::size_t); template MAPNIK_DECL int8_t get_pixel(image_view_gray32 const&, std::size_t, std::size_t); template MAPNIK_DECL float get_pixel(image_view_gray32 const&, std::size_t, std::size_t); -template MAPNIK_DECL double get_pixel(image_view_gray32 const&, std::size_t, std::size_t); +template MAPNIK_DECL double get_pixel(image_view_gray32 const&, std::size_t, std::size_t); template MAPNIK_DECL T get_pixel (image_view_gray32s const& data, std::size_t x, std::size_t y) @@ -2104,7 +2104,7 @@ template MAPNIK_DECL int16_t get_pixel(image_view_gray32s const&, std::size_t, s template MAPNIK_DECL uint8_t get_pixel(image_view_gray32s const&, std::size_t, std::size_t); template MAPNIK_DECL int8_t get_pixel(image_view_gray32s const&, std::size_t, std::size_t); template MAPNIK_DECL float get_pixel(image_view_gray32s const&, std::size_t, std::size_t); -template MAPNIK_DECL double get_pixel(image_view_gray32s const&, std::size_t, std::size_t); +template MAPNIK_DECL double get_pixel(image_view_gray32s const&, std::size_t, std::size_t); template MAPNIK_DECL T get_pixel (image_view_gray32f const& data, std::size_t x, std::size_t y) @@ -2123,7 +2123,7 @@ template MAPNIK_DECL int16_t get_pixel(image_view_gray32f const&, std::size_t, s template MAPNIK_DECL uint8_t get_pixel(image_view_gray32f const&, std::size_t, std::size_t); template MAPNIK_DECL int8_t get_pixel(image_view_gray32f const&, std::size_t, std::size_t); template MAPNIK_DECL float get_pixel(image_view_gray32f const&, std::size_t, std::size_t); -template MAPNIK_DECL double get_pixel(image_view_gray32f const&, std::size_t, std::size_t); +template MAPNIK_DECL double get_pixel(image_view_gray32f const&, std::size_t, std::size_t); template MAPNIK_DECL T get_pixel (image_view_gray64 const& data, std::size_t x, std::size_t y) @@ -2142,7 +2142,7 @@ template MAPNIK_DECL int16_t get_pixel(image_view_gray64 const&, std::size_t, st template MAPNIK_DECL uint8_t get_pixel(image_view_gray64 const&, std::size_t, std::size_t); template MAPNIK_DECL int8_t get_pixel(image_view_gray64 const&, std::size_t, std::size_t); template MAPNIK_DECL float get_pixel(image_view_gray64 const&, std::size_t, std::size_t); -template MAPNIK_DECL double get_pixel(image_view_gray64 const&, std::size_t, std::size_t); +template MAPNIK_DECL double get_pixel(image_view_gray64 const&, std::size_t, std::size_t); template MAPNIK_DECL T get_pixel (image_view_gray64s const& data, std::size_t x, std::size_t y) @@ -2161,7 +2161,7 @@ template MAPNIK_DECL int16_t get_pixel(image_view_gray64s const&, std::size_t, s template MAPNIK_DECL uint8_t get_pixel(image_view_gray64s const&, std::size_t, std::size_t); template MAPNIK_DECL int8_t get_pixel(image_view_gray64s const&, std::size_t, std::size_t); template MAPNIK_DECL float get_pixel(image_view_gray64s const&, std::size_t, std::size_t); -template MAPNIK_DECL double get_pixel(image_view_gray64s const&, std::size_t, std::size_t); +template MAPNIK_DECL double get_pixel(image_view_gray64s const&, std::size_t, std::size_t); template MAPNIK_DECL T get_pixel (image_view_gray64f const& data, std::size_t x, std::size_t y) @@ -2180,9 +2180,9 @@ template MAPNIK_DECL int16_t get_pixel(image_view_gray64f const&, std::size_t, s template MAPNIK_DECL uint8_t get_pixel(image_view_gray64f const&, std::size_t, std::size_t); template MAPNIK_DECL int8_t get_pixel(image_view_gray64f const&, std::size_t, std::size_t); template MAPNIK_DECL float get_pixel(image_view_gray64f const&, std::size_t, std::size_t); -template MAPNIK_DECL double get_pixel(image_view_gray64f const&, std::size_t, std::size_t); +template MAPNIK_DECL double get_pixel(image_view_gray64f const&, std::size_t, std::size_t); -namespace detail +namespace detail { struct visitor_view_to_string @@ -2196,7 +2196,7 @@ struct visitor_view_to_string for (std::size_t i=0;i(view.getRow(i)), - view.getRowSize()); + view.row_size()); } } @@ -2204,7 +2204,7 @@ struct visitor_view_to_string std::ostringstream & ss_; }; -} // end detail ns +} // end detail ns MAPNIK_DECL void view_to_string (image_view_any const& view, std::ostringstream & ss) @@ -2270,16 +2270,16 @@ MAPNIK_DECL unsigned compare(T const& im1, T const& im2, double threshold, bool) return difference; } -template MAPNIK_DECL unsigned compare(image_gray8 const&, image_gray8 const&, double, bool); -template MAPNIK_DECL unsigned compare(image_gray8s const&, image_gray8s const&, double, bool); -template MAPNIK_DECL unsigned compare(image_gray16 const&, image_gray16 const&, double, bool); -template MAPNIK_DECL unsigned compare(image_gray16s const&, image_gray16s const&, double, bool); -template MAPNIK_DECL unsigned compare(image_gray32 const&, image_gray32 const&, double, bool); -template MAPNIK_DECL unsigned compare(image_gray32s const&, image_gray32s const&, double, bool); -template MAPNIK_DECL unsigned compare(image_gray32f const&, image_gray32f const&, double, bool); -template MAPNIK_DECL unsigned compare(image_gray64 const&, image_gray64 const&, double, bool); -template MAPNIK_DECL unsigned compare(image_gray64s const&, image_gray64s const&, double, bool); -template MAPNIK_DECL unsigned compare(image_gray64f const&, image_gray64f const&, double, bool); +template MAPNIK_DECL unsigned compare(image_gray8 const&, image_gray8 const&, double, bool); +template MAPNIK_DECL unsigned compare(image_gray8s const&, image_gray8s const&, double, bool); +template MAPNIK_DECL unsigned compare(image_gray16 const&, image_gray16 const&, double, bool); +template MAPNIK_DECL unsigned compare(image_gray16s const&, image_gray16s const&, double, bool); +template MAPNIK_DECL unsigned compare(image_gray32 const&, image_gray32 const&, double, bool); +template MAPNIK_DECL unsigned compare(image_gray32s const&, image_gray32s const&, double, bool); +template MAPNIK_DECL unsigned compare(image_gray32f const&, image_gray32f const&, double, bool); +template MAPNIK_DECL unsigned compare(image_gray64 const&, image_gray64 const&, double, bool); +template MAPNIK_DECL unsigned compare(image_gray64s const&, image_gray64s const&, double, bool); +template MAPNIK_DECL unsigned compare(image_gray64f const&, image_gray64f const&, double, bool); template <> MAPNIK_DECL unsigned compare(image_null const&, image_null const&, double, bool) diff --git a/src/image_view_any.cpp b/src/image_view_any.cpp index afe5a4b90..8bf89b45b 100644 --- a/src/image_view_any.cpp +++ b/src/image_view_any.cpp @@ -49,7 +49,7 @@ struct get_view_size_visitor template unsigned operator()(T const& data) const { - return data.getSize(); + return data.size(); } }; @@ -67,7 +67,7 @@ struct get_view_row_size_visitor template unsigned operator()(T const& data) const { - return data.getRowSize(); + return data.row_size(); } }; @@ -110,33 +110,33 @@ std::size_t image_view_any::height() const return util::apply_visitor(detail::get_view_height_visitor(),*this); } -unsigned image_view_any::getSize() const +std::size_t image_view_any::size() const { return util::apply_visitor(detail::get_view_size_visitor(),*this); } -unsigned image_view_any::getRowSize() const +std::size_t image_view_any::row_size() const { return util::apply_visitor(detail::get_view_row_size_visitor(),*this); } bool image_view_any::get_premultiplied() const -{ +{ return util::apply_visitor(detail::get_view_premultiplied_visitor(),*this); } double image_view_any::get_offset() const -{ +{ return util::apply_visitor(detail::get_view_offset_visitor(),*this); } double image_view_any::get_scaling() const -{ +{ return util::apply_visitor(detail::get_view_scaling_visitor(),*this); } image_dtype image_view_any::get_dtype() const -{ +{ return util::apply_visitor(detail::get_view_dtype_visitor(),*this); } diff --git a/src/renderer_common/render_pattern.cpp b/src/renderer_common/render_pattern.cpp index fc9a047a0..36065d172 100644 --- a/src/renderer_common/render_pattern.cpp +++ b/src/renderer_common/render_pattern.cpp @@ -55,7 +55,7 @@ void render_pattern(rasterizer & ras, mtx.translate(0.5 * bbox.width(), 0.5 * bbox.height()); mtx = tr * mtx; - agg::rendering_buffer buf(image.getBytes(), image.width(), image.height(), image.getRowSize()); + agg::rendering_buffer buf(image.getBytes(), image.width(), image.height(), image.row_size()); pixfmt pixf(buf); renderer_base renb(pixf); diff --git a/utils/svg2png/svg2png.cpp b/utils/svg2png/svg2png.cpp index c81392710..a7095952e 100644 --- a/utils/svg2png/svg2png.cpp +++ b/utils/svg2png/svg2png.cpp @@ -66,7 +66,7 @@ struct main_marker_visitor std::clog << "svg2png error: '" << svg_name_ << "' is not a valid vector!\n"; return_value_ = -1; } - + void operator() (mapnik::marker_rgba8 const&) { std::clog << "svg2png error: '" << svg_name_ << "' is not a valid vector!\n"; @@ -90,7 +90,7 @@ struct main_marker_visitor } // 10 pixel buffer to avoid edge clipping of 100% svg's mapnik::image_rgba8 im(w+0,h+0); - agg::rendering_buffer buf(im.getBytes(), im.width(), im.height(), im.getRowSize()); + agg::rendering_buffer buf(im.getBytes(), im.width(), im.height(), im.row_size()); pixfmt pixf(buf); renderer_base renb(pixf);