diff --git a/benchmark/compare_images.hpp b/benchmark/compare_images.hpp index 80dd7e929..2f1f124c4 100644 --- a/benchmark/compare_images.hpp +++ b/benchmark/compare_images.hpp @@ -2,7 +2,7 @@ #define __MAPNIK_COMPARE_IMAGES_HPP__ #include -#include +#include #include #include diff --git a/bindings/python/mapnik_image_view.cpp b/bindings/python/mapnik_image_view.cpp index bac81b918..1c48bd33b 100644 --- a/bindings/python/mapnik_image_view.cpp +++ b/bindings/python/mapnik_image_view.cpp @@ -35,7 +35,7 @@ #pragma GCC diagnostic pop // mapnik -#include +#include #include #include #include diff --git a/include/mapnik/agg_pattern_source.hpp b/include/mapnik/agg_pattern_source.hpp index 534d3f671..1c5673950 100644 --- a/include/mapnik/agg_pattern_source.hpp +++ b/include/mapnik/agg_pattern_source.hpp @@ -24,7 +24,7 @@ #define MAPNIK_AGG_PATTERN_SOURCE_HPP // mapnik -#include +#include #include // agg diff --git a/include/mapnik/agg_renderer.hpp b/include/mapnik/agg_renderer.hpp index 392aa95b7..9052b7600 100644 --- a/include/mapnik/agg_renderer.hpp +++ b/include/mapnik/agg_renderer.hpp @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include // stl #include diff --git a/include/mapnik/cairo/cairo_context.hpp b/include/mapnik/cairo/cairo_context.hpp index 44d16db17..a5826bdc9 100644 --- a/include/mapnik/cairo/cairo_context.hpp +++ b/include/mapnik/cairo/cairo_context.hpp @@ -27,7 +27,7 @@ // mapnik #include #include -#include +#include #include #include #include diff --git a/include/mapnik/cairo/cairo_image_util.hpp b/include/mapnik/cairo/cairo_image_util.hpp index 2a520bfc2..f4a5a3dcd 100644 --- a/include/mapnik/cairo/cairo_image_util.hpp +++ b/include/mapnik/cairo/cairo_image_util.hpp @@ -25,7 +25,7 @@ #define MAPNIK_CAIRO_IMAGE_UTIL_HPP // mapnik -#include +#include #include // for cairo_surface_ptr // stl diff --git a/include/mapnik/grid/grid.hpp b/include/mapnik/grid/grid.hpp index e1ce21899..2aa423854 100644 --- a/include/mapnik/grid/grid.hpp +++ b/include/mapnik/grid/grid.hpp @@ -25,7 +25,7 @@ // mapnik #include -#include +#include #include #include #include @@ -50,7 +50,7 @@ class MAPNIK_DECL hit_grid { public: using value_type = T; - using data_type = mapnik::image_data; + using data_type = mapnik::image; using lookup_type = std::string; // mapping between pixel id and key using feature_key_type = std::map; diff --git a/include/mapnik/grid/grid_view.hpp b/include/mapnik/grid/grid_view.hpp index e43633e97..2db982e5c 100644 --- a/include/mapnik/grid/grid_view.hpp +++ b/include/mapnik/grid/grid_view.hpp @@ -23,7 +23,7 @@ #ifndef MAPNIK_GRID_VIEW_HPP #define MAPNIK_GRID_VIEW_HPP -#include +#include #include #include #include @@ -196,7 +196,7 @@ private: feature_type const& features_; }; -using grid_view = hit_grid_view >; +using grid_view = hit_grid_view >; } diff --git a/include/mapnik/image_data.hpp b/include/mapnik/image.hpp similarity index 93% rename from include/mapnik/image_data.hpp rename to include/mapnik/image.hpp index d36d8f9bd..fe2b2e8c0 100644 --- a/include/mapnik/image_data.hpp +++ b/include/mapnik/image.hpp @@ -116,13 +116,13 @@ struct image_dimensions } template -class image_data +class image { public: using pixel_type = T; static constexpr std::size_t pixel_size = sizeof(pixel_type); - image_data(int width, int height, bool initialize = true, bool premultiplied = false, bool painted = false) + image(int width, int height, bool initialize = true, bool premultiplied = false, bool painted = false) : dimensions_(width, height), buffer_(dimensions_.width() * dimensions_.height() * pixel_size), pData_(reinterpret_cast(buffer_.data())), @@ -132,7 +132,7 @@ public: if (pData_ && initialize) std::fill(pData_, pData_ + dimensions_.width() * dimensions_.height(), 0); } - image_data(image_data const& rhs) + image(image const& rhs) : dimensions_(rhs.dimensions_), buffer_(rhs.buffer_), pData_(reinterpret_cast(buffer_.data())), @@ -140,7 +140,7 @@ public: painted_(rhs.painted_) {} - image_data(image_data && rhs) noexcept + image(image && rhs) noexcept : dimensions_(std::move(rhs.dimensions_)), buffer_(std::move(rhs.buffer_)), pData_(reinterpret_cast(buffer_.data())), @@ -151,13 +151,13 @@ public: rhs.pData_ = nullptr; } - image_data& operator=(image_data rhs) + image& operator=(image rhs) { swap(rhs); return *this; } - void swap(image_data & rhs) + void swap(image & rhs) { std::swap(dimensions_, rhs.dimensions_); std::swap(buffer_, rhs.buffer_); @@ -277,10 +277,10 @@ private: bool painted_; }; -using image_rgba8 = image_data; -using image_gray8 = image_data ; -using image_gray16 = image_data; -using image_gray32f = image_data; +using image_rgba8 = image; +using image_gray8 = image ; +using image_gray16 = image; +using image_gray32f = image; enum image_dtype : std::uint8_t { diff --git a/include/mapnik/image_any.hpp b/include/mapnik/image_any.hpp index 92f17d98e..fc764f6ed 100644 --- a/include/mapnik/image_any.hpp +++ b/include/mapnik/image_any.hpp @@ -23,7 +23,7 @@ #ifndef MAPNIK_IMAGE_DATA_ANY_HPP #define MAPNIK_IMAGE_DATA_ANY_HPP -#include +#include #include namespace mapnik { @@ -40,18 +40,18 @@ struct image_null bool painted() const { return false; } bool get_premultiplied() const { return false; } void set_premultiplied(bool) const {} - void set(pixel_type const&) { throw std::runtime_error("Can not set values for null image_data"); } + void set(pixel_type const&) { throw std::runtime_error("Can not set values for null image"); } pixel_type& operator() (std::size_t, std::size_t) { - throw std::runtime_error("Can not set or get values for null image_data"); + throw std::runtime_error("Can not set or get values for null image"); } pixel_type const& operator() (std::size_t, std::size_t) const { - throw std::runtime_error("Can not set or get values for null image_data"); + throw std::runtime_error("Can not set or get values for null image"); } }; -using image_data_base = util::variant image_any(T && data) noexcept - : image_data_base(std::move(data)) {} + : image_base(std::move(data)) {} unsigned char const* getBytes() const { diff --git a/include/mapnik/image_compositing.hpp b/include/mapnik/image_compositing.hpp index b41d14b2b..c3fce8be7 100644 --- a/include/mapnik/image_compositing.hpp +++ b/include/mapnik/image_compositing.hpp @@ -24,7 +24,7 @@ #define MAPNIK_IMAGE_COMPOSITING_HPP #include -#include +#include // boost #include diff --git a/include/mapnik/image_scaling.hpp b/include/mapnik/image_scaling.hpp index c8c916fa6..0dd94c9a6 100644 --- a/include/mapnik/image_scaling.hpp +++ b/include/mapnik/image_scaling.hpp @@ -25,7 +25,7 @@ // mapnik #include -#include +#include // stl #include diff --git a/include/mapnik/image_util.hpp b/include/mapnik/image_util.hpp index 25c36afd1..58f976e26 100644 --- a/include/mapnik/image_util.hpp +++ b/include/mapnik/image_util.hpp @@ -25,7 +25,7 @@ // mapnik #include -#include +#include #include #include #include diff --git a/include/mapnik/marker.hpp b/include/mapnik/marker.hpp index f74ac2481..ea03e9607 100644 --- a/include/mapnik/marker.hpp +++ b/include/mapnik/marker.hpp @@ -24,7 +24,7 @@ #define MAPNIK_MARKER_HPP // mapnik -#include +#include #include #include #include diff --git a/include/mapnik/miniz_png.hpp b/include/mapnik/miniz_png.hpp index 9d36f3bbc..0414c329c 100644 --- a/include/mapnik/miniz_png.hpp +++ b/include/mapnik/miniz_png.hpp @@ -32,7 +32,7 @@ #include #include -#include +#include #include /* miniz.c porting issues: diff --git a/include/mapnik/png_io.hpp b/include/mapnik/png_io.hpp index 0aa3afc01..8eced2442 100644 --- a/include/mapnik/png_io.hpp +++ b/include/mapnik/png_io.hpp @@ -28,7 +28,7 @@ #include #include #include -#include +#include // zlib #include // for Z_DEFAULT_COMPRESSION diff --git a/include/mapnik/raster_colorizer.hpp b/include/mapnik/raster_colorizer.hpp index f565597c7..63e2d0727 100644 --- a/include/mapnik/raster_colorizer.hpp +++ b/include/mapnik/raster_colorizer.hpp @@ -40,7 +40,7 @@ #include #include #include -#include +#include // boost #include // boost diff --git a/include/mapnik/renderer_common/process_raster_symbolizer.hpp b/include/mapnik/renderer_common/process_raster_symbolizer.hpp index 53b6b7362..3ef8b19cb 100644 --- a/include/mapnik/renderer_common/process_raster_symbolizer.hpp +++ b/include/mapnik/renderer_common/process_raster_symbolizer.hpp @@ -45,10 +45,10 @@ namespace mapnik { namespace detail { template -struct image_data_dispatcher +struct image_dispatcher { using composite_function = F; - image_data_dispatcher(int start_x, int start_y, + image_dispatcher(int start_x, int start_y, int width, int height, double scale_x, double scale_y, scaling_method_e method, double filter_factor, @@ -80,8 +80,8 @@ struct image_data_dispatcher template void operator() (T const& data_in) const { - using image_data_type = T; - image_data_type data_out(width_, height_); + using image_type = T; + image_type data_out(width_, height_); scale_image_agg(data_out, data_in, method_, scale_x_, scale_y_, 0.0, 0.0, filter_factor_); image_rgba8 dst(width_, height_); raster_colorizer_ptr colorizer = get(sym_, keys::colorizer); @@ -107,10 +107,10 @@ private: }; template -struct image_data_warp_dispatcher +struct image_warp_dispatcher { using composite_function = F; - image_data_warp_dispatcher(proj_transform const& prj_trans, + image_warp_dispatcher(proj_transform const& prj_trans, int start_x, int start_y, int width, int height, box2d const& target_ext, box2d const& source_ext, double offset_x, double offset_y, unsigned mesh_size, scaling_method_e scaling_method, @@ -147,8 +147,8 @@ struct image_data_warp_dispatcher template void operator() (T const& data_in) const { - using image_data_type = T; - image_data_type data_out(width_, height_); + using image_type = T; + image_type data_out(width_, height_); if (nodata_) data_out.set(*nodata_); warp_image(data_out, data_in, prj_trans_, target_ext_, source_ext_, offset_x_, offset_y_, mesh_size_, scaling_method_, filter_factor_); image_rgba8 dst(width_, height_); @@ -220,7 +220,7 @@ void render_raster_symbolizer(raster_symbolizer const& sym, double offset_x = ext.minx() - start_x; double offset_y = ext.miny() - start_y; unsigned mesh_size = static_cast(get(sym,keys::mesh_size,feature, common.vars_, 16)); - detail::image_data_warp_dispatcher dispatcher(prj_trans, start_x, start_y, raster_width, raster_height, + detail::image_warp_dispatcher dispatcher(prj_trans, start_x, start_y, raster_width, raster_height, target_ext, source->ext_, offset_x, offset_y, mesh_size, scaling_method, source->get_filter_factor(), opacity, comp_op, sym, feature, composite, source->nodata()); @@ -243,7 +243,7 @@ void render_raster_symbolizer(raster_symbolizer const& sym, } else { - detail::image_data_dispatcher dispatcher(start_x, start_y, raster_width, raster_height, + detail::image_dispatcher dispatcher(start_x, start_y, raster_width, raster_height, image_ratio_x, image_ratio_y, scaling_method, source->get_filter_factor(), opacity, comp_op, sym, feature, composite, source->nodata()); diff --git a/include/mapnik/renderer_common/render_pattern.hpp b/include/mapnik/renderer_common/render_pattern.hpp index 6173bfd58..4cbf211c5 100644 --- a/include/mapnik/renderer_common/render_pattern.hpp +++ b/include/mapnik/renderer_common/render_pattern.hpp @@ -23,7 +23,7 @@ #ifndef MAPNIK_RENDER_PATTERN_HPP #define MAPNIK_RENDER_PATTERN_HPP -#include +#include #include // fwd decl diff --git a/include/mapnik/tiff_io.hpp b/include/mapnik/tiff_io.hpp index 5b94cc813..dd8377f4f 100644 --- a/include/mapnik/tiff_io.hpp +++ b/include/mapnik/tiff_io.hpp @@ -387,7 +387,7 @@ void save_as_tiff(T1 & file, T2 const& image, tiff_config & config) TIFFSetField(output, TIFFTAG_TILELENGTH, tile_height); TIFFSetField(output, TIFFTAG_TILEDEPTH, 1); std::size_t tile_size = tile_width * tile_height; - std::unique_ptr image_data_out (new pixel_type[tile_size]); + std::unique_ptr image_out (new pixel_type[tile_size]); int end_y = (height / tile_height + 1) * tile_height; int end_x = (width / tile_width + 1) * tile_width; end_y = std::min(end_y, height); @@ -400,14 +400,14 @@ void save_as_tiff(T1 & file, T2 const& image, tiff_config & config) for (int x = 0; x < end_x; x += tile_width) { // Prefill the entire array with zeros. - std::fill(image_data_out.get(), image_data_out.get() + tile_size, 0); + std::fill(image_out.get(), image_out.get() + tile_size, 0); int tx1 = std::min(width, x + tile_width); int row = y; for (int ty = 0; ty < ty1; ++ty, ++row) { - std::copy(image.getRow(row, x), image.getRow(row, tx1), image_data_out.get() + ty * tile_width); + std::copy(image.getRow(row, x), image.getRow(row, tx1), image_out.get() + ty * tile_width); } - if (TIFFWriteEncodedTile(output, TIFFComputeTile(output, x, y, 0, 0), image_data_out.get(), tile_size * sizeof(pixel_type)) == -1) + if (TIFFWriteEncodedTile(output, TIFFComputeTile(output, x, y, 0, 0), image_out.get(), tile_size * sizeof(pixel_type)) == -1) { throw ImageWriterException("Could not write TIFF - TIFF Tile Write failed"); } diff --git a/include/mapnik/webp_io.hpp b/include/mapnik/webp_io.hpp index 2ec6c52c8..a65792f55 100644 --- a/include/mapnik/webp_io.hpp +++ b/include/mapnik/webp_io.hpp @@ -24,7 +24,7 @@ #define MAPNIK_WEBP_IO_HPP // mapnik -#include +#include #include // webp @@ -73,14 +73,14 @@ std::string webp_encoding_error(WebPEncodingError error) } template -inline int import_image_data(T2 const& image, +inline int import_image(T2 const& im_in, WebPPicture & pic, bool alpha) { - image_data const& data = image.data(); - int stride = sizeof(typename T2::pixel_type) * image.width(); - if (data.width() == image.width() && - data.height() == image.height()) + image const& data = im_in.data(); + int stride = sizeof(typename T2::pixel_type) * im_in.width(); + if (data.width() == im_in.width() && + data.height() == im_in.height()) { if (alpha) { @@ -98,10 +98,10 @@ inline int import_image_data(T2 const& image, else { // need to copy: https://github.com/mapnik/mapnik/issues/2024 - image_rgba8 im(image.width(),image.height()); - for (unsigned y = 0; y < image.height(); ++y) + image_rgba8 im(im_in.width(),im_in.height()); + for (unsigned y = 0; y < im_in.height(); ++y) { - typename T2::pixel_type const * row_from = image.getRow(y); + typename T2::pixel_type const * row_from = im_in.getRow(y); image_rgba8::pixel_type * row_to = im.getRow(y); std::copy(row_from, row_from + stride, row_to); } @@ -121,7 +121,7 @@ inline int import_image_data(T2 const& image, } template <> -inline int import_image_data(image_rgba8 const& im, +inline int import_image(image_rgba8 const& im, WebPPicture & pic, bool alpha) { @@ -187,10 +187,10 @@ void save_as_webp(T1& file, { // different approach for lossy since ImportYUVAFromRGBA is needed // to prepare WebPPicture and working with view pixels is not viable - ok = import_image_data(image,pic,alpha); + ok = import_image(image,pic,alpha); } #else - ok = import_image_data(image,pic,alpha); + ok = import_image(image,pic,alpha); #endif if (!ok) { diff --git a/plugins/input/gdal/gdal_featureset.cpp b/plugins/input/gdal/gdal_featureset.cpp index 3d889215c..55f8e0f65 100644 --- a/plugins/input/gdal/gdal_featureset.cpp +++ b/plugins/input/gdal/gdal_featureset.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/plugins/input/pgraster/pgraster_featureset.cpp b/plugins/input/pgraster/pgraster_featureset.cpp index 497652561..20900cfe5 100644 --- a/plugins/input/pgraster/pgraster_featureset.cpp +++ b/plugins/input/pgraster/pgraster_featureset.cpp @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include #include #include // for int2net diff --git a/plugins/input/pgraster/pgraster_wkb_reader.cpp b/plugins/input/pgraster/pgraster_wkb_reader.cpp index 11e19d2c4..076ead40b 100644 --- a/plugins/input/pgraster/pgraster_wkb_reader.cpp +++ b/plugins/input/pgraster/pgraster_wkb_reader.cpp @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include #include // for box2d @@ -279,7 +279,7 @@ mapnik::raster_ptr read_grayscale_band(mapnik::box2d const& bbox, int val; uint8_t * data = image.getBytes(); - int ps = 4; // sizeof(image_data::pixel_type) + int ps = 4; // sizeof(image::pixel_type) int off; val = reader(); // nodata value, need to read anyway for (int y=0; y con mapnik::raster_ptr pgraster_wkb_reader::read_rgba(mapnik::box2d const& bbox, uint16_t width, uint16_t height) { - mapnik::image_rgba8 image(width, height, true, true); + mapnik::image_rgba8 im(width, height, true, true); // Start with plain white (ABGR or RGBA depending on endiannes) - image.set(0xffffffff); + im.set(0xffffffff); uint8_t nodataval; for (int bn=0; bn const& b << " nodataval " << tmp << " != band 0 nodataval " << nodataval; } - int ps = 4; // sizeof(image_data::pixel_type) - uint8_t * image_data = image.getBytes(); + int ps = 4; // sizeof(image::pixel_type) + uint8_t * image_data = im.getBytes(); for (int y=0; y const& b } } } - mapnik::raster_ptr raster = std::make_shared(bbox, image, 1.0); + mapnik::raster_ptr raster = std::make_shared(bbox, im, 1.0); raster->set_nodata(0xffffffff); return raster; } diff --git a/plugins/input/raster/raster_featureset.cpp b/plugins/input/raster/raster_featureset.cpp index c6a1f630a..4bf95571e 100644 --- a/plugins/input/raster/raster_featureset.cpp +++ b/plugins/input/raster/raster_featureset.cpp @@ -22,7 +22,7 @@ // mapnik #include -#include +#include #include #include #include diff --git a/plugins/input/rasterlite/rasterlite_featureset.cpp b/plugins/input/rasterlite/rasterlite_featureset.cpp index 7171eabdf..a532a7d93 100644 --- a/plugins/input/rasterlite/rasterlite_featureset.cpp +++ b/plugins/input/rasterlite/rasterlite_featureset.cpp @@ -24,7 +24,7 @@ // mapnik #include -#include +#include #include #include #include @@ -116,8 +116,8 @@ feature_ptr rasterlite_featureset::get_feature(mapnik::query const& q) { mapnik::image_rgba8 image(width,height); unsigned char* raster_data = static_cast(raster); - unsigned char* image_data = image.getBytes(); - std::memcpy(image_data, raster_data, size); + unsigned char* image = image.getBytes(); + std::memcpy(image, raster_data, size); feature->set_raster(std::make_shared(intersect, std::move(image), 1.0)); MAPNIK_LOG_DEBUG(rasterlite) << "rasterlite_featureset: Done"; } diff --git a/src/agg/process_dot_symbolizer.cpp b/src/agg/process_dot_symbolizer.cpp index ad052a79e..7838a920b 100644 --- a/src/agg/process_dot_symbolizer.cpp +++ b/src/agg/process_dot_symbolizer.cpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/agg/process_group_symbolizer.cpp b/src/agg/process_group_symbolizer.cpp index bd7db6c05..f1ae6a30b 100644 --- a/src/agg/process_group_symbolizer.cpp +++ b/src/agg/process_group_symbolizer.cpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/agg/process_raster_symbolizer.cpp b/src/agg/process_raster_symbolizer.cpp index f51c3d0d1..7d5cd4b93 100644 --- a/src/agg/process_raster_symbolizer.cpp +++ b/src/agg/process_raster_symbolizer.cpp @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/image_compositing.cpp b/src/image_compositing.cpp index ea7a8a3d4..ea4908d71 100644 --- a/src/image_compositing.cpp +++ b/src/image_compositing.cpp @@ -22,7 +22,7 @@ // mapnik #include -#include +#include #include // boost @@ -129,8 +129,8 @@ namespace detail { template struct rendering_buffer { - using image_data_type = T; - using pixel_type = typename image_data_type::pixel_type; + using image_type = T; + using pixel_type = typename image_type::pixel_type; using row_data = agg::const_row_info; rendering_buffer(T const& data) @@ -143,7 +143,7 @@ struct rendering_buffer 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)); } - image_data_type const& data_; + image_type const& data_; }; } // end detail ns diff --git a/src/image_convert.cpp b/src/image_convert.cpp index 3a99383c9..40a9dbad9 100644 --- a/src/image_convert.cpp +++ b/src/image_convert.cpp @@ -22,7 +22,7 @@ // mapnik #include -#include +#include #include namespace mapnik diff --git a/src/image_scaling.cpp b/src/image_scaling.cpp index 24ea59ffc..76bf931d3 100644 --- a/src/image_scaling.cpp +++ b/src/image_scaling.cpp @@ -21,7 +21,7 @@ *****************************************************************************/ // mapnik -#include +#include #include #include // does not handle alpha correctly @@ -107,12 +107,12 @@ void scale_image_agg(T & target, T const& source, scaling_method_e scaling_metho // http://old.nabble.com/Re:--AGG--Basic-image-transformations-p1110665.html // "Yes, you need to use premultiplied images only. Only in this case the simple weighted averaging works correctly in the image fitering." // http://permalink.gmane.org/gmane.comp.graphics.agg/3443 - using image_data_type = T; - using pixel_type = typename image_data_type::pixel_type; - using pixfmt_pre = typename detail::agg_scaling_traits::pixfmt_pre; - using color_type = typename detail::agg_scaling_traits::color_type; - using img_src_type = typename detail::agg_scaling_traits::img_src_type; - using interpolator_type = typename detail::agg_scaling_traits::interpolator_type; + using image_type = T; + using pixel_type = typename image_type::pixel_type; + using pixfmt_pre = typename detail::agg_scaling_traits::pixfmt_pre; + using color_type = typename detail::agg_scaling_traits::color_type; + using img_src_type = typename detail::agg_scaling_traits::img_src_type; + using interpolator_type = typename detail::agg_scaling_traits::interpolator_type; using renderer_base_pre = agg::renderer_base; constexpr std::size_t pixel_size = sizeof(pixel_type); @@ -150,13 +150,13 @@ void scale_image_agg(T & target, T const& source, scaling_method_e scaling_metho if (scaling_method == SCALING_NEAR) { - using span_gen_type = typename detail::agg_scaling_traits::span_image_filter; + using span_gen_type = typename detail::agg_scaling_traits::span_image_filter; span_gen_type sg(img_src, interpolator); agg::render_scanlines_aa(ras, sl, rb_dst_pre, sa, sg); } else { - using span_gen_type = typename detail::agg_scaling_traits::span_image_resample_affine; + using span_gen_type = typename detail::agg_scaling_traits::span_image_resample_affine; agg::image_filter_lut filter; detail::set_scaling_method(filter, scaling_method, filter_factor); span_gen_type sg(img_src, interpolator, filter); diff --git a/src/image_util.cpp b/src/image_util.cpp index 56091771c..2b143f052 100644 --- a/src/image_util.cpp +++ b/src/image_util.cpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/image_util_jpeg.cpp b/src/image_util_jpeg.cpp index 693fe96c6..c689dd856 100644 --- a/src/image_util_jpeg.cpp +++ b/src/image_util_jpeg.cpp @@ -27,7 +27,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/image_util_png.cpp b/src/image_util_png.cpp index ed38c828d..691e7607f 100644 --- a/src/image_util_png.cpp +++ b/src/image_util_png.cpp @@ -34,7 +34,7 @@ extern "C" #include #include -#include +#include #include #include #include diff --git a/src/image_util_tiff.cpp b/src/image_util_tiff.cpp index 29ec07565..ffd4ecf64 100644 --- a/src/image_util_tiff.cpp +++ b/src/image_util_tiff.cpp @@ -27,7 +27,7 @@ #include #include -#include +#include #include #include diff --git a/src/image_util_webp.cpp b/src/image_util_webp.cpp index 34ec6ea72..aa9bb2d93 100644 --- a/src/image_util_webp.cpp +++ b/src/image_util_webp.cpp @@ -27,7 +27,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/miniz_png.cpp b/src/miniz_png.cpp index cae070435..3a32d50f3 100644 --- a/src/miniz_png.cpp +++ b/src/miniz_png.cpp @@ -23,7 +23,7 @@ // mapnik #include #include -#include +#include #include // miniz diff --git a/src/raster_colorizer.cpp b/src/raster_colorizer.cpp index 21f5a0b91..27682f3c3 100644 --- a/src/raster_colorizer.cpp +++ b/src/raster_colorizer.cpp @@ -127,8 +127,8 @@ void raster_colorizer::colorize(image_rgba8 & out, T const& in, boost::optional const& nodata, feature_impl const& f) const { - using image_data_type = T; - using pixel_type = typename image_data_type::pixel_type; + using image_type = T; + using pixel_type = typename image_type::pixel_type; // TODO: assuming in/out have the same width/height for now std::uint32_t * out_data = out.getData(); pixel_type const* in_data = in.getData(); diff --git a/src/tiff_reader.cpp b/src/tiff_reader.cpp index a3dade629..62c566aeb 100644 --- a/src/tiff_reader.cpp +++ b/src/tiff_reader.cpp @@ -397,12 +397,12 @@ template template image_any tiff_reader::read_any_gray(unsigned x0, unsigned y0, unsigned width, unsigned height) { - using image_data_type = ImageData; - using pixel_type = typename image_data_type::pixel_type; + using image_type = ImageData; + using pixel_type = typename image_type::pixel_type; if (read_method_ == tiled) { - image_data_type data(width,height); - read_tiled(x0, y0, data); + image_type data(width,height); + read_tiled(x0, y0, data); return image_any(std::move(data)); } else @@ -410,7 +410,7 @@ image_any tiff_reader::read_any_gray(unsigned x0, unsigned y0, unsigned width TIFF* tif = open(stream_); if (tif) { - image_data_type data(width, height); + image_type data(width, height); std::size_t block_size = rows_per_strip_ > 0 ? rows_per_strip_ : tile_height_ ; std::ptrdiff_t start_y = y0 - y0 % block_size; std::ptrdiff_t end_y = std::min(y0 + height, static_cast(height_)); @@ -454,8 +454,8 @@ struct rgb8_to_rgba8 template struct tiff_reader_traits { - using image_data_type = T; - using pixel_type = typename image_data_type::pixel_type; + using image_type = T; + using pixel_type = typename image_type::pixel_type; static bool read_tile(TIFF * tif, unsigned x, unsigned y, pixel_type* buf, std::size_t tile_width, std::size_t tile_height) { return (TIFFReadEncodedTile(tif, TIFFComputeTile(tif, x,y,0,0), buf, tile_width * tile_height * sizeof(pixel_type)) != -1); diff --git a/src/warp.cpp b/src/warp.cpp index 89390e6a2..85730303f 100644 --- a/src/warp.cpp +++ b/src/warp.cpp @@ -23,7 +23,7 @@ // mapnik #include #include -#include +#include #include #include #include @@ -53,12 +53,12 @@ MAPNIK_DECL void warp_image (T & target, T const& source, proj_transform const& box2d const& target_ext, box2d const& source_ext, double offset_x, double offset_y, unsigned mesh_size, scaling_method_e scaling_method, double filter_factor) { - using image_data_type = T; - using pixel_type = typename image_data_type::pixel_type; - using pixfmt_pre = typename detail::agg_scaling_traits::pixfmt_pre; - using color_type = typename detail::agg_scaling_traits::color_type; + using image_type = T; + using pixel_type = typename image_type::pixel_type; + using pixfmt_pre = typename detail::agg_scaling_traits::pixfmt_pre; + using color_type = typename detail::agg_scaling_traits::color_type; using renderer_base = agg::renderer_base; - using interpolator_type = typename detail::agg_scaling_traits::interpolator_type; + using interpolator_type = typename detail::agg_scaling_traits::interpolator_type; constexpr std::size_t pixel_size = sizeof(pixel_type); @@ -70,8 +70,8 @@ MAPNIK_DECL void warp_image (T & target, T const& source, proj_transform const& std::size_t mesh_nx = std::ceil(source.width()/double(mesh_size) + 1); std::size_t mesh_ny = std::ceil(source.height()/double(mesh_size) + 1); - image_data xs(mesh_nx, mesh_ny); - image_data ys(mesh_nx, mesh_ny); + image xs(mesh_nx, mesh_ny); + image ys(mesh_nx, mesh_ny); // Precalculate reprojected mesh for(std::size_t j = 0; j < mesh_ny; ++j) @@ -138,13 +138,13 @@ MAPNIK_DECL void warp_image (T & target, T const& source, proj_transform const& interpolator_type interpolator(tr); if (scaling_method == SCALING_NEAR) { - using span_gen_type = typename detail::agg_scaling_traits::span_image_filter; + using span_gen_type = typename detail::agg_scaling_traits::span_image_filter; span_gen_type sg(ia, interpolator); agg::render_scanlines_bin(rasterizer, scanline, rb, sa, sg); } else { - using span_gen_type = typename detail::agg_scaling_traits::span_image_resample_affine; + using span_gen_type = typename detail::agg_scaling_traits::span_image_resample_affine; agg::image_filter_lut filter; detail::set_scaling_method(filter, scaling_method, filter_factor); span_gen_type sg(ia, interpolator, filter); @@ -177,11 +177,11 @@ struct warp_image_visitor template void operator() (T const& source) { - using image_data_type = T; + using image_type = T; //source and target image data types must match - if (target_raster_.data_.template is()) + if (target_raster_.data_.template is()) { - image_data_type & target = util::get(target_raster_.data_); + image_type & target = util::get(target_raster_.data_); warp_image (target, source, prj_trans_, target_raster_.ext_, source_ext_, offset_x_, offset_y_, mesh_size_, scaling_method_, filter_factor_); } diff --git a/tests/cpp_tests/image_io_test.cpp b/tests/cpp_tests/image_io_test.cpp index 7cc037862..1ea4008cf 100644 --- a/tests/cpp_tests/image_io_test.cpp +++ b/tests/cpp_tests/image_io_test.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include #include #include #include diff --git a/tests/cpp_tests/map_request_test.cpp b/tests/cpp_tests/map_request_test.cpp index 194f2a9b7..45e9ec411 100644 --- a/tests/cpp_tests/map_request_test.cpp +++ b/tests/cpp_tests/map_request_test.cpp @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include #include