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