FACT++  1.0
MGImage.h
Go to the documentation of this file.
1 #ifndef MGIMAGE_H
2 #define MGIMAGE_H
3 
4 //
5 // This File contains the declaration of the MGImage-class
6 //
7 // Author: Thomas Bretz
8 // Version: V1.0 (1-8-2000)
9 
10 #ifndef ROOT_TGFrame
11 #include <TGFrame.h>
12 #endif
13 #ifndef ROOT_TGX11
14 #include <TGX11.h>
15 #endif
16 
17 class TMutex;
18 
19 typedef unsigned char byte;
20 
21 class MGImage : public TGFrame
22 {
23  XImage *fImage;
24 
25  GContext_t fDefGC;
26  //Pixmap_t fPixmap;
27 
28  UInt_t fWidth;
29  UInt_t fHeight;
30 
31  TMutex *fMuxPixmap;
32 
33  enum
34  {
35  kNeedRedraw = BIT(17),
36  kSyncMode = BIT(18)
37  };
38 
39  void DrawImg16(unsigned short *d, char *s, char *e);
40  void DrawImg24(char *d, char *s, char *e);
41  void DrawColImg16(unsigned short *d, char *s1, char *s2, char *e);
42  void DrawColImg24(char *d, char *s1, char *s2, char *e);
43 
44 public:
45  MGImage(const TGWindow* p, UInt_t w, UInt_t h, UInt_t options = kSunkenFrame, ULong_t back = fgDefaultFrameBackground);
46  ~MGImage();
47 
48  void DoRedraw();
49 
50  void DrawImg(const byte *buffer);
51  void DrawColImg(const byte *gbuf, const byte *cbuf);
52 
53  void EnableSyncMode() { SetBit(kSyncMode); }
54  void DisableSyncMode() { ResetBit(kSyncMode); }
55 
56  static UChar_t Color(int col);
57  static void DrawCircle(UChar_t *buf, int w, int h, Float_t x, Float_t y, Float_t r, UChar_t col);
58  static void DrawHexagon(UChar_t *buf, int w, int h, Float_t x, Float_t y, Float_t r, UChar_t col, Int_t style=1);
59  static void DrawLine(UChar_t *buf, int w, int h, Float_t x1, Float_t y1, Float_t x2, Float_t y2, UChar_t col, Int_t style=1);
60  static void DrawBox(UChar_t *buf, int w, int h, Float_t x1, Float_t y1, Float_t x2, Float_t y2, UChar_t col, Int_t style=1);
61  static void DrawDot(UChar_t *buf, int w, int h, Float_t cx, Float_t cy, UChar_t col);
62  static void DrawMultiply(UChar_t *buf, int w, int h, Float_t cx, Float_t cy, Float_t size, UChar_t col);
63  static void DrawCross(UChar_t *buf, int w, int h, Float_t cx, Float_t cy, Float_t size, UChar_t col);
64 };
65 
66 #endif // MGIMAGE_H
TMutex * fMuxPixmap
Definition: MGImage.h:31
static void DrawHexagon(UChar_t *buf, int w, int h, Float_t x, Float_t y, Float_t r, UChar_t col, Int_t style=1)
Definition: MGImage.cc:324
void DrawColImg(const byte *gbuf, const byte *cbuf)
Definition: MGImage.cc:210
void DrawColImg16(unsigned short *d, char *s1, char *s2, char *e)
Definition: MGImage.cc:162
void DoRedraw()
Definition: MGImage.cc:74
void EnableSyncMode()
Definition: MGImage.h:53
UInt_t fHeight
Definition: MGImage.h:29
XImage * fImage
Definition: MGImage.h:23
static void DrawMultiply(UChar_t *buf, int w, int h, Float_t cx, Float_t cy, Float_t size, UChar_t col)
Definition: MGImage.cc:419
~MGImage()
Definition: MGImage.cc:57
UInt_t fWidth
Definition: MGImage.h:28
static void DrawCross(UChar_t *buf, int w, int h, Float_t cx, Float_t cy, Float_t size, UChar_t col)
Definition: MGImage.cc:425
static UChar_t Color(int col)
Definition: MGImage.cc:259
static void DrawLine(UChar_t *buf, int w, int h, Float_t x1, Float_t y1, Float_t x2, Float_t y2, UChar_t col, Int_t style=1)
Definition: MGImage.cc:279
void DrawImg16(unsigned short *d, char *s, char *e)
Definition: MGImage.cc:97
unsigned char byte
Definition: MGImage.h:17
static void DrawDot(UChar_t *buf, int w, int h, Float_t cx, Float_t cy, UChar_t col)
Definition: MGImage.cc:389
MGImage(const TGWindow *p, UInt_t w, UInt_t h, UInt_t options=kSunkenFrame, ULong_t back=fgDefaultFrameBackground)
Definition: MGImage.cc:34
int buffer[BUFFSIZE]
Definition: db_dim_client.c:14
int size
Definition: db_dim_server.c:17
void DrawColImg24(char *d, char *s1, char *s2, char *e)
Definition: MGImage.cc:186
void DisableSyncMode()
Definition: MGImage.h:54
void DrawImg(const byte *buffer)
Definition: MGImage.cc:127
static void DrawCircle(UChar_t *buf, int w, int h, Float_t x, Float_t y, Float_t r, UChar_t col)
Definition: MGImage.cc:350
void DrawImg24(char *d, char *s, char *e)
Definition: MGImage.cc:113
GContext_t fDefGC
Definition: MGImage.h:25
static void DrawBox(UChar_t *buf, int w, int h, Float_t x1, Float_t y1, Float_t x2, Float_t y2, UChar_t col, Int_t style=1)
Definition: MGImage.cc:311