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

Last change on this file since 7240 was 7230, checked in by fgoebel, 19 years ago
*** empty log message ***
File size: 2.3 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,
25 float &mx, float &my, unsigned int &sum) const;
26
27 int GetMeanPositionCircle(const int x, const int y,
28 const int box) const;
29 int GetMeanPositionCircle(const int x, const int y,
30 const int box, float &mx, float &my,
31 unsigned int &sum) const;
32
33 void RemoveTwinsInterpol(Leds &leds, Int_t first, Double_t radius) const;
34 void DrawBox(const int x1, const int y1,
35 const int x2, const int y2,
36 const int col) const;
37
38public:
39 FilterLed(byte *img, int w, int h, double cut=2.5)
40 : fImg(img), fW(w), fH(h), fBox(w>h?w:h), fCut(cut)
41 {
42 }
43
44 FilterLed(byte *img, int w, int h, int box, double cut=2.5)
45 : fImg(img), fW(w), fH(h), fBox(box), fCut(cut)
46 {
47 }
48
49 void SetBox(int box) { fBox = box; }
50 void SetCut(float cut) { fCut = cut; }
51 void FindStar(Leds &leds, int xc, int yc) const;
52 void FindStarCircle(Leds &leds, int xc, int yc) const;
53
54 void Execute(Leds &leds, int xc, int yc, double &bright) const;
55 void Execute(Leds &leds, int xc, int yc) const;
56 void Execute(Leds &leds) const { Execute(leds, fW/2, fH/2); }
57 void ExecuteAndMark(Leds &leds, int xc, int yc) const;
58 void ExecuteAndMark(Leds &leds, int xc, int yc, double &bright) const;
59 void ExecuteAndMark(Leds &leds) const { ExecuteAndMark(leds, fW/2, fH/2); }
60 void Execute(int xc, int yc) const;
61 void Execute() const { Execute(fW/2, fH/2); }
62 void MarkPoint(const Led &led) const;
63 void MarkPoint(Float_t x, Float_t y, Float_t mag) const;
64 void Stretch() const;
65 void DrawCircle(float cx, float cy, float r, byte col=0x40) const;
66 void DrawCircle(float r, byte col=0x40) const { DrawCircle(fW/2, fH/2, r, col); }
67 void DrawCircle(const Ring &c, byte col=0x40) const;
68 void DrawCircle(const Ring &c, double r, byte col) const;
69
70 ClassDef(FilterLed, 0)
71};
72
73#endif
Note: See TracBrowser for help on using the repository browser.