Fawkes API Fawkes Development Version
colormap.h
1
2/**************************************************************************
3 * colormap.h - colormap interface
4 *
5 * Created: Sat Mar 29 12:45:29 2008
6 * Copyright 2005-2008 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_FVUTILS_COLORMAP_COLORMAP_H_
25#define _FIREVISION_FVUTILS_COLORMAP_COLORMAP_H_
26
27#include <fvutils/base/types.h>
28#include <sys/types.h>
29
30#include <list>
31
32namespace firevision {
33
34class ColormapFileBlock;
35
37{
38public:
39 virtual ~Colormap();
40
41 virtual color_t determine(unsigned int y, unsigned int u, unsigned int v) const = 0;
42 virtual void set(unsigned int y, unsigned int u, unsigned int v, color_t c) = 0;
43
44 virtual void reset() = 0;
45 virtual void set(unsigned char *buffer) = 0;
46
47 virtual size_t size() = 0;
48 virtual void to_image(unsigned char *yuv422_planar_buffer, unsigned int level = 0);
49 virtual unsigned int image_height() const;
50 virtual unsigned int image_width() const;
51
52 virtual unsigned char *get_buffer() const = 0;
53
54 virtual Colormap &operator+=(const Colormap &cmlt) = 0;
55 virtual Colormap &operator+=(const char *filename) = 0;
56
57 virtual unsigned int width() const = 0;
58 virtual unsigned int height() const = 0;
59 virtual unsigned int depth() const = 0;
60 virtual unsigned int deepness() const = 0;
61
62 virtual std::list<ColormapFileBlock *> get_blocks() = 0;
63};
64
65} // end namespace firevision
66
67#endif
Colormap interface.
Definition: colormap.h:37
virtual void set(unsigned char *buffer)=0
Set to the given raw buffer.
virtual Colormap & operator+=(const char *filename)=0
Convenience method for the method above.
virtual unsigned int image_width() const
Width of conversion image.
Definition: colormap.cpp:173
virtual ~Colormap()
Virtual empty destructor.
Definition: colormap.cpp:108
virtual unsigned int deepness() const =0
Get deepness of colormap.
virtual void to_image(unsigned char *yuv422_planar_buffer, unsigned int level=0)
Create image from LUT.
Definition: colormap.cpp:126
virtual color_t determine(unsigned int y, unsigned int u, unsigned int v) const =0
Determine color class for given YUV value.
virtual void set(unsigned int y, unsigned int u, unsigned int v, color_t c)=0
Set color class for given YUV value.
virtual unsigned int depth() const =0
Get depth of colormap.
virtual unsigned char * get_buffer() const =0
Get the raw buffer of this colormap.
virtual unsigned int height() const =0
Get height of colormap.
virtual std::list< ColormapFileBlock * > get_blocks()=0
Get file blocks for this colormap.
virtual void reset()=0
Reset colormap.
virtual unsigned int width() const =0
Get width of colormap.
virtual unsigned int image_height() const
Height of conversion image.
Definition: colormap.cpp:183
virtual size_t size()=0
Size in bytes of buffer returned by get_buffer().
virtual Colormap & operator+=(const Colormap &cmlt)=0
Adds the given colormap to this colormap.