Skip to content

Commit

Permalink
Fix visp_python_bindings build error in vpImageTools.h around lerp()
Browse files Browse the repository at this point in the history
usage
C:\visp-ws\visp\modules\core\include\visp3\core\vpImageTools.h(1589,31):
error C2666: 'vpImageTools
::lerp' : les fonctions surchargées ont des conversions similaires.
[C:\visp-ws\visp-build-bindings-vc17\modules\python\bindings\_visp.vcxproj]
  • Loading branch information
fspindle committed Mar 13, 2024
1 parent acc2327 commit a1f1fea
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions modules/core/include/visp3/core/vpImageTools.h
Original file line number Diff line number Diff line change
Expand Up @@ -1132,7 +1132,7 @@ void vpImageTools::resize(const vpImage<Type> &I, vpImage<Type> &Ires, const vpI
}
}
}
}
}

#if defined(VISP_HAVE_SIMDLIB)
template <>
Expand Down Expand Up @@ -1510,24 +1510,24 @@ void vpImageTools::warpLinear(const vpImage<Type> &src, const vpMatrix &T, vpIma
const float s = xi_ - x_;

if (y_ < static_cast<int>(src.getHeight()) - 1 && x_ < static_cast<int>(src.getWidth()) - 1) {
const Type val00 = src[y_][x_];
const Type val01 = src[y_][x_ + 1];
const Type val10 = src[y_ + 1][x_];
const Type val11 = src[y_ + 1][x_ + 1];
const float val00 = static_cast<float>(src[y_][x_]);
const float val01 = static_cast<float>(src[y_][x_ + 1]);
const float val10 = static_cast<float>(src[y_ + 1][x_]);
const float val11 = static_cast<float>(src[y_ + 1][x_ + 1]);
const float col0 = lerp(val00, val01, s);
const float col1 = lerp(val10, val11, s);
const float interp = lerp(col0, col1, t);
dst[i][j] = vpMath::saturate<Type>(interp);
}
else if (y_ < static_cast<int>(src.getHeight()) - 1) {
const Type val00 = src[y_][x_];
const Type val10 = src[y_ + 1][x_];
const float val00 = static_cast<float>(src[y_][x_]);
const float val10 = static_cast<float>(src[y_ + 1][x_]);
const float interp = lerp(val00, val10, t);
dst[i][j] = vpMath::saturate<Type>(interp);
}
else if (x_ < static_cast<int>(src.getWidth()) - 1) {
const Type val00 = src[y_][x_];
const Type val01 = src[y_][x_ + 1];
const float val00 = static_cast<float>(src[y_][x_]);
const float val01 = static_cast<float>(src[y_][x_ + 1]);
const float interp = lerp(val00, val01, s);
dst[i][j] = vpMath::saturate<Type>(interp);
}
Expand Down Expand Up @@ -1582,24 +1582,24 @@ void vpImageTools::warpLinear(const vpImage<Type> &src, const vpMatrix &T, vpIma
double t = y - y_lower;

if (y_lower < static_cast<int>(src.getHeight()) - 1 && x_lower < static_cast<int>(src.getWidth()) - 1) {
const Type val00 = src[y_lower][x_lower];
const Type val01 = src[y_lower][x_lower + 1];
const Type val10 = src[y_lower + 1][x_lower];
const Type val11 = src[y_lower + 1][x_lower + 1];
const double val00 = static_cast<double>(src[y_lower][x_lower]);
const double val01 = static_cast<double>(src[y_lower][x_lower + 1]);
const double val10 = static_cast<double>(src[y_lower + 1][x_lower]);
const double val11 = static_cast<double>(src[y_lower + 1][x_lower + 1]);
const double col0 = lerp(val00, val01, s);
const double col1 = lerp(val10, val11, s);
const double interp = lerp(col0, col1, t);
dst[i][j] = vpMath::saturate<Type>(interp);
}
else if (y_lower < static_cast<int>(src.getHeight()) - 1) {
const Type val00 = src[y_lower][x_lower];
const Type val10 = src[y_lower + 1][x_lower];
const double val00 = static_cast<double>(src[y_lower][x_lower]);
const double val10 = static_cast<double>(src[y_lower + 1][x_lower]);
const double interp = lerp(val00, val10, t);
dst[i][j] = vpMath::saturate<Type>(interp);
}
else if (x_lower < static_cast<int>(src.getWidth()) - 1) {
const Type val00 = src[y_lower][x_lower];
const Type val01 = src[y_lower][x_lower + 1];
const double val00 = static_cast<double>(src[y_lower][x_lower]);
const double val01 = static_cast<double>(src[y_lower][x_lower + 1]);
const double interp = lerp(val00, val01, s);
dst[i][j] = vpMath::saturate<Type>(interp);
}
Expand Down

0 comments on commit a1f1fea

Please sign in to comment.