Changeset 4105 for trunk/MagicSoft/Cosy/videodev
- Timestamp:
- 05/20/04 05:01:03 (21 years ago)
- Location:
- trunk/MagicSoft/Cosy/videodev
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/videodev/Camera.h
r4076 r4105 1 #ifndef C AMERA_H2 #define C AMERA_H1 #ifndef COSY_Camera 2 #define COSY_Camera 3 3 4 4 #ifndef ROOT_TMutex -
trunk/MagicSoft/Cosy/videodev/FilterLed.cc
r4076 r4105 8 8 #include "Ring.h" 9 9 10 #include "MGMap.h" 11 10 12 ClassImp(FilterLed); 11 12 void FilterLed::DrawCircle(float cx, float cy, float rpix, byte col) const13 {14 if (cx-rpix<1 || cy-rpix<1 || cx+rpix>fW-2 || cy+rpix>fH-2)15 return;16 17 for (int dx=-(int)(rpix*0.7); dx<(int)(rpix*0.7); dx+=2)18 {19 const int dy = (int)sqrt(rpix*rpix-dx*dx);20 fImg[(int)(cx+dx) + (int)(cy-dy)*fW] = col;21 fImg[(int)(cx+dx) + (int)(cy+dy)*fW] = col;22 fImg[(int)(cx-dy) + (int)(cy+dx)*fW] = col;23 fImg[(int)(cx+dy) + (int)(cy+dx)*fW] = col;24 }25 }26 27 void FilterLed::DrawCircle(const Ring &l, byte col=0x40) const28 {29 DrawCircle(l.GetX(), l.GetY(), l.GetR(), col);30 }31 32 void FilterLed::DrawCircle(const Ring &l, double r, byte col=0x40) const33 {34 DrawCircle(l.GetX(), l.GetY(), r, col);35 }36 13 37 14 void FilterLed::DrawBox(const int x1, const int y1, … … 39 16 const int col) const 40 17 { 41 for (int x=x1; x<x2+1; x++) 42 for (int y=y1; y<y2+1; y++) 43 if (x>=0 && x<fW-1 && y>=0 && y<fH-1) 44 fImg[y*fW+x] = col; 45 } 46 47 void FilterLed::MarkPoint(const Led &led) const 48 { 49 const int x = (int)(led.GetX()+.5); 50 const int y = (int)(led.GetY()+.5); 51 const int m = (int)(led.GetMag()); 52 53 MarkPoint(x, y, m); 18 MGMap::DrawBox(fImg, 768, 576, x1, y1, x2, y2, col); 54 19 } 55 20 … … 64 29 DrawBox(x+5, y, x+8, y, m); 65 30 DrawBox(x, y-8, x, y-5, m); 31 } 32 33 void FilterLed::MarkPoint(const Led &led) const 34 { 35 const int x = (int)(led.GetX()+.5); 36 const int y = (int)(led.GetY()+.5); 37 const int m = (int)(led.GetMag()); 38 39 MarkPoint(x, y, m); 40 } 41 42 void FilterLed::DrawCircle(float cx, float cy, float r, byte col) const 43 { 44 MGMap::DrawCircle(fImg, 768, 576, cx, cy, r, col); 45 } 46 47 void FilterLed::DrawCircle(const Ring &l, byte col) const 48 { 49 DrawCircle(l.GetX(), l.GetY(), l.GetR(), col); 50 } 51 52 void FilterLed::DrawCircle(const Ring &l, double r, byte col) const 53 { 54 DrawCircle(l.GetX(), l.GetY(), r, col); 66 55 } 67 56
Note:
See TracChangeset
for help on using the changeset viewer.