// // Programmer: Craig Stuart Sapp // Creation Date: Sat Nov 8 17:33:48 GMT-0800 1997 // Last Modified: Sat Nov 8 19:33:17 GMT-0800 1997 // Filename: ...sig/maint/code/base/LookupTable/LookupTable.cpp // Web Address: http://sig.sapp.org/src/sigBase/LookupTable.cpp // Documentation: http://sig.sapp.org/doc/classes/LookupTable // Syntax: C++ // #include "LookupTable.h" #include #ifndef OLDCPP #include using namespace std; #else #include #endif ////////////////////////////// // // LookupTable::LookupTable -- // default value: size = 0 // LookupTable::LookupTable(int size) : LookupTableCI(size) { interpolationType = LOOKUP_LINEAR; } LookupTable::LookupTable(sampleType* borrowedTable, int size) : LookupTableCI(borrowedTable, size) { interpolationType = LOOKUP_LINEAR; } LookupTable::LookupTable(const LookupTable& aTable) { interpolationType = aTable.interpolationType; maxSize = aTable.maxSize; borrowTableQ = aTable.borrowTableQ; if (!borrowQ()) { // internal table if (maxSize == 0) { tableData = NULL; } else { tableData = new sampleType[maxSize]; for (int i=0; i= maxSize-1) { b = tableData[0]; } else { b = tableData[(long)index+1]; } return (b - a) * (index-(long)index) + a; break; default: cerr << "Unknown interpolation type: " << interpolationType << endl; exit(1); } // include the following line for stuipd Visual C++ 5.0 compiler. // this line should never be reached. return 0.0; } // md5sum: 009b70fe1fca5b373c1ef584969a1f2f LookupTable.cpp [20050403]