source: trunk/MagicSoft/Cosy/videodev/FilterLed.h@ 4692

Last change on this file since 4692 was 4076, checked in by tbretz, 21 years ago
*** empty log message ***
File size: 1.9 KB
Line 
1#ifndef CAOS_FilterLed
2#define CAOS_FilterLed
3
4#ifndef __CINT__
5#include <TROOT.h>
6#endif
7
8typedef unsigned char byte;
9
10class Led;
11class Leds;
12class Ring;
13
14class FilterLed
15{
16 byte *fImg;
17 int fW;
18 int fH;
19 int fBox;
20 float fCut;
21
22 void GetMinMax(const int offset, byte *min, byte *max) const;
23 int GetMeanPosition(const int x, const int y, const int box) const;
24 int GetMeanPosition(const int x, const int y, const int box, float &mx, float &my, unsigned int &sum) const;
25 void RemoveTwinsInterpol(Leds &leds, Int_t first, Double_t radius) const;
26 void DrawBox(const int x1, const int y1,
27 const int x2, const int y2,
28 const int col) const;
29
30public:
31 FilterLed(byte *img, int w, int h, double cut=2.5)
32 : fImg(img), fW(w), fH(h), fBox(w>h?w:h), fCut(cut)
33 {
34 }
35
36 FilterLed(byte *img, int w, int h, int box, double cut=2.5)
37 : fImg(img), fW(w), fH(h), fBox(box), fCut(cut)
38 {
39 }
40
41 void SetBox(int box) { fBox = box; }
42 void SetCut(float cut) { fCut = cut; }
43
44 void FindStar(Leds &leds, int xc, int yc) const;
45
46 void Execute(Leds &leds, int xc, int yc) const;
47 void Execute(Leds &leds) const { Execute(leds, fW/2, fH/2); }
48 void ExecuteAndMark(Leds &leds, int xc, int yc) const;
49 void ExecuteAndMark(Leds &leds) const { ExecuteAndMark(leds, fW/2, fH/2); }
50 void Execute(int xc, int yc) const;
51 void Execute() const { Execute(fW/2, fH/2); }
52 void MarkPoint(const Led &led) const;
53 void MarkPoint(Float_t x, Float_t y, Float_t mag) const;
54 void Stretch() const;
55 void DrawCircle(float cx, float cy, float r, byte col=0x40) const;
56 void DrawCircle(float r, byte col=0x40) const { DrawCircle(fW/2, fH/2, r, col); }
57 void DrawCircle(const Ring &c, byte col=0x40) const;
58 void DrawCircle(const Ring &c, double r, byte col) const;
59
60 ClassDef(FilterLed, 0)
61};
62
63#endif
Note: See TracBrowser for help on using the repository browser.