Skip to content

Commit a1f1fea

Browse files
committed
Fix visp_python_bindings build error in vpImageTools.h around lerp()
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]
1 parent acc2327 commit a1f1fea

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

modules/core/include/visp3/core/vpImageTools.h

+17-17
Original file line numberDiff line numberDiff line change
@@ -1132,7 +1132,7 @@ void vpImageTools::resize(const vpImage<Type> &I, vpImage<Type> &Ires, const vpI
11321132
}
11331133
}
11341134
}
1135-
}
1135+
}
11361136

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

15121512
if (y_ < static_cast<int>(src.getHeight()) - 1 && x_ < static_cast<int>(src.getWidth()) - 1) {
1513-
const Type val00 = src[y_][x_];
1514-
const Type val01 = src[y_][x_ + 1];
1515-
const Type val10 = src[y_ + 1][x_];
1516-
const Type val11 = src[y_ + 1][x_ + 1];
1513+
const float val00 = static_cast<float>(src[y_][x_]);
1514+
const float val01 = static_cast<float>(src[y_][x_ + 1]);
1515+
const float val10 = static_cast<float>(src[y_ + 1][x_]);
1516+
const float val11 = static_cast<float>(src[y_ + 1][x_ + 1]);
15171517
const float col0 = lerp(val00, val01, s);
15181518
const float col1 = lerp(val10, val11, s);
15191519
const float interp = lerp(col0, col1, t);
15201520
dst[i][j] = vpMath::saturate<Type>(interp);
15211521
}
15221522
else if (y_ < static_cast<int>(src.getHeight()) - 1) {
1523-
const Type val00 = src[y_][x_];
1524-
const Type val10 = src[y_ + 1][x_];
1523+
const float val00 = static_cast<float>(src[y_][x_]);
1524+
const float val10 = static_cast<float>(src[y_ + 1][x_]);
15251525
const float interp = lerp(val00, val10, t);
15261526
dst[i][j] = vpMath::saturate<Type>(interp);
15271527
}
15281528
else if (x_ < static_cast<int>(src.getWidth()) - 1) {
1529-
const Type val00 = src[y_][x_];
1530-
const Type val01 = src[y_][x_ + 1];
1529+
const float val00 = static_cast<float>(src[y_][x_]);
1530+
const float val01 = static_cast<float>(src[y_][x_ + 1]);
15311531
const float interp = lerp(val00, val01, s);
15321532
dst[i][j] = vpMath::saturate<Type>(interp);
15331533
}
@@ -1582,24 +1582,24 @@ void vpImageTools::warpLinear(const vpImage<Type> &src, const vpMatrix &T, vpIma
15821582
double t = y - y_lower;
15831583

15841584
if (y_lower < static_cast<int>(src.getHeight()) - 1 && x_lower < static_cast<int>(src.getWidth()) - 1) {
1585-
const Type val00 = src[y_lower][x_lower];
1586-
const Type val01 = src[y_lower][x_lower + 1];
1587-
const Type val10 = src[y_lower + 1][x_lower];
1588-
const Type val11 = src[y_lower + 1][x_lower + 1];
1585+
const double val00 = static_cast<double>(src[y_lower][x_lower]);
1586+
const double val01 = static_cast<double>(src[y_lower][x_lower + 1]);
1587+
const double val10 = static_cast<double>(src[y_lower + 1][x_lower]);
1588+
const double val11 = static_cast<double>(src[y_lower + 1][x_lower + 1]);
15891589
const double col0 = lerp(val00, val01, s);
15901590
const double col1 = lerp(val10, val11, s);
15911591
const double interp = lerp(col0, col1, t);
15921592
dst[i][j] = vpMath::saturate<Type>(interp);
15931593
}
15941594
else if (y_lower < static_cast<int>(src.getHeight()) - 1) {
1595-
const Type val00 = src[y_lower][x_lower];
1596-
const Type val10 = src[y_lower + 1][x_lower];
1595+
const double val00 = static_cast<double>(src[y_lower][x_lower]);
1596+
const double val10 = static_cast<double>(src[y_lower + 1][x_lower]);
15971597
const double interp = lerp(val00, val10, t);
15981598
dst[i][j] = vpMath::saturate<Type>(interp);
15991599
}
16001600
else if (x_lower < static_cast<int>(src.getWidth()) - 1) {
1601-
const Type val00 = src[y_lower][x_lower];
1602-
const Type val01 = src[y_lower][x_lower + 1];
1601+
const double val00 = static_cast<double>(src[y_lower][x_lower]);
1602+
const double val01 = static_cast<double>(src[y_lower][x_lower + 1]);
16031603
const double interp = lerp(val00, val01, s);
16041604
dst[i][j] = vpMath::saturate<Type>(interp);
16051605
}

0 commit comments

Comments
 (0)