00001 #ifndef __CMVISION_TYPES_H__
00002 #define __CMVISION_TYPES_H__
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #include "colors.h"
00018
00019 namespace CMVision{
00020
00021
00022
00023
00024
00025 #define restrict
00026
00027 template <class pixel>
00028 class image{
00029 public:
00030 pixel *buf;
00031 int width,height,row_stride;
00032 };
00033
00034 template <class pixel>
00035 class image_idx{
00036 public:
00037 pixel *buf;
00038 int width,height,row_stride;
00039 };
00040
00041 template <class element>
00042 class image_yuv {
00043 public:
00044 element *buf_y,*buf_u,*buf_v;
00045 int width,height;
00046 int row_stride;
00047 int col_stride;
00048 };
00049
00050 #define CMV_PARAM <class pixel,class vimage,class threshold>
00051 #define CMV_TEM template CMV_PARAM
00052
00053 #define CMV_NONE ((unsigned)(-1))
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066 template <class cclass>
00067 class run{
00068 public:
00069 short x,y,width;
00070 cclass color;
00071 int parent,next;
00072 };
00073
00074 template <class cclass>
00075 class run_mini{
00076 public:
00077 short x,y,width;
00078 cclass color;
00079 short parent,next;
00080 };
00081
00082 struct region{
00083 int color;
00084 int x1,y1,x2,y2;
00085 float cen_x,cen_y;
00086 int area;
00087 int run_start;
00088 int iterator_id;
00089 region *next;
00090 };
00091
00092 struct region_small{
00093 short color;
00094 short x1,y1,x2,y2;
00095 short iterator_id;
00096 float cen_x,cen_y;
00097 int area;
00098 int run_start;
00099 region *next;
00100 };
00101
00102 struct region_tiny{
00103 uchar color;
00104 uchar x1,y1,x2,y2;
00105 float cen_x,cen_y;
00106 short area;
00107 short run_start;
00108 short iterator_id;
00109 region *next;
00110 };
00111
00112 struct color_class_state{
00113 color_class_state() : list(), num(), min_area(), total_area(), merge_threshold(), color(), name() {}
00114 color_class_state(const color_class_state& c) : list(c.list), num(c.num), min_area(c.min_area), total_area(c.total_area), merge_threshold(c.merge_threshold), color(c.color), name(c.name) {}
00115 color_class_state& operator=(const color_class_state& c) { list=c.list; num=c.num; min_area=c.min_area; total_area=c.total_area; merge_threshold=c.merge_threshold; color=c.color; name=c.name; return *this;}
00116 region *list;
00117 int num;
00118 int min_area;
00119 int total_area;
00120 float merge_threshold;
00121 rgb color;
00122 char *name;
00123 };
00124
00125 }
00126
00127 #endif