@@ -1132,7 +1132,7 @@ void vpImageTools::resize(const vpImage<Type> &I, vpImage<Type> &Ires, const vpI
1132
1132
}
1133
1133
}
1134
1134
}
1135
- }
1135
+ }
1136
1136
1137
1137
#if defined(VISP_HAVE_SIMDLIB)
1138
1138
template <>
@@ -1510,24 +1510,24 @@ void vpImageTools::warpLinear(const vpImage<Type> &src, const vpMatrix &T, vpIma
1510
1510
const float s = xi_ - x_;
1511
1511
1512
1512
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 ]) ;
1517
1517
const float col0 = lerp (val00, val01, s);
1518
1518
const float col1 = lerp (val10, val11, s);
1519
1519
const float interp = lerp (col0, col1, t);
1520
1520
dst[i][j] = vpMath::saturate<Type>(interp);
1521
1521
}
1522
1522
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_]) ;
1525
1525
const float interp = lerp (val00, val10, t);
1526
1526
dst[i][j] = vpMath::saturate<Type>(interp);
1527
1527
}
1528
1528
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 ]) ;
1531
1531
const float interp = lerp (val00, val01, s);
1532
1532
dst[i][j] = vpMath::saturate<Type>(interp);
1533
1533
}
@@ -1582,24 +1582,24 @@ void vpImageTools::warpLinear(const vpImage<Type> &src, const vpMatrix &T, vpIma
1582
1582
double t = y - y_lower;
1583
1583
1584
1584
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 ]) ;
1589
1589
const double col0 = lerp (val00, val01, s);
1590
1590
const double col1 = lerp (val10, val11, s);
1591
1591
const double interp = lerp (col0, col1, t);
1592
1592
dst[i][j] = vpMath::saturate<Type>(interp);
1593
1593
}
1594
1594
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]) ;
1597
1597
const double interp = lerp (val00, val10, t);
1598
1598
dst[i][j] = vpMath::saturate<Type>(interp);
1599
1599
}
1600
1600
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 ]) ;
1603
1603
const double interp = lerp (val00, val01, s);
1604
1604
dst[i][j] = vpMath::saturate<Type>(interp);
1605
1605
}
0 commit comments