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#include <fvutils/colormap/yuvcm.h>
29
30#include <string>
31
32namespace firevision {
33
35{
36public:
38 ColorModelLookupTable(const char *file);
39 ColorModelLookupTable(const char *file, const char *lut_id, bool destroy_on_free = false);
40 ColorModelLookupTable(unsigned int depth, const char *lut_id, bool destroy_on_free);
41 ColorModelLookupTable(const char *lut_id, bool destroy_on_free);
42
43 virtual ~ColorModelLookupTable();
44
45 virtual color_t determine(unsigned int y, unsigned int u, unsigned int v) const;
46
47 const char * get_name();
49
50 void load(const char *filename);
51
52 void set_colormap(const YuvColormap &yuvcm);
53
54 void reset();
55 static std::string compose_filename(const std::string format);
56
58
59private:
60 YuvColormap *colormap_;
61};
62
63} // end namespace firevision
64
65#endif
Color model based on a lookup table.
Definition: lookuptable.h:35
const char * get_name()
Get name of color model.
YuvColormap * get_colormap() const
Get colormap.
ColorModelLookupTable(YuvColormap *colormap)
Create a lookup table with given dimensions not using shared memory.
Definition: lookuptable.cpp:59
void load(const char *filename)
Load colormap from file.
void set_colormap(const YuvColormap &yuvcm)
Set colormap.
static std::string compose_filename(const std::string format)
Compose filename.
virtual ~ColorModelLookupTable()
Destructor.
ColorModelLookupTable & operator+=(const ColorModelLookupTable &cmlt)
Add colormaps.
virtual color_t determine(unsigned int y, unsigned int u, unsigned int v) const
Determine classification of YUV pixel.
Color model interface.
Definition: colormodel.h:32
YUV Colormap.
Definition: yuvcm.h:36