#ifndef SLSDETECTORDATA_H #define SLSDETECTORDATA_H #include #include using namespace std; class slsDetectorData { public: /** Constructor (no error checking if datasize and offsets are compatible!) \param npx number of pixels in the x direction \param npy number of pixels in the y direction \param ds size of the dataset \param dMap array of size nx*ny storing the pointers to the data in the dataset (as offset) \param dMask Array of size nx*ny storing the polarity of the data in the dataset (should be 0 if no inversion is required, 0xffffffff is inversion is required) */ slsDetectorData(int npx, int npy=1, int ds=-1, int **dMap=NULL, int **dMask=NULL) { nx=npx; ny=npy; if (ds<=0) dataSize=nx*ny; else dataSize=ds; dataMask=new int*[ny]; for(int i = 0; i < ny; i++) { dataMask[i] = new int[nx]; } dataMap=new int*[ny]; for(int i = 0; i < ny; i++) { dataMap[i] = new int[nx]; } setDataMap(dMap); setDataMask(dMask); }; ~slsDetectorData() { for(int i = 0; i < ny; i++) { delete [] dataMap[i]; delete [] dataMask[i]; } delete [] dataMap; delete [] dataMask; } void setDataMap(int **dMap=NULL) { if (dMap==NULL) { for (int iy=0; iy