lookuptable.h

00001
00002 /**************************************************************************
00003  *  lookuptable.h - This header defines a lookup table color model
00004  *
00005  *  Generated: Fri Jun 10 14:16:52 2005
00006  *  Copyright  2005  Tim Niemueller  [www.niemueller.de]
00007  *
00008  ***************************************************************************/
00009
00010 /*  This program is free software; you can redistribute it and/or modify
00011  *  it under the terms of the GNU General Public License as published by
00012  *  the Free Software Foundation; either version 2 of the License, or
00013  *  (at your option) any later version. A runtime exception applies to
00014  *  this software (see LICENSE.GPL_WRE file mentioned below for details).
00015  *
00016  *  This program is distributed in the hope that it will be useful,
00017  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  *  GNU Library General Public License for more details.
00020  *
00021  *  Read the full text in the LICENSE.GPL_WRE file in the doc directory.
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