00001 00048 #ifndef H_SincResampler 00049 #define H_SincResampler 00050 00051 #ifndef NO_DEPENDENCY_INCLUDES 00052 /* Dependent headers for the interface. 00053 */ 00054 00055 /* system includes */ 00056 #include <string> 00057 00058 /* Third party includes */ 00059 #include <blitz/array.h> 00060 00061 /* Internal includes */ 00062 // #include "common.h" 00063 00064 #endif 00065 00066 /* 00067 * The following typedefs get moved to a common.h declaration file linking the underlying 00068 * array/matrix representations to named types appropriate to the domain. 00069 */ 00070 00074 typedef blitz::Array<double,1> CalibratedRadianceSpectrum; 00075 00081 typedef unsigned long DetectorIndex_t; 00082 00083 00084 00085 00086 00091 struct ResamplingSettings_t 00092 /* is native byte order, IEEE floating point and integer */ 00093 /* Put this in a header file. And an interface control document. */ 00094 { 00098 double sourceLaserWavenumber; 00102 double targetLaserWavenumber; 00106 unsigned long inputPointCount; 00110 unsigned long qualityReductionFactor; // not yet used 00114 unsigned long decimationFactor; // not yet used 00115 }; 00116 00117 00118 00121 class AuditingServiceForSincResampler 00122 { 00123 public: 00124 00125 00126 }; 00127 00128 00132 class MonitoringServiceForSincResampler 00133 { 00134 public: 00137 virtual void resamplingCompleted() = 0; 00138 00141 virtual void resamplingAborted() = 0; 00142 00145 virtual void addingEntryToResamplingCache( DetectorIndex_t forThisDetector, size_t resultantCacheSize ) = 0; 00146 00150 virtual void removingEntryFromResamplingCache( DetectorIndex_t forThisDetector, size_t resultantCacheSize ) = 0; 00153 virtual void resamplingCacheFlushed( ) = 0; 00156 virtual void referenceResamplingSettingsNotFound( DetectorIndex_t forThisDetector ) = 0; 00157 }; 00158 00159 00164 class ReferenceDatabaseForSincResampler 00165 { 00166 public: 00167 00170 virtual const ResamplingSettings_t *operator[]( DetectorIndex_t ) = 0; 00171 }; 00172 00173 00178 class SincResampler 00179 { 00180 private: 00181 struct SincResamplerInternals &my; 00182 00183 public: 00184 00187 SincResampler( ReferenceDatabaseForSincResampler &, 00188 AuditingServiceForSincResampler &, 00189 MonitoringServiceForSincResampler & ); 00192 ~SincResampler(); 00193 00196 static const std::string &errorString(); 00197 00201 void referenceDatabaseHasChanged(); 00202 00206 void setMaxCacheSize( unsigned ); 00207 static const unsigned CACHE_SIZE_UNLIMITED; 00208 00211 unsigned maxCacheSize( ) const; 00212 00221 int operator()( CalibratedRadianceSpectrum &output, 00222 const CalibratedRadianceSpectrum &input, 00223 DetectorIndex_t pixel ); 00224 }; 00225 00226 #endif 00227