52 gettimeofday(&
fTime, NULL);
55 for (
int y=0; y<576; y++)
56 for (
int x=0; x<768; x++)
58 const Int_t p = (x+y*768)*4;
59 fImg[x+y*768] = ((UInt_t)img[p+1]+(UInt_t)img[p+2]+(UInt_t)img[p+3])/3;
64 unsigned char *dest =
fImg;
65 for (
const unsigned char *ptr=img; ptr<img+768*576*4; ptr+=4)
66 *dest++ = (UShort_t(ptr[1])+UShort_t(ptr[2])+UShort_t(ptr[3]))/3;
79 cout <<
"Camera::Thread: ERROR - Device not open." << endl;
120 unsigned char *img = 0;
125 TThread::CancelPoint();
130 TThread::CancelPoint();
152 cout <<
"ERROR - At least five captured images timed out." << endl;
163 cout <<
fNumFrame-1 <<
" frames processed." << endl;
Int_t CancelThread(void **ret=0)
Bool_t Open(Int_t channel=0)
Int_t CaptureWait(unsigned int frame, unsigned char **ptr=0) const
void ProcessFrame(unsigned char *img)
Int_t GetNumBuffers() const
Bool_t CaptureStart(unsigned int frame) const
unsigned char fImg[cols *rows]
Camera(PixClient &client, Int_t ch=0)
Int_t RunThread(void *arg=0)
virtual void ProcessFrame(const unsigned long n, byte *img, struct timeval *tm)