00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef __FIREVISION_MODELS_SCANLINES_STAR_H_
00025 #define __FIREVISION_MODELS_SCANLINES_STAR_H_
00026
00027 #include <models/scanlines/scanlinemodel.h>
00028 #include <vector>
00029 #include <map>
00030
00031 namespace firevision {
00032 #if 0
00033 }
00034 #endif
00035
00036 class ScanlineStar : public ScanlineModel
00037 {
00038 public:
00039 ScanlineStar(unsigned int image_width, unsigned int image_height,
00040 unsigned int center_x, unsigned int center_y,
00041 unsigned int num_rays, unsigned int radius_incr,
00042 unsigned char* yuv_mask,
00043 unsigned int dead_radius = 0, unsigned int max_radius = 0,
00044 unsigned int margin = 0);
00045
00046 virtual ~ScanlineStar();
00047
00048 fawkes::point_t operator*();
00049 fawkes::point_t * operator->();
00050 fawkes::point_t * operator++();
00051 fawkes::point_t * operator++(int);
00052
00053 void advance();
00054 bool finished();
00055 void reset();
00056 const char* get_name();
00057 unsigned int get_margin();
00058 void set_robot_pose(float x, float y, float ori);
00059 void set_pan_tilt(float pan, float tilt);
00060 void skip_current_ray();
00061 unsigned int num_rays() const;
00062 unsigned int ray_index() const;
00063 unsigned int current_radius() const;
00064 float current_angle() const;
00065 bool first_on_ray() const;
00066
00067 private:
00068 void generate_scan_points();
00069
00070 unsigned int m_image_width;
00071 unsigned int m_image_height;
00072 fawkes::point_t m_center;
00073 unsigned int m_num_rays;
00074 unsigned int m_radius_incr;
00075 unsigned int m_dead_radius;
00076 unsigned int m_max_radius;
00077 unsigned int m_margin;
00078 float m_angle_incr;
00079 unsigned char* m_mask;
00080
00081 bool m_first_on_ray;
00082 bool m_done;
00083
00084 fawkes::point_t m_current_point;
00085 fawkes::point_t m_tmp_point;
00086 unsigned int m_ray_index;
00087
00088 typedef std::map<unsigned int, fawkes::point_t> Ray;
00089 std::map<float, Ray*> m_rays;
00090 std::map<float, Ray*>::iterator m_ray_iter;
00091 Ray::iterator m_point_iter;
00092
00093
00094
00095
00096 Ray* m_first_ray;
00097 Ray* m_previous_ray;
00098 };
00099
00100 }
00101
00102 #endif