Make a library for writing and reading tiff, added tests (#347)

* removed Makefile for moench and integrated the build in CMake
* broke out tiff reading and writing to its own library
* moved tiff includes to include/sls
* moved tiffio source to src
* removed incorrectly used bps
* cleanup and tests for tiffio
* removed using namespace std from header
* some fixing for moench04
* Program for offline processing renamed

Co-authored-by: Anna Bergamaschi <anna.bergamaschi@psi.ch>
This commit is contained in:
Erik Fröjdh
2022-01-27 10:24:02 +01:00
committed by GitHub
parent 379d08dd03
commit f6e76145c1
32 changed files with 4948 additions and 2143 deletions

View File

@ -107,8 +107,8 @@ class moench03T1ReceiverDataNew : public slsDetectorData<uint16_t> {
#endif
if (dataMap[row][col] < 0 ||
dataMap[row][col] >= nSamples * 2 * 32)
cout << "Error: pointer " << dataMap[row][col]
<< " out of range " << endl;
std::cout << "Error: pointer " << dataMap[row][col]
<< " out of range " << std::endl;
}
}
}
@ -120,7 +120,7 @@ class moench03T1ReceiverDataNew : public slsDetectorData<uint16_t> {
ghost[iy][ix] = 0.;
int ipacket;
int ibyte;
uint ibyte;
int ii = 0;
for (ibyte = 0; ibyte < sizeof(sls_detector_header) / 2; ibyte++) {
xmap[ibyte] = -1;
@ -298,17 +298,17 @@ class moench03T1ReceiverDataNew : public slsDetectorData<uint16_t> {
/* return NULL; */
/* }; */
virtual char *readNextFrame(ifstream &filebin) {
virtual char *readNextFrame(std::ifstream &filebin) {
int ff = -1, np = -1;
return readNextFrame(filebin, ff, np);
};
virtual char *readNextFrame(ifstream &filebin, int &ff) {
virtual char *readNextFrame(std::ifstream &filebin, int &ff) {
int np = -1;
return readNextFrame(filebin, ff, np);
};
virtual char *readNextFrame(ifstream &filebin, int &ff, int &np) {
virtual char *readNextFrame(std::ifstream &filebin, int &ff, int &np) {
char *data = new char[dataSize];
char *d = readNextFrame(filebin, ff, np, data);
if (d == NULL) {
@ -318,17 +318,13 @@ class moench03T1ReceiverDataNew : public slsDetectorData<uint16_t> {
return data;
}
virtual char *readNextFrame(ifstream &filebin, int &ff, int &np,
virtual char *readNextFrame(std::ifstream &filebin, int &ff, int &np,
char *data) {
char *retval = 0;
int nd;
int fnum = -1;
np = 0;
int pn;
// cout << dataSize << endl;
if (ff >= 0)
fnum = ff;
if (filebin.is_open()) {
if (filebin.read(data, dataSize)) {