lookuptable.h
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_COLOR_LOOKUPTABLE_H_
00025 #define __FIREVISION_MODELS_COLOR_LOOKUPTABLE_H_
00026
00027 #include <models/color/colormodel.h>
00028
00029 #include <fvutils/colormap/yuvcm.h>
00030 #include <string>
00031
00032 namespace firevision {
00033 #if 0
00034 }
00035 #endif
00036
00037 class ColorModelLookupTable : public ColorModel
00038 {
00039 public:
00040
00041 ColorModelLookupTable(YuvColormap *colormap);
00042 ColorModelLookupTable(const char *file);
00043 ColorModelLookupTable(const char *file, const char *lut_id, bool destroy_on_free = false);
00044 ColorModelLookupTable(unsigned int depth, const char *lut_id, bool destroy_on_free);
00045 ColorModelLookupTable(const char *lut_id, bool destroy_on_free);
00046
00047 virtual ~ColorModelLookupTable();
00048
00049 virtual color_t determine(unsigned int y, unsigned int u, unsigned int v) const;
00050
00051 const char * get_name();
00052 YuvColormap * get_colormap() const;
00053
00054 void load(const char *filename);
00055
00056 void reset();
00057 static std::string compose_filename(const std::string format);
00058
00059 ColorModelLookupTable & operator+=(const ColorModelLookupTable &cmlt);
00060
00061 private:
00062 YuvColormap *__colormap;
00063 };
00064
00065
00066 inline color_t
00067 ColorModelLookupTable::determine(unsigned int y, unsigned int u, unsigned int v) const
00068 {
00069 return __colormap->determine(y, u, v);
00070 }
00071
00072 }
00073
00074 #endif