From 882125879fd7272a51542bc31a0605494c998584 Mon Sep 17 00:00:00 2001 From: Dirk Stolle Date: Sat, 3 Sep 2022 00:49:00 +0200 Subject: [PATCH] switch uses of nth_channel_view to boost::gil::index_t --- .../adaptive_histogram_equalization.hpp | 8 ++++---- include/boost/gil/image_processing/convolve.hpp | 2 +- include/boost/gil/image_processing/filter.hpp | 2 +- .../gil/image_processing/histogram_equalization.hpp | 12 ++++++------ .../gil/image_processing/histogram_matching.hpp | 4 ++-- include/boost/gil/image_processing/morphology.hpp | 4 ++-- include/boost/gil/image_processing/threshold.hpp | 2 +- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/include/boost/gil/image_processing/adaptive_histogram_equalization.hpp b/include/boost/gil/image_processing/adaptive_histogram_equalization.hpp index 1b5de48682..223e16c8b9 100644 --- a/include/boost/gil/image_processing/adaptive_histogram_equalization.hpp +++ b/include/boost/gil/image_processing/adaptive_histogram_equalization.hpp @@ -157,9 +157,9 @@ void non_overlapping_interpolated_clahe( using dst_channel_t = typename channel_type::type; using coord_t = typename SrcView::x_coord_t; - std::size_t const channels = num_channels::value; - coord_t const width = src_view.width(); - coord_t const height = src_view.height(); + index_t const channels = num_channels::value; + coord_t const width = src_view.width(); + coord_t const height = src_view.height(); // Find control points @@ -184,7 +184,7 @@ void non_overlapping_interpolated_clahe( copy_pixels(src_view, subimage_view(view(padded_img), top_left_x, top_left_y, width, height)); - for (std::size_t k = 0; k < channels; k++) + for (index_t k = 0; k < channels; k++) { std::vector> prev_row(new_width / tile_width_x), next_row((new_width / tile_width_x)); diff --git a/include/boost/gil/image_processing/convolve.hpp b/include/boost/gil/image_processing/convolve.hpp index a6369c89a6..c11ed26d44 100644 --- a/include/boost/gil/image_processing/convolve.hpp +++ b/include/boost/gil/image_processing/convolve.hpp @@ -430,7 +430,7 @@ void convolve_2d(SrcView const& src_view, Kernel const& kernel, DstView const& d typename color_space_type::type >::value, "Source and destination views must have pixels with the same color space"); - for (std::size_t i = 0; i < src_view.num_channels(); i++) + for (index_t i = 0; i < src_view.num_channels(); i++) { detail::convolve_2d_impl( nth_channel_view(src_view, i), diff --git a/include/boost/gil/image_processing/filter.hpp b/include/boost/gil/image_processing/filter.hpp index 1fc4902323..241ea9625e 100644 --- a/include/boost/gil/image_processing/filter.hpp +++ b/include/boost/gil/image_processing/filter.hpp @@ -124,7 +124,7 @@ void median_filter(SrcView const& src_view, DstView const& dst_view, std::size_t src_view.height() ); - for (std::size_t channel = 0; channel < extended_view.num_channels(); channel++) + for (index_t channel = 0; channel < extended_view.num_channels(); channel++) { detail::filter_median_impl( nth_channel_view(extended_view, channel), diff --git a/include/boost/gil/image_processing/histogram_equalization.hpp b/include/boost/gil/image_processing/histogram_equalization.hpp index 6ce3c5ef34..7a30759b55 100644 --- a/include/boost/gil/image_processing/histogram_equalization.hpp +++ b/include/boost/gil/image_processing/histogram_equalization.hpp @@ -117,13 +117,13 @@ void histogram_equalization( using dst_channel_t = typename channel_type::type; using coord_t = typename SrcView::x_coord_t; - std::size_t const channels = num_channels::value; - coord_t const width = src_view.width(); - coord_t const height = src_view.height(); - std::size_t pixel_max = std::numeric_limits::max(); - std::size_t pixel_min = std::numeric_limits::min(); + index_t const channels = num_channels::value; + coord_t const width = src_view.width(); + coord_t const height = src_view.height(); + std::size_t pixel_max = std::numeric_limits::max(); + std::size_t pixel_min = std::numeric_limits::min(); - for (std::size_t i = 0; i < channels; i++) + for (index_t i = 0; i < channels; i++) { histogram h; fill_histogram(nth_channel_view(src_view, i), h, bin_width, false, false, mask, src_mask); diff --git a/include/boost/gil/image_processing/histogram_matching.hpp b/include/boost/gil/image_processing/histogram_matching.hpp index 25107a7de6..54a8c50ad2 100644 --- a/include/boost/gil/image_processing/histogram_matching.hpp +++ b/include/boost/gil/image_processing/histogram_matching.hpp @@ -163,7 +163,7 @@ void histogram_matching( using dst_channel_t = typename channel_type::type; using coord_t = typename SrcView::x_coord_t; - std::size_t const channels = num_channels::value; + index_t const channels = num_channels::value; coord_t const width = src_view.width(); coord_t const height = src_view.height(); source_channel_t src_pixel_min = std::numeric_limits::min(); @@ -171,7 +171,7 @@ void histogram_matching( ref_channel_t ref_pixel_min = std::numeric_limits::min(); ref_channel_t ref_pixel_max = std::numeric_limits::max(); - for (std::size_t i = 0; i < channels; i++) + for (index_t i = 0; i < channels; i++) { histogram src_histogram; histogram ref_histogram; diff --git a/include/boost/gil/image_processing/morphology.hpp b/include/boost/gil/image_processing/morphology.hpp index babe1acb89..d6a80f497e 100644 --- a/include/boost/gil/image_processing/morphology.hpp +++ b/include/boost/gil/image_processing/morphology.hpp @@ -112,7 +112,7 @@ void morph(SrcView const& src_view, DstView const& dst_view, Kernel const& ker_m gil::image intermediate_img(src_view.dimensions()); - for (std::size_t i = 0; i < src_view.num_channels(); i++) + for (index_t i = 0; i < src_view.num_channels(); i++) { morph_impl(nth_channel_view(src_view, i), nth_channel_view(view(intermediate_img), i), ker_mat, identifier); @@ -153,7 +153,7 @@ void difference(SrcView const& src_view1, SrcView const& src_view2, DiffView con gil_function_requires::type, typename color_space_type::type>>(); - for (std::size_t i = 0; i < src_view1.num_channels(); i++) + for (index_t i = 0; i < src_view1.num_channels(); i++) { difference_impl(nth_channel_view(src_view1, i), nth_channel_view(src_view2, i), nth_channel_view(diff_view, i)); diff --git a/include/boost/gil/image_processing/threshold.hpp b/include/boost/gil/image_processing/threshold.hpp index b3b56356fc..7b106abc09 100644 --- a/include/boost/gil/image_processing/threshold.hpp +++ b/include/boost/gil/image_processing/threshold.hpp @@ -337,7 +337,7 @@ void threshold_optimal { if (mode == threshold_optimal_value::otsu) { - for (std::size_t i = 0; i < src_view.num_channels(); i++) + for (index_t i = 0; i < src_view.num_channels(); i++) { detail::otsu_impl (nth_channel_view(src_view, i), nth_channel_view(dst_view, i), direction);