qualifiers.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef __FIREVISION_APPS_NAO_LOC_QUALIFIERS_H_
00024 #define __FIREVISION_APPS_NAO_LOC_QUALIFIERS_H_
00025
00026 #include <fvutils/color/colorspaces.h>
00027 #include <fvutils/base/types.h>
00028
00029 namespace firevision {
00030 #if 0
00031 }
00032 #endif
00033
00034 class Qualifier
00035 {
00036 public:
00037 Qualifier();
00038 virtual ~Qualifier();
00039
00040
00041
00042
00043
00044 virtual int get(fawkes::point_t pixel) = 0;
00045
00046 virtual unsigned char* get_buffer();
00047 virtual void set_buffer(unsigned char* buffer, unsigned int width = 0,
00048 unsigned int height = 0);
00049
00050 virtual colorspace_t get_colorspace();
00051 virtual void set_colorspace(colorspace_t colorspace);
00052
00053
00054 protected:
00055 Qualifier(unsigned char* buffer, unsigned int width,
00056 unsigned int height, colorspace_t colorspace);
00057
00058
00059 unsigned char* buffer_;
00060
00061
00062 unsigned int width_;
00063
00064 unsigned int height_;
00065
00066
00067 unsigned int size_;
00068
00069
00070 colorspace_t colorspace_;
00071 };
00072
00073
00074 class LumaQualifier: public Qualifier
00075 {
00076 public:
00077 LumaQualifier() {};
00078 LumaQualifier(unsigned char* buffer, unsigned int width,
00079 unsigned int height, colorspace_t colorspace);
00080 virtual ~LumaQualifier() {};
00081
00082 virtual int get(fawkes::point_t pixel);
00083 };
00084
00085
00086 class SkyblueQualifier: public Qualifier
00087 {
00088 public:
00089 SkyblueQualifier() {};
00090 SkyblueQualifier(unsigned char* buffer, unsigned int width,
00091 unsigned int height, colorspace_t colorspace);
00092 virtual ~SkyblueQualifier() {};
00093
00094 virtual int get(fawkes::point_t pixel);
00095
00096
00097 private:
00098 static const unsigned int threshold_ = 128;
00099 };
00100
00101
00102 class YellowQualifier: public Qualifier
00103 {
00104 public:
00105 YellowQualifier() {};
00106 YellowQualifier(unsigned char* buffer, unsigned int width,
00107 unsigned int height, colorspace_t colorspace);
00108 virtual ~YellowQualifier() {};
00109
00110 virtual int get(fawkes::point_t pixel);
00111
00112
00113 private:
00114 static const unsigned int threshold_ = 100;
00115 };
00116
00117 }
00118
00119 #endif // __FIREVISION_APPS_NAO_LOC_QUALIFIERS_H_