Revert "array2D: use size_t"

This reverts commit 584343fb36.
This commit is contained in:
Ingo Weyrich
2020-07-30 16:04:22 +02:00
parent 584343fb36
commit 3346ee5eea
2 changed files with 24 additions and 25 deletions

View File

@@ -146,8 +146,8 @@ void guidedFilter(const array2D<float> &guide, const array2D<float> &src, array2
#ifdef _OPENMP
# pragma omp parallel for if (multithread)
#endif
for (size_t y = 0; y < s.getHeight(); ++y) {
for (size_t x = 0; x < s.getWidth(); ++x) {
for (int y = 0; y < s.getHeight(); ++y) {
for (int x = 0; x < s.getWidth(); ++x) {
d[y][x] = s[y][x];
}
}
@@ -164,10 +164,9 @@ void guidedFilter(const array2D<float> &guide, const array2D<float> &src, array2
const auto f_mean =
[multithread](array2D<float> &d, array2D<float> &s, int rad) -> void
{
if (rtengine::min(s.getWidth(), s.getHeight()) > 1) {
rad = LIM<size_t>(rad, 0, (rtengine::min(s.getWidth(), s.getHeight()) - 1) / 2 - 1);
boxblur(static_cast<float**>(s), static_cast<float**>(d), rad, s.getWidth(), s.getHeight(), multithread);
}
rad = LIM(rad, 0, (min(s.getWidth(), s.getHeight()) - 1) / 2 - 1);
// boxblur(s, d, rad, s.getWidth(), s.getHeight(), multithread);
boxblur(static_cast<float**>(s), static_cast<float**>(d), rad, s.getWidth(), s.getHeight(), multithread);
};
array2D<float> I1(w, h);
@@ -250,8 +249,8 @@ void guidedFilterLog(const array2D<float> &guide, float base, array2D<float> &ch
#ifdef _OPENMP
# pragma omp parallel for if (multithread)
#endif
for (size_t y = 0; y < chan.getHeight(); ++y) {
for (size_t x = 0; x < chan.getWidth(); ++x) {
for (int y = 0; y < chan.getHeight(); ++y) {
for (int x = 0; x < chan.getWidth(); ++x) {
chan[y][x] = xlin2log(max(chan[y][x], 0.f), base);
}
}
@@ -261,8 +260,8 @@ void guidedFilterLog(const array2D<float> &guide, float base, array2D<float> &ch
#ifdef _OPENMP
# pragma omp parallel for if (multithread)
#endif
for (size_t y = 0; y < chan.getHeight(); ++y) {
for (size_t x = 0; x < chan.getWidth(); ++x) {
for (int y = 0; y < chan.getHeight(); ++y) {
for (int x = 0; x < chan.getWidth(); ++x) {
chan[y][x] = xlog2lin(max(chan[y][x], 0.f), base);
}
}