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 class ColorModelLookupTable : public ColorModel
00033 {
00034 public:
00035
00036 ColorModelLookupTable(YuvColormap *colormap);
00037 ColorModelLookupTable(const char *file);
00038 ColorModelLookupTable(const char *file, const char *lut_id, bool destroy_on_free = false);
00039 ColorModelLookupTable(unsigned int depth, const char *lut_id, bool destroy_on_free);
00040 ColorModelLookupTable(const char *lut_id, bool destroy_on_free);
00041
00042 virtual ~ColorModelLookupTable();
00043
00044 virtual color_t determine(unsigned int y, unsigned int u, unsigned int v) const;
00045
00046 const char * get_name();
00047 YuvColormap * get_colormap() const;
00048
00049 void load(const char *filename);
00050
00051 void reset();
00052 static std::string compose_filename(const std::string format);
00053
00054 ColorModelLookupTable & operator+=(const ColorModelLookupTable &cmlt);
00055
00056 private:
00057 YuvColormap *__colormap;
00058 };
00059
00060
00061 inline color_t
00062 ColorModelLookupTable::determine(unsigned int y, unsigned int u, unsigned int v) const
00063 {
00064 return __colormap->determine(y, u, v);
00065 }
00066
00067 #endif