Fawkes API
Fawkes Development Version
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
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
37
class
ColorModelLookupTable
:
public
ColorModel
38
{
39
public
:
40
41
ColorModelLookupTable
(
YuvColormap
*colormap);
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
61
ColorModelLookupTable
& operator+=(
const
ColorModelLookupTable
&cmlt);
62
63
private
:
64
YuvColormap
*__colormap;
65
};
66
67
68
inline
color_t
69
ColorModelLookupTable::determine(
unsigned
int
y,
unsigned
int
u,
unsigned
int
v)
const
70
{
71
return
__colormap->
determine
(y, u, v);
72
}
73
74
}
// end namespace firevision
75
76
#endif
firevision::ColorModel
Color model interface.
Definition:
colormodel.h:34
firevision::YuvColormap::determine
virtual color_t determine(unsigned int y, unsigned int u, unsigned int v) const
Determine color class for given YUV value.
Definition:
yuvcm.h:94
firevision::ColorModelLookupTable
Color model based on a lookup table.
Definition:
lookuptable.h:37
firevision
Definition:
vision_master.h:32
firevision::YuvColormap
YUV Colormap.
Definition:
yuvcm.h:39
src
libs
fvmodels
color
lookuptable.h
Generated by
1.8.9.1