| 1 | #ifndef CAOS_FilterLed
|
|---|
| 2 | #define CAOS_FilterLed
|
|---|
| 3 |
|
|---|
| 4 | #ifndef __CINT__
|
|---|
| 5 | #include <TROOT.h>
|
|---|
| 6 | #endif
|
|---|
| 7 |
|
|---|
| 8 | typedef unsigned char byte;
|
|---|
| 9 |
|
|---|
| 10 | class Led;
|
|---|
| 11 | class Leds;
|
|---|
| 12 | class Ring;
|
|---|
| 13 |
|
|---|
| 14 | class FilterLed
|
|---|
| 15 | {
|
|---|
| 16 | byte *fImg;
|
|---|
| 17 | int fW;
|
|---|
| 18 | int fH;
|
|---|
| 19 | int fBoxW;
|
|---|
| 20 | int fBoxH;
|
|---|
| 21 | float fCut;
|
|---|
| 22 |
|
|---|
| 23 | void GetMinMax(const int offset, byte *min, byte *max) const;
|
|---|
| 24 | int GetMeanPosition(const int x, const int y, const int box) const;
|
|---|
| 25 | int GetMeanPosition(const int x, const int y, const int box, float &mx, float &my) const;
|
|---|
| 26 | void RemoveTwinsInterpol(Leds &leds, Int_t first, Double_t radius) const;
|
|---|
| 27 | void DrawBox(const int x1, const int y1,
|
|---|
| 28 | const int x2, const int y2,
|
|---|
| 29 | const int col) const;
|
|---|
| 30 |
|
|---|
| 31 | public:
|
|---|
| 32 | FilterLed(byte *img, int w, int h, double cut=2.5)
|
|---|
| 33 | : fImg(img), fW(w), fH(h), fBoxW(w/2), fBoxH(h/2), fCut(cut)
|
|---|
| 34 | {
|
|---|
| 35 | }
|
|---|
| 36 |
|
|---|
| 37 | FilterLed(byte *img, int w, int h, int box, double cut=2.5)
|
|---|
| 38 | : fImg(img), fW(w), fH(h), fBoxW(box), fBoxH(box), fCut(cut)
|
|---|
| 39 | {
|
|---|
| 40 | }
|
|---|
| 41 |
|
|---|
| 42 | FilterLed(byte *img, int w, int h, int boxw, int boxh, double cut=2.5)
|
|---|
| 43 | : fImg(img), fW(w), fH(h), fBoxW(boxw), fBoxH(boxh), fCut(cut)
|
|---|
| 44 | {
|
|---|
| 45 | }
|
|---|
| 46 |
|
|---|
| 47 | void Execute(Leds &leds, int xc, int yc) const;
|
|---|
| 48 | void Execute(Leds &leds) const { Execute(leds, fW/2, fH/2); }
|
|---|
| 49 | void ExecuteAndMark(Leds &leds, int xc, int yc) const;
|
|---|
| 50 | void ExecuteAndMark(Leds &leds) const { ExecuteAndMark(leds, fW/2, fH/2); }
|
|---|
| 51 | void Execute(int xc, int yc) const;
|
|---|
| 52 | void Execute() const { Execute(fW/2, fH/2); }
|
|---|
| 53 | void MarkPoint(const Led &led) const;
|
|---|
| 54 | void MarkPoint(Float_t x, Float_t y, Float_t mag) const;
|
|---|
| 55 | void Stretch() const;
|
|---|
| 56 | void DrawCircle(float cx, float cy, float r, byte col=0x40) const;
|
|---|
| 57 | void DrawCircle(float r, byte col=0x40) const { DrawCircle(r, fW/2.+.5, fH/2.+.5, col); }
|
|---|
| 58 | void DrawCircle(const Ring &c, byte col=0x40) const;
|
|---|
| 59 | void DrawCircle(const Ring &c, double r, byte col) const;
|
|---|
| 60 |
|
|---|
| 61 | ClassDef(FilterLed, 0)
|
|---|
| 62 | };
|
|---|
| 63 |
|
|---|
| 64 | #endif
|
|---|