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

Last change on this file since 6964 was 4865, checked in by rwagner, 20 years ago
*** empty log message ***
File size: 2.0 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 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
31public:
32 FilterLed(byte *img, int w, int h, double cut=2.5)
33 : fImg(img), fW(w), fH(h), fBox(w>h?w:h), 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), fBox(box), fCut(cut)
39 {
40 }
41
42 void SetBox(int box) { fBox = box; }
43 void SetCut(float cut) { fCut = cut; }
44 void FindStar(Leds &leds, int xc, int yc) const;
45 void Execute(Leds &leds, int xc, int yc, double &bright) const;
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, int xc, int yc, double &bright) 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(fW/2, fH/2, r, 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
Note: See TracBrowser for help on using the repository browser.