Fawkes API  Fawkes Development Version
lookuptable.h
1 
2 /**************************************************************************
3  * lookuptable.h - This header defines a lookup table color model
4  *
5  * Created: Fri Jun 10 14:16:52 2005
6  * Copyright 2005 Tim Niemueller [www.niemueller.de]
7  *
8  ***************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version. A runtime exception applies to
14  * this software (see LICENSE.GPL_WRE file mentioned below for details).
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Library General Public License for more details.
20  *
21  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22  */
23 
24 #ifndef __FIREVISION_MODELS_COLOR_LOOKUPTABLE_H_
25 #define __FIREVISION_MODELS_COLOR_LOOKUPTABLE_H_
26 
27 #include <fvmodels/color/colormodel.h>
28 
29 #include <fvutils/colormap/yuvcm.h>
30 #include <string>
31 
32 namespace firevision {
33 #if 0 /* just to make Emacs auto-indent happy */
34 }
35 #endif
36 
38 {
39  public:
40 
42  ColorModelLookupTable(const char *file);
43  ColorModelLookupTable(const char *file, const char *lut_id, bool destroy_on_free = false);
44  ColorModelLookupTable(unsigned int depth, const char *lut_id, bool destroy_on_free);
45  ColorModelLookupTable(const char *lut_id, bool destroy_on_free);
46 
47  virtual ~ColorModelLookupTable();
48 
49  virtual color_t determine(unsigned int y, unsigned int u, unsigned int v) const;
50 
51  const char * get_name();
52  YuvColormap * get_colormap() const;
53 
54  void load(const char *filename);
55 
56  void set_colormap(const YuvColormap &yuvcm);
57 
58  void reset();
59  static std::string compose_filename(const std::string format);
60 
62 
63  private:
64  YuvColormap *__colormap;
65 };
66 
67 } // end namespace firevision
68 
69 #endif
Color model interface.
Definition: colormodel.h:34
virtual color_t determine(unsigned int y, unsigned int u, unsigned int v) const
Determine classification of YUV pixel.
void reset()
Reset colormap.
Color model based on a lookup table.
Definition: lookuptable.h:37
YUV Colormap.
Definition: yuvcm.h:39
YuvColormap * get_colormap() const
Get colormap.
void set_colormap(const YuvColormap &yuvcm)
Set colormap.
void load(const char *filename)
Load colormap from file.
static std::string compose_filename(const std::string format)
Compose filename.
virtual ~ColorModelLookupTable()
Destructor.
ColorModelLookupTable & operator+=(const ColorModelLookupTable &cmlt)
Add colormaps.
ColorModelLookupTable(YuvColormap *colormap)
Create a lookup table with given dimensions not using shared memory.
Definition: lookuptable.cpp:64
const char * get_name()
Get name of color model.