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 class Qualifier
00030 {
00031 public:
00032 Qualifier();
00033 virtual ~Qualifier();
00034
00035
00036
00037
00038
00039 virtual int get(fawkes::point_t pixel) = 0;
00040
00041 virtual unsigned char* get_buffer();
00042 virtual void set_buffer(unsigned char* buffer, unsigned int width = 0,
00043 unsigned int height = 0);
00044
00045 virtual colorspace_t get_colorspace();
00046 virtual void set_colorspace(colorspace_t colorspace);
00047
00048
00049 protected:
00050 Qualifier(unsigned char* buffer, unsigned int width,
00051 unsigned int height, colorspace_t colorspace);
00052
00053
00054 unsigned char* buffer_;
00055
00056
00057 unsigned int width_;
00058
00059 unsigned int height_;
00060
00061
00062 unsigned int size_;
00063
00064
00065 colorspace_t colorspace_;
00066 };
00067
00068
00069 class LumaQualifier: public Qualifier
00070 {
00071 public:
00072 LumaQualifier() {};
00073 LumaQualifier(unsigned char* buffer, unsigned int width,
00074 unsigned int height, colorspace_t colorspace);
00075 virtual ~LumaQualifier() {};
00076
00077 virtual int get(fawkes::point_t pixel);
00078 };
00079
00080
00081 class SkyblueQualifier: public Qualifier
00082 {
00083 public:
00084 SkyblueQualifier() {};
00085 SkyblueQualifier(unsigned char* buffer, unsigned int width,
00086 unsigned int height, colorspace_t colorspace);
00087 virtual ~SkyblueQualifier() {};
00088
00089 virtual int get(fawkes::point_t pixel);
00090
00091
00092 private:
00093 static const unsigned int threshold_ = 128;
00094 };
00095
00096
00097 class YellowQualifier: public Qualifier
00098 {
00099 public:
00100 YellowQualifier() {};
00101 YellowQualifier(unsigned char* buffer, unsigned int width,
00102 unsigned int height, colorspace_t colorspace);
00103 virtual ~YellowQualifier() {};
00104
00105 virtual int get(fawkes::point_t pixel);
00106
00107
00108 private:
00109 static const unsigned int threshold_ = 100;
00110 };
00111
00112 #endif // __FIREVISION_APPS_NAO_LOC_QUALIFIERS_H_