source: trunk/FACT++/drive/MGImage.h@ 18633

Last change on this file since 18633 was 18628, checked in by tbretz, 8 years ago
Dientengle from root and Mars, added the drawing function from their previous location.
File size: 2.0 KB
Line 
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
17class TMutex;
18
19typedef unsigned char byte;
20
21class 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; //! test
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
44public:
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
Note: See TracBrowser for help on using the repository browser.