FACT++  1.0
void MGImage::DrawImg ( const byte buffer)

Definition at line 127 of file MGImage.cc.

References DrawImg16(), DrawImg24(), fHeight, fImage, fMuxPixmap, fWidth, kNeedRedraw, and kSyncMode.

Referenced by MStarguider::ProcessFrame().

128 {
129  if (TestBit(kSyncMode))
130  while (fMuxPixmap->Lock()==13)
131  usleep(1);
132  else
133  {
134  const Int_t rc = fMuxPixmap->Lock();
135  if (rc==13)
136  cout << "MGImage::DrawImg - mutex is already locked by this thread" << endl;
137  if (rc)
138  return;
139  }
140 
141  switch (gVirtualX->GetDepth())
142  {
143  case 8:
144  memcpy(fImage->data, buffer, fWidth*fHeight);
145  break;
146  case 16:
147  DrawImg16((unsigned short*)fImage->data, (char*)buffer, (char*)(buffer+fWidth*fHeight));
148  break;
149  case 24:
150  DrawImg24(fImage->data, (char*)buffer, (char*)(buffer+fWidth*fHeight));
151  break;
152  default:
153  cout << "Sorry, " << gVirtualX->GetDepth() << "bit color depth not yet implemented." << endl;
154  }
155 
156  SetBit(kNeedRedraw);
157 
158  if (fMuxPixmap->UnLock()==13)
159  cout << "MGImage::DrawImage - tried to unlock mutex locked by other thread." << endl;
160 }
TMutex * fMuxPixmap
Definition: MGImage.h:31
UInt_t fHeight
Definition: MGImage.h:29
XImage * fImage
Definition: MGImage.h:23
UInt_t fWidth
Definition: MGImage.h:28
void DrawImg16(unsigned short *d, char *s, char *e)
Definition: MGImage.cc:97
int buffer[BUFFSIZE]
Definition: db_dim_client.c:14
void DrawImg24(char *d, char *s, char *e)
Definition: MGImage.cc:113

+ Here is the call graph for this function:

+ Here is the caller graph for this function: