#include #include #include #include #include #include Double_t *sumArray; TASImage *summer(char *prefix, Int_t seq, Int_t end, Int_t start=1) { bool oldFliCam = true; std::stringstream sst; sst << prefix << "_" << std::setw(3) << std::setfill('0') << seq << "_" << std::setw(3) << std::setfill('0') << 0 << ".tif"; TASImage *img = new TASImage(sst.str().c_str()); // the new Andor camera uses a different filename convention if (!img) { sst.str(""); sst << prefix << "_scan" << std::setfill('0') << std::setw(3) << seq << "_" << std::setfill('0') << std::setw(3) << start << ".tiff"; img = new TASImage(sst.str().c_str()); oldFliCam = false; } // read the dimensions of the topographs from the first image file Int_t height = img->GetHeight(); Int_t width = img->GetWidth(); UInt_t *reference = (UInt_t *)img->GetRgbaArray(); sumArray = new Double_t[width*height]; for (Int_t index=start; indexGetRgbaArray(); for (Int_t iv=0,k=0; iv>24) & 0xff; Int_t ref_green = (reference[k]>>16) & 0xff; Int_t ref_blue = (reference[k]>>8) & 0xff; //Int_t ref_alpha = (reference[k]>>0) & 0xff; Int_t red = (pixel[k]>>24) & 0xff; Int_t green = (pixel[k]>>16) & 0xff; Int_t blue = (pixel[k]>>8) & 0xff; //Int_t alpha = (pixel[k]>>0) & 0xff; Double_t intensity = red-ref_red + green-ref_green + blue-ref_blue; if (intensity > 0) { sumArray[k] += intensity; } } } delete [] pixel; delete frame; } img->SetImage(sumArray,width,height); delete [] sumArray; delete reference; return img; }