FACT++  1.0
void MGImage::DrawColImg ( const byte gbuf,
const byte cbuf 
)

Definition at line 210 of file MGImage.cc.

References DrawColImg16(), DrawColImg24(), fHeight, fImage, fMuxPixmap, fWidth, kNeedRedraw, and kSyncMode.

Referenced by MStarguider::ProcessFrame().

211 {
212  if (TestBit(kSyncMode))
213  while (fMuxPixmap->Lock()==13)
214  usleep(1);
215  else
216  {
217  const Int_t rc = fMuxPixmap->Lock();
218  if (rc==13)
219  cout << "MGImage::DrawColImg - mutex is already locked by this thread" << endl;
220  if (rc)
221  return;
222  }
223 
224  // FROM libAfterImage:
225  // -------------------
226  //#define ALPHA_TRANSPARENT 0x00
227  //#define ALPHA_SEMI_TRANSPARENT 0x7F
228  //#define ALPHA_SOLID 0xFF
229  // * Lowermost 8 bits - Blue channel
230  // * bits 8 to 15 - Green channel
231  // * bits 16 to 23 - Red channel
232  // * bits 24 to 31 - Alpha channel
233  //#define ARGB32_White 0xFFFFFFFF
234  //#define ARGB32_Black 0xFF000000
235 
236  // FIXME: This loop depends on the screen color depth
237  switch (gVirtualX->GetDepth())
238  {
239  case 16:
240  DrawColImg16((unsigned short*)fImage->data, (char*)gbuf, (char*)cbuf, (char*)(gbuf+fWidth*fHeight));
241  break;
242  case 24:
243  DrawColImg24(fImage->data, (char*)gbuf, (char*)cbuf, (char*)(gbuf+fWidth*fHeight));
244  break;
245  default:
246  cout << "Sorry, " << gVirtualX->GetDepth() << "bit color depth not yet implemented." << endl;
247  }
248 
249  SetBit(kNeedRedraw);
250 
251  if (fMuxPixmap->UnLock()==13)
252  cout << "MGImage::DrawColImage - tried to unlock mutex locked by other thread." << endl;
253 }
TMutex * fMuxPixmap
Definition: MGImage.h:31
void DrawColImg16(unsigned short *d, char *s1, char *s2, char *e)
Definition: MGImage.cc:162
UInt_t fHeight
Definition: MGImage.h:29
XImage * fImage
Definition: MGImage.h:23
UInt_t fWidth
Definition: MGImage.h:28
void DrawColImg24(char *d, char *s1, char *s2, char *e)
Definition: MGImage.cc:186

+ Here is the call graph for this function:

+ Here is the caller graph for this function: