X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=include%2Finterpolator.h;h=267c937d609dbd2bb1932e7e700c4cfc73160f93;hb=6644d6564f4fad97d6d0d488abdd2b37ccba79cb;hp=1b1fc484b2fc24b63f382dff5cd522e10ecce587;hpb=320062d4d1e53ab9da799c77e9886b1e36cddcf5;p=ctsim.git diff --git a/include/interpolator.h b/include/interpolator.h index 1b1fc48..267c937 100644 --- a/include/interpolator.h +++ b/include/interpolator.h @@ -2,7 +2,7 @@ ** This is part of the CTSim program ** Copyright (c) 1983-2001 Kevin Rosenberg ** -** $Id: interpolator.h,v 1.4 2001/03/24 05:28:28 kevin Exp $ +** $Id: interpolator.h,v 1.7 2002/06/27 03:19:23 kevin Exp $ ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License (version 2) as @@ -53,8 +53,8 @@ template class BilinearInterpolator { private: T** const m_ppMatrix; - const unsigned int m_nx; - const unsigned int m_ny; + const int m_nx; + const int m_ny; public: BilinearInterpolator (T** ppMatrix, unsigned int nx, unsigned int ny) @@ -63,8 +63,8 @@ public: T interpolate (double dXPos, double dYPos) { - int iFloorX = floor (dXPos); - int iFloorY = floor (dYPos); + int iFloorX = static_cast(floor(dXPos)); + int iFloorY = static_cast(floor (dYPos)); double dXFrac = dXPos - iFloorX; double dYFrac = dYPos - iFloorY; @@ -103,10 +103,10 @@ public: T interpolate (double dXPos, double dYPos) { - int iFloorX = floor (dXPos); - int iFloorY = floor (dYPos); - double dXFrac = dXPos - iFloorX; - double dYFrac = dYPos - iFloorY; + // int iFloorX = static_cast(floor (dXPos)); + // int iFloorY = static_cast(floor (dYPos)); + // double dXFrac = dXPos - iFloorX; + // double dYFrac = dYPos - iFloorY; T result = 0; @@ -122,7 +122,7 @@ class LinearInterpolator { private: T* const m_pX; T* const m_pY; - const unsigned int m_n; + const int m_n; const bool m_bZeroOutsideRange; public: @@ -154,7 +154,7 @@ public: else result = m_pY[m_n - 1]; } else { - int iFloor = floor(dX); + int iFloor = static_cast(floor(dX)); result = m_pY[iFloor] + (m_pY[iFloor+1] - m_pY[iFloor]) * (dX - iFloor); } } else {