** This is part of the CTSim program
** Copyright (c) 1983-2001 Kevin Rosenberg
**
-** $Id: interpolator.h,v 1.3 2001/03/22 02:30:00 kevin Exp $
+** $Id: interpolator.h,v 1.5 2001/03/30 22:09:09 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
double interpolate (double x);
};
+
class CubicPolyInterpolator {
private:
const double* const m_pdY;
T interpolate (double dXPos, double dYPos)
{
- int iFloorX = floor (dXPos);
- int iFloorY = floor (dYPos);
+ int iFloorX = static_cast<int>(floor(dXPos));
+ int iFloorY = static_cast<int>(floor (dYPos));
double dXFrac = dXPos - iFloorX;
double dYFrac = dYPos - iFloorY;
};
+template<class T>
+class BicubicPolyInterpolator {
+private:
+ T** const m_ppMatrix;
+ const unsigned int m_nx;
+ const unsigned int m_ny;
+
+public:
+ BicubicPolyInterpolator (T** ppMatrix, unsigned int nx, unsigned int ny)
+ : m_ppMatrix(ppMatrix), m_nx(nx), m_ny(ny)
+ {}
+
+ T interpolate (double dXPos, double dYPos)
+ {
+ int iFloorX = floor (dXPos);
+ int iFloorY = floor (dYPos);
+ double dXFrac = dXPos - iFloorX;
+ double dYFrac = dYPos - iFloorY;
+
+ T result = 0;
+
+ // Need to add code
+
+ return result;
+ }
+};
+
+
template<class T>
class LinearInterpolator {
private: