Skip to content

Commit 0f93276

Browse files
committed
switch uses of nth_channel_view to boost::gil::index_t
1 parent b9ecb13 commit 0f93276

File tree

7 files changed

+17
-17
lines changed

7 files changed

+17
-17
lines changed

include/boost/gil/image_processing/adaptive_histogram_equalization.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,9 @@ void non_overlapping_interpolated_clahe(
157157
using dst_channel_t = typename channel_type<DstView>::type;
158158
using coord_t = typename SrcView::x_coord_t;
159159

160-
std::size_t const channels = num_channels<SrcView>::value;
161-
coord_t const width = src_view.width();
162-
coord_t const height = src_view.height();
160+
index_t const channels = num_channels<SrcView>::value;
161+
coord_t const width = src_view.width();
162+
coord_t const height = src_view.height();
163163

164164
// Find control points
165165

@@ -184,7 +184,7 @@ void non_overlapping_interpolated_clahe(
184184

185185
copy_pixels(src_view, subimage_view(view(padded_img), top_left_x, top_left_y, width, height));
186186

187-
for (std::size_t k = 0; k < channels; k++)
187+
for (index_t k = 0; k < channels; k++)
188188
{
189189
std::vector<histogram<source_channel_t>> prev_row(new_width / tile_width_x),
190190
next_row((new_width / tile_width_x));

include/boost/gil/image_processing/convolve.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ void convolve_2d(SrcView const& src_view, Kernel const& kernel, DstView const& d
430430
typename color_space_type<DstView>::type
431431
>::value, "Source and destination views must have pixels with the same color space");
432432

433-
for (std::size_t i = 0; i < src_view.num_channels(); i++)
433+
for (index_t i = 0; i < src_view.num_channels(); i++)
434434
{
435435
detail::convolve_2d_impl(
436436
nth_channel_view(src_view, i),

include/boost/gil/image_processing/filter.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ void median_filter(SrcView const& src_view, DstView const& dst_view, std::size_t
124124
src_view.height()
125125
);
126126

127-
for (std::size_t channel = 0; channel < extended_view.num_channels(); channel++)
127+
for (index_t channel = 0; channel < extended_view.num_channels(); channel++)
128128
{
129129
detail::filter_median_impl(
130130
nth_channel_view(extended_view, channel),

include/boost/gil/image_processing/histogram_equalization.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,13 @@ void histogram_equalization(
117117
using dst_channel_t = typename channel_type<DstView>::type;
118118
using coord_t = typename SrcView::x_coord_t;
119119

120-
std::size_t const channels = num_channels<SrcView>::value;
121-
coord_t const width = src_view.width();
122-
coord_t const height = src_view.height();
123-
std::size_t pixel_max = (std::numeric_limits<dst_channel_t>::max)();
124-
std::size_t pixel_min = (std::numeric_limits<dst_channel_t>::min)();
120+
index_t const channels = num_channels<SrcView>::value;
121+
coord_t const width = src_view.width();
122+
coord_t const height = src_view.height();
123+
std::size_t pixel_max = (std::numeric_limits<dst_channel_t>::max)();
124+
std::size_t pixel_min = (std::numeric_limits<dst_channel_t>::min)();
125125

126-
for (std::size_t i = 0; i < channels; i++)
126+
for (index_t i = 0; i < channels; i++)
127127
{
128128
histogram<source_channel_t> h;
129129
fill_histogram(nth_channel_view(src_view, i), h, bin_width, false, false, mask, src_mask);

include/boost/gil/image_processing/histogram_matching.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,15 +163,15 @@ void histogram_matching(
163163
using dst_channel_t = typename channel_type<DstView>::type;
164164
using coord_t = typename SrcView::x_coord_t;
165165

166-
std::size_t const channels = num_channels<SrcView>::value;
166+
index_t const channels = num_channels<SrcView>::value;
167167
coord_t const width = src_view.width();
168168
coord_t const height = src_view.height();
169169
source_channel_t src_pixel_min = (std::numeric_limits<source_channel_t>::min)();
170170
source_channel_t src_pixel_max = (std::numeric_limits<source_channel_t>::max)();
171171
ref_channel_t ref_pixel_min = (std::numeric_limits<ref_channel_t>::min)();
172172
ref_channel_t ref_pixel_max = (std::numeric_limits<ref_channel_t>::max)();
173173

174-
for (std::size_t i = 0; i < channels; i++)
174+
for (index_t i = 0; i < channels; i++)
175175
{
176176
histogram<source_channel_t> src_histogram;
177177
histogram<ref_channel_t> ref_histogram;

include/boost/gil/image_processing/morphology.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ void morph(SrcView const& src_view, DstView const& dst_view, Kernel const& ker_m
112112

113113
gil::image<typename DstView::value_type> intermediate_img(src_view.dimensions());
114114

115-
for (std::size_t i = 0; i < src_view.num_channels(); i++)
115+
for (index_t i = 0; i < src_view.num_channels(); i++)
116116
{
117117
morph_impl(nth_channel_view(src_view, i), nth_channel_view(view(intermediate_img), i),
118118
ker_mat, identifier);
@@ -153,7 +153,7 @@ void difference(SrcView const& src_view1, SrcView const& src_view2, DiffView con
153153
gil_function_requires<ColorSpacesCompatibleConcept<
154154
typename color_space_type<SrcView>::type, typename color_space_type<DiffView>::type>>();
155155

156-
for (std::size_t i = 0; i < src_view1.num_channels(); i++)
156+
for (index_t i = 0; i < src_view1.num_channels(); i++)
157157
{
158158
difference_impl(nth_channel_view(src_view1, i), nth_channel_view(src_view2, i),
159159
nth_channel_view(diff_view, i));

include/boost/gil/image_processing/threshold.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ void threshold_optimal
337337
{
338338
if (mode == threshold_optimal_value::otsu)
339339
{
340-
for (std::size_t i = 0; i < src_view.num_channels(); i++)
340+
for (index_t i = 0; i < src_view.num_channels(); i++)
341341
{
342342
detail::otsu_impl
343343
(nth_channel_view(src_view, i), nth_channel_view(dst_view, i), direction);

0 commit comments

Comments
 (0)